When we use catalog instead of controlfile as rmanrepository, the metadata information about the backup will also be stored in controlfil, so that when we use rman,
When we use catalog instead of controlfile as rman repository, the metadata information about the backup will also be stored in controlfil, so that when we use rman,
When we use catalog instead of controlfile as rman repository, the metadata information about the backup will also be stored in controlfil, so that when we use rman, you can use the information in controlfile even if the catalog is temporarily unavailable.
When we can connect to the catalog next time, we can also use resync catalog to manually move the backup information in the controlfile to the catalog.
RMAN> resync catalog;
Starting full resync of recovery catalog
Full resync complete
In fact, when we use catalog to release commands such as backup, delete, and list, rman will implicitly synchronize the contents of the catalog. In this way, during backup, at the same time, the information in controlfile and catalog is consistent.
First, check the current backup information. There are two backups: 277 and 278.
RMAN> list backup summary;
List of Backups
====================
Key ty lv s Device Type Completion Time # Pieces # Copies Compressed Tag
-----------------------------------------------------------------
277 B F A DISK 22-FEB-14 1 1 NO TAG20140222T050832
278 B F A DISK 22-FEB-14 1 1 NO TAG20140222T050832
The query results in catalog are the same. Currently, rman is connected using catalog.
SQL> select BS_KEy from rman. bp;
BS_KEY
----------
277
278
Now use nocatalog for a backup
[Oracle @ o12c ~] $ ORACLE_HOME/bin/rman target/nocatalog
RMAN> backup datafile 1;
........
RMAN> list backup summary;
List of Backups
====================
Key ty lv s Device Type Completion Time # Pieces # Copies Compressed Tag
-----------------------------------------------------------------
46 B F A DISK 22-FEB-14 1 1 NO TAG20140222T050832
47 B F A DISK 22-FEB-14 1 1 NO TAG20140222T050832
48 B F A DISK 22-FEB-14 1 1 NO TAG20140222T051944
49 B F A DISK 22-FEB-14 1 1 NO TAG20140222T051944
Currently, the files are read from controlfile. The keys are different, but the tags of the backups are the same. This indicates that the contents in controlfile are inconsistent with those in catalog.
Connect again using catalog,
[Oracle @ o12c ~] $ ORACLE_HOME/bin/rman target/catalog = rman/rman @ testasm
RMAN> list backup summary;
List of Backups
====================
Key ty lv s Device Type Completion Time # Pieces # Copies Compressed Tag
-----------------------------------------------------------------
277 B F A DISK 22-FEB-14 1 1 NO TAG20140222T050832
278 B F A DISK 22-FEB-14 1 1 NO TAG20140222T050832
304 B F A DISK 22-FEB-14 1 1 NO TAG20140222T051944
305 B F A DISK 22-FEB-14 1 1 NO TAG20140222T051944
Using list backup summary, we can see that rman will automatically help us to perform a controlfile and catalog synchronization first. Now it is consistent with the backup information in the files under control.
-------------------------------------- Split line --------------------------------------
Recommended reading:
RMAN: Configure an archive log deletion policy
Basic Oracle tutorial-copying a database through RMAN
Reference for RMAN backup policy formulation
RMAN backup learning notes
Oracle Database Backup encryption RMAN Encryption
-------------------------------------- Split line --------------------------------------