Delete of Uncatalog and backupset in Backuppiece in Oracle Rman

Source: Internet
Author: User



This article is original article, reprint please indicate source: http://write.blog.csdn.net/postedit/42424083






This article is based on the Oracle 10.2.0.4 release for the following tests:





RMAN> list backup of archivelog all;

A little bit in the middle, just keep the following:

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------- -----
1410 326.36M DISK 00:00:41 05-JAN-15
        BP Key: 1409 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 Time 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 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 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-15

RMAN> change backuppiece 1409 uncatalog; -->uncatalog means to delete the records in the control file, the backup file on os will not move! (Do not delete the backup file on os)

Uncataloged backuppiece
Backup piece handle=F:\LOG_FIPRUSNS_1_1 recid=1409 stamp=868184831
Uncataloged 1 objects

RMAN> list backup of archivelog all;





The way to get the backup file back:



RMAN> catalog backuppiece 'F:\LOG_FIPRUSNS_1_1';

Cataloged backuppiece
Backup piece handle=F:\LOG_FIPRUSNS_1_1 recid=1413 stamp=868188578 ----->This command can be executed multiple times, each time recid is added 1

RMAN> catalog backuppiece 'F:\LOG_FIPRUSNS_1_1';

Cataloged backuppiece
Backup piece handle=F:\LOG_FIPRUSNS_1_1 recid=1414 stamp=868188598 ----->This command can be executed multiple times, each time recid is added 1





Here's a look at the changes in Bskey and BP Key after the catalog comes back:


RMAN> list backup of archivelog all;

A little bit in the middle, just keep the following:

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------- -----
1410 326.36M DISK 00:00:41 05-JAN-15 -------------------->BS Key: 1410, BS Key number has not changed
        BP Key: 1414 Status: AVAILABLE Compressed: NO Tag: TAG20150105T102705------->BP Key: 1414, BP Key number changed, plus 1

        Piece Name: F:\LOG_FIPRUSNS_1_1

  List 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-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 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-15


The following test backupset is revoked from catalog:


RMAN> change backupset 1410 uncatalog; ---------------------->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:31
RMAN-06122: CHANGE .. UNCATALOG not supported for BACKUPSET


RMAN> change backupset 1410 delete; -->change The effect of backupset delete includes 2 levels: delete the record in the control file, delete the backup file on os!

Using channel ORA_DISK_1

List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- -------- --
1414 1410 1 1 AVAILABLE DISK F:\LOG_FIPRUSNS_1_1

Do you really want to delete the above objects (enter YES or NO)? yes
Deleted backup piece
Backup piece handle=F:\LOG_FIPRUSNS_1_1 recid=1414 stamp=868188598
Deleted 1 objects


RMAN>


---- At this time, the file F:\LOG_FIPRUSNS_1_1 on os has been deleted.



If you copy the backuppiece manually before the change backupset Delete, and then change backupset Delete, then the method you want to register back is:





RMAN> change backupset 1410 uncatalog; ---------------------->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:31
RMAN-06122: CHANGE .. UNCATALOG not supported for BACKUPSET


RMAN> change backupset 1410 delete; -->change The effect of backupset delete includes 2 levels: delete the record in the control file, delete the backup file on os!

Using channel ORA_DISK_1

List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- -------- --
1414 1410 1 1 AVAILABLE DISK F:\LOG_FIPRUSNS_1_1

Do you really want to delete the above objects (enter YES or NO)? yes
Deleted backup piece
Backup piece handle=F:\LOG_FIPRUSNS_1_1 recid=1414 stamp=868188598
Deleted 1 objects


RMAN>


---- At this time, the file F:\LOG_FIPRUSNS_1_1 on os has been deleted.





Summarize:

1. change backuppiece 1409 uncatalog; -->uncatalog means to delete the records in the control file, the backup file on os will not move! (Do not delete the backup file on os)

2. backupset can't use change uncatalog! ! Backupset can only use the following change delete! ! !

3. change backupset 1410 delete; -->change backupset delete effect includes 2 levels: delete the record in the control file, delete the backup file on os!

4. BP Key This will be incremented with each successful execution of the "catalog backuppiece", so the BP Key is not retained in the backup slice.

5. BS Key This will not change with the successful execution of each “catalog backuppiece”, so the BS Key is retained in the backup slice.

 



Delete of Uncatalog and backupset in Backuppiece in Oracle Rman


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.