17 May 2017

Controlfile autobackup location: default

I am very confused on the location of controlfile autobackups. Now I know how it works, but there seems to be some inconsistency.

Please have a look at the following examples to see what I mean.

RMAN> show all;
(Output trimmed for readability)

CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default


So the autobackup is ON and the format is set to '%F' default. Let us backup any recent archivelog, to trigger the autobackup.


RMAN> backup archivelog sequence 51;
(Backup output deleted for readability)

Starting Control File and SPFILE Autobackup at 17-MAY-17
piece handle=/data/backup/DEMODB12/autobackup/2017_05_17/o1_mf_s_944207636_dkqsco2v_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 17-MAY-17


Note that the autobackup is written in the FRA. This follows the manual https://docs.oracle.com/database/121/BRADV/rcmconfb.htm#GUID-98BA7492-7108-4DF9-B5A2-21957072E308


Let us add a small string in the format, 'CTRL_%F'. Make sense right?


RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'CTRL_%F';

new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'CTRL_%F';
new RMAN configuration parameters are successfully stored

RMAN> backup archivelog sequence 51;
(Backup output deleted for readability)

Starting Control File and SPFILE Autobackup at 17-MAY-17
piece handle=/opt/oracle/product/12.1.0/dbhome_2/dbs/CTRL_c-2980223472-20170517-06 comment=NONE
Finished Control File and SPFILE Autobackup at 17-MAY-17 


So hold on, the backup is now in $ORACLE_HOME/dbs, but we only changed the name of the backup. Tricky. Let us set it back to the default value (the wrong way).


RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'CTRL_%F';
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
new RMAN configuration parameters are successfully stored

RMAN> backup archivelog sequence 51;
(Backup output deleted for readability)

Starting Control File and SPFILE Autobackup at 17-MAY-17
piece handle=/opt/oracle/product/12.1.0/dbhome_2/dbs/c-2980223472-20170517-07 comment=NONE
Finished Control File and SPFILE Autobackup at 17-MAY-17


Now it is set to '%F' again, but still appearing in $ORACLE_HOME/dbs. This is very strange. So we will clear the setting.

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';
RMAN configuration parameters are successfully reset to default value

RMAN> backup archivelog sequence 51;
(Backup output deleted for readability)

Starting Control File and SPFILE Autobackup at 17-MAY-17
piece handle=/data/backup/DEMODB12/autobackup/2017_05_17/o1_mf_s_944207733_dkqsgo4v_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 17-MAY-17

Now it's back to the FRA again.


So what we learn?
ANY change in the format of the autobackup will move it to the $ORACLE_HOME/dbs. You can set it to your custom path '/u01/mybackup/CTRL_%F' for instance, but if you change it, and provide no path, it will end up in $ORACLE_HOME/dbs.
If you really need it in your FRA, use the clear option to remove the adapted setting.

This may be very important, if you backup the FRA to external media. You may be losing your controlfile autobackup here.

Cheers,
Paul