3 Replies Latest reply: Dec 31, 2012 11:11 PM by aLuViAn RSS

    How to include DBID in controlfile backup filename

    aLuViAn
      Hi,

      I've googled over this issue a lot...actually, for disaster recovery purposes, I want to have dbid somewhere "visible" (I know there are some workarounds to find the dbid of the db, also I log the RMAN execution and the dbid is there, but i prefer to have it ready at hand) so I found that F% parameter puts the dbid in filename. But RMAN throws error when I use this parameter and says F is an unknown one.

      Any ideas?
        • 1. Re: How to include DBID in controlfile backup filename
          793965
          Did you use like what you have typed? That is F%

          It will be %F

          CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F';
          • 2. Re: How to include DBID in controlfile backup filename
            mseberg
            Hello;

            Test :

            Connected to:
            Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
            With the Partitioning, OLAP, Data Mining and Real Application Testing options
            SQL> SELECT DBID FROM V$DATABASE;
            
                  DBID
            ----------
            3806912436
            
            SQL> 
            Recovery Manager: Release 11.2.0.3.0 - Production on Mon Dec 31 10:05:49 2012

            Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

            connected to target database: RECOVER2 (DBID=3806912436)
            connected to recovery catalog database
            RMAN> configure controlfile autobackup ON;
            
            old RMAN configuration parameters:
            CONFIGURE CONTROLFILE AUTOBACKUP ON;
            new RMAN configuration parameters:
            CONFIGURE CONTROLFILE AUTOBACKUP ON;
            new RMAN configuration parameters are successfully stored
            starting full resync of recovery catalog
            full resync complete
            
            RMAN> configure controlfile autobackup format for device type disk to 'B_%F';
            
            new RMAN configuration parameters:
            CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'B_%F';
            new RMAN configuration parameters are successfully stored
            starting full resync of recovery catalog
            full resync complete
            
            RMAN> 
            Check
            RECOVER2 >ls -al /u01/app/oracle/product/11.2.0.3/dbs/B_c-3806912436*
            
            -rw-r----- 1 oracle oinstall 10223616 Dec 31 10:09 /u01/app/oracle/product/11.2.0.3/dbs/B_c-3806912436-20121231-00
            Adding %I seems to help the most, the problem with FORMAT is, it does not put the file where I like it. You can hard code it, but it's not exactly what I want.

            '/disk1/control_files/autobackup_%F';

            Best Regards

            mseberg

            Edited by: mseberg on Dec 31, 2012 11:13 AM

            Edited by: mseberg on Dec 31, 2012 11:28 AM
            • 3. Re: How to include DBID in controlfile backup filename
              aLuViAn
              thanks guys, though I was looking for a parameter in "Backup current controlfile format ....", this one does the trick (I don't know why it just works with autobackups!)

              Thank u all! Unfortunately I can't give 10 points to each member, so I have to mark the first answer as correct and the others as helpful.