Hi,
I will tell you about the RMAN (Recovery Manager) tool that we use frequently Backup and Restore operations in Oracle Databases in this first article of my tutorial series.
Read my rman backup tutorial series before this article with following links. We will use these backups in this restore recover tutorial series.
https://ittutorial.org/2019/03/27/oracle-rman-recovery-manager-backup-tutorials-8/
After telling the list of different types of Backups taken with RMAN, let us now check the correctness or integrity of the backups. Integrity and correctness of the backups is very important subject. Think of it as your database was Crash and you need to restore from the last backup with RMAN, but backup cannot be restored. RMAN says you can not restore it because the backup is broken or invalid.
So Integrity and correctness of the backups is very important subject, we need to frequently check backup’s integrity as Oracle DBA.
Correctness and integrity of the database backup is provided by the following command.
[oracle@MehmetSalih backup]$ rman target / Recovery Manager: Release 19.0.0.0.0 - Production on Tue Mar 26 06:05:23 2019 Version 19.2.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: DEVECI19 (DBID=4027228950) RMAN> RESTORE DATABASE VALIDATE; Starting restore at 26-MAR-19 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=90 device type=DISK channel ORA_DISK_1: starting validation of datafile backup set channel ORA_DISK_1: reading from backup piece /oradata/install/dbs/17ttc4u5_1_1 channel ORA_DISK_1: piece handle=/oradata/install/dbs/17ttc4u5_1_1 tag=TAG20190326T010509 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: validation complete, elapsed time: 00:00:02 channel ORA_DISK_1: starting validation of datafile backup set channel ORA_DISK_1: reading from backup piece /oradata/install/dbs/19ttc4ua_1_1 channel ORA_DISK_1: piece handle=/oradata/install/dbs/19ttc4ua_1_1 tag=TAG20190326T010509 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: validation complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting validation of datafile backup set channel ORA_DISK_1: reading from backup piece /oradata/install/dbs/16ttc4u5_1_1 channel ORA_DISK_1: piece handle=/oradata/install/dbs/16ttc4u5_1_1 tag=TAG20190326T010509 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: validation complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting validation of datafile backup set channel ORA_DISK_1: reading from backup piece /oradata/install/dbs/15ttc4u5_1_1 channel ORA_DISK_1: piece handle=/oradata/install/dbs/15ttc4u5_1_1 tag=TAG20190326T010509 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: validation complete, elapsed time: 00:00:45 Finished restore at 26-MAR-19 RMAN>
On the other hand, we can check Correctness and integrity of the Control file backup, which is the brain of our database, with the Validate command as follows.
RMAN> VALIDATE CURRENT CONTROLFILE; Starting validate at 26-MAR-19 using channel ORA_DISK_1 channel ORA_DISK_1: starting validation of datafile channel ORA_DISK_1: specifying datafile(s) for validation including current control file for validation channel ORA_DISK_1: validation complete, elapsed time: 00:00:01 List of Control File and SPFILE =============================== File Type Status Blocks Failing Blocks Examined ------------ ------ -------------- --------------- Control File OK 0 646 Finished validate at 26-MAR-19 RMAN>
You can validate All Archivelogs with following command.
RMAN> VALIDATE ARCHIVELOG ALL; Starting validate at 26-MAR-19 using channel ORA_DISK_1 channel ORA_DISK_1: starting validation of archived log channel ORA_DISK_1: specifying archived log(s) for validation input archived log thread=1 sequence=3 RECID=1 STAMP=1003861571 input archived log thread=1 sequence=4 RECID=2 STAMP=1003861685 input archived log thread=1 sequence=5 RECID=3 STAMP=1003884793 input archived log thread=1 sequence=6 RECID=4 STAMP=1003885446 input archived log thread=1 sequence=7 RECID=5 STAMP=1003885500 input archived log thread=1 sequence=8 RECID=6 STAMP=1003885570 channel ORA_DISK_1: validation complete, elapsed time: 00:00:01 List of Archived Logs ===================== Thrd Seq Status Blocks Failing Blocks Examined Name ---- ------- ------ -------------- --------------- --------------- 1 3 OK 0 6265 /oradata/install/dbs/arch1_3_1001759193.dbf 1 4 OK 0 3 /oradata/install/dbs/arch1_4_1001759193.dbf 1 5 OK 0 270374 /oradata/install/dbs/arch1_5_1001759193.dbf 1 6 OK 0 8890 /oradata/install/dbs/arch1_6_1001759193.dbf 1 7 OK 0 2 /oradata/install/dbs/arch1_7_1001759193.dbf 1 8 OK 0 89 /oradata/install/dbs/arch1_8_1001759193.dbf Finished validate at 26-MAR-19
Archivelog Backups are validated like following.
RMAN> RESTORE ARCHIVELOG ALL VALIDATE; Starting restore at 26-MAR-19 using channel ORA_DISK_1 channel ORA_DISK_1: scanning archived log /oradata/install/dbs/arch1_3_1001759193.dbf channel ORA_DISK_1: scanning archived log /oradata/install/dbs/arch1_4_1001759193.dbf channel ORA_DISK_1: scanning archived log /oradata/install/dbs/arch1_5_1001759193.dbf channel ORA_DISK_1: scanning archived log /oradata/install/dbs/arch1_6_1001759193.dbf channel ORA_DISK_1: scanning archived log /oradata/install/dbs/arch1_7_1001759193.dbf channel ORA_DISK_1: scanning archived log /oradata/install/dbs/arch1_8_1001759193.dbf Finished restore at 26-MAR-19
We will continue to tell restore and recover in the next post.
Do you want to learn Oracle Database for Beginners, then read the following articles.
https://ittutorial.org/oracle-database-19c-tutorials-for-beginners/