11 Replies Latest reply: Aug 4, 2013 8:35 PM by Hemant K Chitale RSS

    Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.

    user9502721

      The DB version is 11.1.0.7.

      The "CATALOG START WITH" not only catalog backup set that are not in the RMAN catalog, but also catalog a second copy for files that are already in the catalog.
      Files are not a second copy; they are the same file in the same directory.

       

      Having two copies in the catalog, through an error when deleting explicitly the backups.
      We have to add the force clause to avoid the error.
      RMAN> delete FORCE backup tag 'offsite-1';

       

      The force clause ignores any I/O error.
      The delete is part of our scheduled offsite backup script, which returns a false positive error when the force clause is ommited.
      I don't want the force clause, in order to be notify if the backup set that are expected to be on disk are no more there, e.g., if someone had deleted files manually at the OS level bypassing rman.

       

      Is there a way to only catalog backup set not in the catalog?
      or May be remove the copy #2 entry from the catalog?

       

      Find bellow a test case example:

       

      RMAN> list backup summary TAG 'OFFSITE-1';
      List of Backups
      ===============
      Key     TY LV S Device Type Completion Time    #Pieces #Copies Compressed Tag
      ------- -- -- - ----------- ------------------ ------- ------- ---------- ---
      12      B  F  A DISK        11-JUN-13 09:41:45 1       1       NO         OFFSITE-1
      13      B  F  A DISK        11-JUN-13 09:43:31 1       1       NO         OFFSITE-1
      14      B  A  A DISK        11-JUN-13 09:43:33 1       1       NO         OFFSITE-1
      15      B  F  A DISK        11-JUN-13 09:43:34 1       1       NO         OFFSITE-1

      RMAN> CATALOG START WITH 'C:\backups\offsite_disk\IBISdatabase\scheduled_offsite';
      searching for all files that match the pattern C:\backups\offsite_disk\IBISdatabase\scheduled_offsite
      ...
      cataloging done
      List of Cataloged Files
      =======================
      File Name: C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\scheduled_offsite\06OBTJEP_1_1
      File Name: C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\scheduled_offsite\07OBTJI3_1_1
      File Name: C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\scheduled_offsite\08OBTJI5_1_1
      File Name: C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\scheduled_offsite\09OBTJI6_1_1

      RMAN> list backup summary TAG 'OFFSITE-1';
      List of Backups
      ===============
      Key     TY LV S Device Type Completion Time    #Pieces #Copies Compressed Tag
      ------- -- -- - ----------- ------------------ ------- ------- ---------- ---
      12      B  F  A DISK        11-JUN-13 09:41:45 1       2       NO         OFFSITE-1
      13      B  F  A DISK        11-JUN-13 09:43:31 1       2       NO         OFFSITE-1
      14      B  A  A DISK        11-JUN-13 09:43:33 1       2       NO         OFFSITE-1
      15      B  F  A DISK        11-JUN-13 09:43:34 1       2       NO         OFFSITE-1

      RMAN> DELETE BACKUP TAG 'OFFSITE-1';
      List of Backup Pieces
      BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
      ------- ------- --- --- ----------- ----------- ----------
      24      18      1   1   AVAILABLE   DISK        C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\06OBTJEP_1_1   <<--- same file
      30      18      1   2   AVAILABLE   DISK        C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\06OBTJEP_1_1   <<--- same file
      25      19      1   1   AVAILABLE   DISK        C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\07OBTJI3_1_1
      31      19      1   2   AVAILABLE   DISK        C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\07OBTJI3_1_1
      26      20      1   1   AVAILABLE   DISK        C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\08OBTJI5_1_1
      32      20      1   2   AVAILABLE   DISK        C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\08OBTJI5_1_1
      27      21      1   1   AVAILABLE   DISK        C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\09OBTJI6_1_1
      33      21      1   2   AVAILABLE   DISK        C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\09OBTJI6_1_1

      deleted backup piece
      backup piece handle=C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\06OBTJEP_1_1 RECID=24 STAMP=821470356
      deleted backup piece
      backup piece handle=C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\07OBTJI3_1_1 RECID=25 STAMP=821470356
      deleted backup piece
      backup piece handle=C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\08OBTJI5_1_1 RECID=26 STAMP=821470356
      deleted backup piece
      backup piece handle=C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\09OBTJI6_1_1 RECID=27 STAMP=821470357
      Deleted 6 objects

      RMAN-06207: WARNING: 4 objects could not be deleted for DISK channel(s) due
      RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
      RMAN-06210: List of Mismatched objects
      RMAN-06211: ==========================
      RMAN-06212:   Object Type   Filename/Handle
      RMAN-06213: --------------- ---------------------------------------------------
      RMAN-06214: Backup Piece    C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\06OBTJEP_1_1
      RMAN-06214: Backup Piece    C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\07OBTJI3_1_1
      RMAN-06214: Backup Piece    C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\08OBTJI5_1_1
      RMAN-06214: Backup Piece    C:\BACKUPS\OFFSITE_DISK\IBISDATABASE\SCHEDULED_OFFSITE\09OBTJI6_1_1

        • 1. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
          mseberg

          Hello;

           

           

          Manually will work :

           

           

           

          CATALOG DATAFILECOPY '/u01/app/oracle/ORCL/users01.dbf';

           

           

          CATALOG ARCHIVELOG ...

           

           

          CATALOG BACKUPPIECE ...

           

           

          Best Regards

           

           

          mseberg

          • 2. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
            user9502721

            Yes, but I don't know what files should be catalog in advance.

             

            JM

            • 3. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
              mseberg

              Hello again;

               

               

              Be careful when using CATALOG START WITH.

               

               

              RMAN will scan all paths for all files on disk which begin with prefix you enter.

               

               

              So for your issue CATALOG START WITH is working as expected.

               

              All of my stuff goes to FRA and it has a folder with a date on it, so the filter is easy.

               

               

               

              Best Regards and best of luck.

               

               

              mseberg

              • 4. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
                user9502721

                Thanks for your help

                But files already cataloged (same path and file name) should not be recatalog. RMAN should check in its catalag and skip them.

                You would aggree with me that they are the same physical files (same path and file name), not copies.

                 

                Do you have or someone have any workaround or idea?

                • 5. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
                  nagulan.selvakumar

                  Hi,

                   

                  RMAN automatically registers the backup pieces/ backup sets in repository (Recovery catalog or controlfile). In which circumstance are you manually cataloging the backup sets/pieces?

                  Here the problem is the "delete FORCE backup tag 'offsite-1'" command is not deleting your backups which in case is not un registering the pieces from RMAN catalog.

                   

                  Also if RMAN has the same piece registered already, RMAN will not count the piece again in its catalog.

                  A small demo with Oracle 10.2.0.5 is as below.

                   

                  RMAN> backup current controlfile;
                  
                  
                  Starting backup at 24-JUL-13
                  using channel ORA_DISK_1
                  channel ORA_DISK_1: starting full datafile backupset
                  channel ORA_DISK_1: specifying datafile(s) in backupset
                  including current control file in backupset
                  channel ORA_DISK_1: starting piece 1 at 24-JUL-13
                  channel ORA_DISK_1: finished piece 1 at 24-JUL-13
                  piece handle=/oracle/product/10.2.0/db_2/dbs/01ofi5ni_1_1 tag=TAG20130724T144506 comment=NONE
                  channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16
                  Finished backup at 24-JUL-13
                  
                  
                  RMAN> list backup;
                  
                  
                  
                  
                  List of Backup Sets
                  ===================
                  
                  
                  BS Key  Type LV Size       Device Type Elapsed Time Completion Time
                  ------- ---- -- ---------- ----------- ------------ ---------------
                  1       Full    16.14M     DISK        00:00:13     24-JUL-13
                          BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20130724T144506
                          Piece Name: /oracle/product/10.2.0/db_2/dbs/01ofi5ni_1_1
                    Control File Included: Ckp SCN: 521784       Ckp time: 24-JUL-13
                  
                  
                  RMAN> list backup summary;
                  
                  
                  
                  
                  List of Backups
                  ===============
                  Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
                  ------- -- -- - ----------- --------------- ------- ------- ---------- ---
                  1       B  F  A DISK        24-JUL-13       1       1       NO         TAG20130724T144506
                  
                  
                  RMAN> catalog start with '/oracle/product/10.2.0/db_2/dbs/';
                  
                  
                  searching for all files that match the pattern /oracle/product/10.2.0/db_2/dbs/
                  
                  
                  List of Files Unknown to the Database
                  =====================================
                  File Name: /oracle/product/10.2.0/db_2/dbs/hc_db10g.dat
                  File Name: /oracle/product/10.2.0/db_2/dbs/initdb10g.ora
                  File Name: /oracle/product/10.2.0/db_2/dbs/lkDB10G
                  File Name: /oracle/product/10.2.0/db_2/dbs/.initTestDB.ora.swp
                  File Name: /oracle/product/10.2.0/db_2/dbs/snapcf_db10g.f
                  
                  
                  Do you really want to catalog the above files (enter YES or NO)? no
                  
                  
                  RMAN> list backup summary;
                  
                  
                  
                  
                  List of Backups
                  ===============
                  Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
                  ------- -- -- - ----------- --------------- ------- ------- ---------- ---
                  1       B  F  A DISK        24-JUL-13       1       1       NO         TAG20130724T144506
                  
                  
                  RMAN> catalog backuppiece '/oracle/product/10.2.0/db_2/dbs/01ofi5ni_1_1';
                  
                  
                  cataloged backuppiece
                  backup piece handle=/oracle/product/10.2.0/db_2/dbs/01ofi5ni_1_1 recid=2 stamp=821630870
                  
                  
                  RMAN> list backup summary;
                  
                  
                  
                  
                  List of Backups
                  ===============
                  Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
                  ------- -- -- - ----------- --------------- ------- ------- ---------- ---
                  1       B  F  A DISK        24-JUL-13       1       1       NO         TAG20130724T144506
                  
                  

                   

                  You might have to check RMAN DELETE or DELETE FORCE does not show error but LIST still display backup (Doc ID 1265090.1) whether this is your case or not.

                   

                  Also please check this Bug 9670439 - Using RMAN, DELETE or DELETE FORCE completes without error but it still appear in LIST BACKUP (Doc ID 9670439.8).

                   

                  Thank you!!

                  • 6. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
                    user9502721

                    To your question:

                    "In which circumstance are you manually cataloging the backup sets/pieces?"

                    In a maintenace operation when re-assing the offsite disk mountpoint to a drive letter. Unfortunately, I cannot reclaim all offsite disk to re-catalog backups to the new location.

                    I have to catalog them the next time an offsite is perfomed (in the prod backup scripts).

                     

                    You said:

                    "RMAN has the same piece registered already, RMAN will not count the piece again in its catalog."

                    No, it does recatalog any existing bacup pieces as second copy!

                    This behavior (re-cataloging a second copy) is the main issue, that requires me using the force clause in the delete.

                    Look at my test case at the beginning of the thread. I did not use the force clause.

                    It did delete the files and removed the first copy entry from the catalog, but the delete of the second copy failed because the files were just deleted.

                     

                    Your demo with Oracle 10.2.0.5

                    At line 36 you answered "No" to "Do you really want to catalog the above files (enter YES or NO)?".

                    Just repeate your demo and answer Yes.

                     

                    I do not experience the menitoned bug.

                     

                    Thanks

                     

                    JM

                    • 7. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
                      Prashant Namdeo

                      Hi JM,


                      Your demo with Oracle 10.2.0.5

                      At line 36 you answered "No" to "Do you really want to catalog the above files (enter YES or NO)?".

                      Just repeate your demo and answer Yes.

                       

                      Even if he might have replied with "YES" then also, the RMAN search for the files which it can recognize as a valid rman backup file. Else it would show the list of files which are not recognized by RMAN as a valid file.

                       

                      RMAN> catalog start with '/home/oracle/scripts';

                       

                      using target database control file instead of recovery catalog

                      searching for all files that match the pattern /home/oracle/scripts

                       

                      List of Files Unknown to the Database

                      =====================================

                      File Name: /home/oracle/scripts/RMAN_BACKUP.sh

                      File Name: /home/oracle/scripts/rman_clone.log

                      File Name: /home/oracle/scripts/Db_Refresh.sh

                      File Name: /home/oracle/scripts/rman_erp.scr

                      File Name: /home/oracle/scripts/RMAN_14FEB.log

                      File Name: /home/oracle/scripts/nid.sh

                      File Name: /home/oracle/scripts/Full_Clone.sh

                      File Name: /home/oracle/scripts/rman_staging.scr

                       

                      Do you really want to catalog the above files (enter YES or NO)? yes

                      cataloging files...

                      no files cataloged

                       

                      List of Files Which Where Not Cataloged

                      =======================================

                      File Name: /home/oracle/scripts/RMAN_BACKUP.sh

                        RMAN-07517: Reason: The file header is corrupted

                      File Name: /home/oracle/scripts/rman_clone.log

                        RMAN-07517: Reason: The file header is corrupted

                      File Name: /home/oracle/scripts/Db_Refresh.sh

                        RMAN-07517: Reason: The file header is corrupted

                      File Name: /home/oracle/scripts/rman_erp.scr

                        RMAN-07517: Reason: The file header is corrupted

                      File Name: /home/oracle/scripts/RMAN_14FEB.log

                        RMAN-07517: Reason: The file header is corrupted

                      File Name: /home/oracle/scripts/nid.sh

                        RMAN-07517: Reason: The file header is corrupted

                      File Name: /home/oracle/scripts/Full_Clone.sh

                        RMAN-07517: Reason: The file header is corrupted

                      File Name: /home/oracle/scripts/rman_staging.scr

                        RMAN-07517: Reason: The file header is corrupted

                       

                       

                      About the RMAN catalog, it will not catalog the same file twice. It will only catalog the files which are not known to the database.

                      See this demo. (/backup/RMAN/STAGING/ is the location where all the backup pieces are.)

                      RMAN> catalog start with '/backup/RMAN/STAGING/';

                       

                      searching for all files that match the pattern /backup/RMAN/STAGING/

                      no files found to be unknown to the database

                       

                       

                      This was the location based test, Another demo showing piece by piece catalogging .

                       

                      RMAN> list backuppiece '/backup/RMAN/STAGING/ERP_CNTRL_c-13949842-20130724-00';

                       

                       

                      List of Backup Pieces

                      BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name

                      ------- ------- --- --- ----------- ----------- ----------

                      1323    1321    1   1   AVAILABLE   DISK        /backup/RMAN/STAGING/ERP_CNTRL_c-13949842-20130724-00

                       

                      RMAN> catalog backuppiece '/backup/RMAN/STAGING/ERP_CNTRL_c-13949842-20130724-00';

                       

                      cataloged backup piece

                      backup piece handle=/backup/RMAN/STAGING/ERP_CNTRL_c-13949842-20130724-00 RECID=1324 STAMP=821717283

                       

                      RMAN> list backuppiece '/backup/RMAN/STAGING/ERP_CNTRL_c-13949842-20130724-00';

                       

                       

                      List of Backup Pieces

                      BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name

                      ------- ------- --- --- ----------- ----------- ----------

                      1324    1321    1   1   AVAILABLE   DISK        /backup/RMAN/STAGING/ERP_CNTRL_c-13949842-20130724-00

                       

                       

                      Hope its understandable, if any query please revert.

                       

                      Happy to Help.

                       

                      Thanks and Regards,

                      Prashant

                      • 8. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
                        nagulan.selvakumar

                        Hi,

                         

                        List of Files Unknown to the Database  
                        =====================================  
                        File Name: /oracle/product/10.2.0/db_2/dbs/hc_db10g.dat  
                        File Name: /oracle/product/10.2.0/db_2/dbs/initdb10g.ora  
                        File Name: /oracle/product/10.2.0/db_2/dbs/lkDB10G  
                        File Name: /oracle/product/10.2.0/db_2/dbs/.initTestDB.ora.swp  
                        File Name: /oracle/product/10.2.0/db_2/dbs/snapcf_db10g.f  
                        
                        
                        Do you really want to catalog the above files (enter YES or NO)? no 
                        


                        Here you can see the database says "List of Files Unknown to the Database" and then asks whether to catalog above files. These files are of no use to the RMAN. So I entered no. But the backup file inside the directory is cataloged already twice but shows copy as 1 when queried from RMAN. Probably it might be a bug and it is advisable to raise SR with oracle for resolution of the issue.


                        Thank you!!



                        • 10. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
                          user9502721

                          I probably hit a bug of 11.1.0.7.

                          Files are catalog twice consistently.

                           

                          JM

                          • 11. Re: Is there a way to only catalog backup set not in the catalog? "CATALOG START WITH" generates double entry.
                            Hemant K Chitale

                            Possibly a bug.

                             

                            Log an SR with Oracle Support.  You have a reproducible test case.

                             

                            Hemant K Chitale