Uncatalog of backuppiece in Oracle Rman and delete of backupset, rmanbackuppiece
This article is the original article, reproduced please indicate the source: http://write.blog.csdn.net/postedit/42424083
This article is based on Oracle 10.2.0.4 to perform the following tests:
RMAN> list backup of archivelog all; much is omitted in the middle and only the following is retained: BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 1410 326.36 1409 m disk 00:00:41 05-JAN-15 BP Key: Status: AVAILABLE Compressed: NO Tag: TAG20150105T102705 ------------------> BP Key: 1409 Piece Name: F: \ LOG_FIPRUSNS_1_1 List of Archived Logs in backup set 1410 Thrd Seq Low SCN Low Tim E Next SCN Next Time ---- ------- ---------- --------- ---------- 1 1191 23261014 25-DEC-14 23279746 26-DEC-14 1 1192 23279746 26-DEC-14 23293125 03-JAN-15 1 1193 03-JAN-15 23293125 03-JAN-15 23296401 03-JAN- 15 1 1194 23296401 03-JAN-15 23300534 03-JAN-15 1 1195 23300534 03-JAN-15 23304302 03-JAN-15 1 1196 03-JAN-15 23304302 03- JAN-15 1 1197 23308204 03-JAN-15 23316571 03-JAN-15 1 1198 23 316571 03-JAN-15 23316578 03-JAN-15 1 1199 23316578 03-JAN-15 23343180 04-JAN-15 1 1200 04-JAN-15 23343180 05-JAN-15 1 1201 23367540 05-JAN-15 23368004 05-JAN-15 1 1202 23368004 05-JAN-15 23368006 05-JAN-15 1 1203 23368006 05-JAN-15 23368009 05-JAN -15 1 1204 23368009 05-JAN-15 23368011 05-JAN-15 1 1205 23368011 05-JAN-15 23369315 05-JAN-15RMAN> change backuppiece 1409 uncatalog; --> uncata Log means to delete the records in the control file, and the backup files on the OS will not be moved! (Backup files on OS will not be deleted) uncataloged backuppiecebackup piece handle = F: \ LOG_FIPRUSNS_1_1 recid = 1409 stamp = 868184831 Uncataloged 1 objectsRMAN> list backup of archivelog all;
How to return the backup file back:
RMAN> catalog backuppiece 'f: \ LOG_FIPRUSNS_1_1 '; cataloged backuppiecebackup piece handle = F: \ LOG_FIPRUSNS_1_1 recid = 1413 stamp = 868188578 -----> the command can be executed multiple times, add 1 RMAN> cataloged backuppiece 'f: \ Shanghai'; cataloged backuppiecebackup piece handle = F: \ LOG_FIPRUSNS_1_1 recid = 1414 stamp = 868188598 -----> This command can be executed multiple times, add 1 for each recid execution
The following describes the changes of BSkey and BP Key after the catalog is returned:
RMAN> list backup of archivelog all; much is omitted in the middle and only the following is retained: BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ------------- ------------------- 1410 326.36 1410 m disk 00:00:41 05-JAN-15 --------------------> BS Key:, BS Key number has not changed to BP Key: 1414 Status: AVAILABLE Compressed: NO Tag: TAG20150105T102705 -------> BP Key: 1414, BP Key number changed, add 1 Piece Name: F: \ shortlist of Archived Logs in backup set 1410 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- 1 1191 23261014 25-DEC-14 23279746 26-DEC-14 1 1192 23279746 26-DEC-14 23293125 03-JAN 14 -15 1 1193 23293125 03-JAN-15 23296401 03-JAN-15 1 1194 23296401 03-JAN-15 23300534 03-JAN-15 1 1195 23300534 03-JAN-15 23304302 03 -JAN-15 1 1196 23304302 03-JAN-15 23308204 03-JAN-15 1 1197 23308204 03-JAN-15 23316571 03-JAN-15 1 1198 23316571 03-JAN-15 23316578 03-JAN-15 1 1199 23316578 03-JAN-15 23343180 04-JAN-15 1 1200 23343180 04-JAN-15 23367540 05-JAN-15 1 1201 05-JAN -15 23368004 05-JAN-15 1 1202 23368004 05-JAN-15 23368006 05-JAN-15 1 1203 05-JAN-15 23368006 05-JAN-15 1 23368009 05 -JAN-15 23368011 05-JAN-15 1 1205 23368011 05-JAN-15 23369315 05-JAN-15
The following is a test of backupset revocation from catalog:
RMAN> change backupset 1410 uncatalog; --------------------> the backupset cannot use change uncatalog !!! RMAN-00571: ========================================================== ============================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-03002: failure of uncatalog command at 01/05/2015 14: 14: 31RMAN-06122: CHANGE .. UNCATALOG not supported for BACKUPSETRMAN> change backupset 1410 delete; --> change backupset delete Effect There are two levels: delete records in the control file and Delete backup files on the OS! Using channel ORA_DISK_1List of Backup PiecesBP Key BS Key Pc # Cp # Status Device Type Piece Name ------- --- ----------- ---------- 1414 1410 1 available disk f: \ LOG_FIPRUSNS_1_1Do you really want to delete the above objects (enter YES or NO )? Yesdeleted backup piecebackup piece handle = F: \ LOG_FIPRUSNS_1_1 recid = 1414 stamp = 868188598 Deleted 1 objectsRMAN> ---- the file F: \ LOG_FIPRUSNS_1_1 on the OS has been Deleted.
If you manually copy the backuppiece before changing the backupset delete, and then change the backupset delete, you can register it as follows:
RMAN> catalog backupset 'G: \ LOG_FIPRUSNS_1_1 '; --------------> there is no command for catalog backupset. RMAN-00571: ========================================================== ============================== RMAN-00569: ================ error message stack follows ============================ RMAN-00571: ========================================================== ============================== RMAN-00558: error encountered while parsing input commandsRMAN-01009: syntax error: found "backupset": expecting one of: "archivelog, backup, backuppiece, controlfilecopy, clone, datafilec Opy, device, db_recovery_file_dest, recovery, start "RMAN-01007: at line 1 column 9 file: standard inputRMAN> catalog backuppiece 'G: \ LOG_FIPRUSNS_1_1 '; ---> the same catalog backuppiece command as above is replaced with the one on the G disk. The file in disk G is manually copied in advance. Cataloged backuppiecebackup piece handle = G: \ LOG_FIPRUSNS_1_1 recid = 1415 stamp = 868200682 view BS Key and BP KeyRMAN> list backup of archivelog all; the center is omitted a lot and only the following is retained: BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ --------------- 1410 326.36 1410 m disk 00:00:41 05-JAN-15 ---------------> BS Key:, BS Key number has not changed. BP Key: 1415 Status: AVAILABLE Compressed: NO Tag: TAG20150105T10270 ---> BP Key: 1415, the BP Key number has changed, and 1 has been added. Piece Name: G: \ shortlist of Archived Logs in backup set 1410 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- --------- 1 1191 23261014 25-DEC-14 23279746 26-DEC-14 1 1192 23279746 26-DEC-14 23293125 03-JAN 14 -15 1 1193 23293125 03-JAN-15 23296401 03-JAN-15 1 1194 23296401 03-JAN-15 23300534 03-JAN-15 1 1195 23300534 03-JAN-15 23304302 03 -JAN-15 1 1196 23304302 03-JAN-15 23308204 03-JAN-15 1 1197 23308204 03-JAN-15 23316571 03-JAN-15 1 1198 23316571 03-JAN-15 23316578 03-JAN-15 1 1199 23316578 03-JAN-15 23343180 04-JAN-15 1 1200 23343180 04-JAN-15 23367540 05-JAN-15 1 1201 05-JAN -15 23368004 05-JAN-15 1 1202 23368004 05-JAN-15 23368006 05-JAN-15 1 1203 05-JAN-15 23368006 05-JAN-15 1 23368009 05 -JAN-15 23368011 05-JAN-15 1 1205 23368011 05-JAN-15 23369315 05-JAN-15RMAN>
Summary:
1. change backuppiece 1409 uncatalog; --> uncatalog indicates that records in the control file are deleted, and backup files on the OS are not moved! (Backup files on the OS will not be deleted) 2. The backupset cannot use change uncatalog !! The following change delete! can only be used for backupset !!! 3. change backupset 1410 delete; --> change backupset delete has two levels: delete records in the control file and delete backup files on the OS! 4. the BP Key increases with the successful execution of "catalog backuppiece". Therefore, the BP Key is not stored in the backup file. 5. BS Key will not change with the successful execution of "catalog backuppiece" each time. Therefore, BS Key is retained in the backup sheet.