By William Sescu

Do you see any differences between these two RMAN SHOW commands?

RMAN> SHOW CONTROLFILE AUTOBACKUP FORMAT;

RMAN configuration parameters for database with db_unique_name OCM121 are:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

and

RMAN> SHOW CONTROLFILE AUTOBACKUP FORMAT;

RMAN configuration parameters for database with db_unique_name OCM121 are:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F';

 

They are the same, except that the first output has the “# default” at the end and the second one doesn’t.

Whenever you see a “# default” at the end of a RMAN show command, it simply means that this is the default value which comes out of the box, and even if you change it to the same value, the “# default” at the end disappears.

Sometimes, Oracle is funny. 🙂 The strange thing about it, is that ‘%F’ #default and ‘%F’ are not the same. Due to the Oracle documentation, the format specification for ‘%F’ means the following:

‘%F’ combines the DBID, day, month, year, and sequence into a unique and repeatable generated name.
This variable translates into c-IIIIIIIIII-YYYYMMDD-QQ, where:

  • IIIIIIIIII stands for the DBID. The DBID is printed in decimal so that it can be easily associated with the target database.
  • YYYYMMDD is a time stamp in the Gregorian calendar of the day the backup is generated
  • QQ is the sequence in hexadecimal number that starts with 00 and has a maximum of ‘FF’ (256)

HINT: %F is valid only in the CONFIGURE CONTROLFILE AUTOBACKUP FORMAT command.

Ok. Let’s take a look into the ASM directory, where my controlfile autobackups are located.

ASMCMD> pwd
+fra/ocm121/autobackup/2016_10_29
ASMCMD> ls -l
Type        Redund  Striped  Time             Sys  Name
AUTOBACKUP  UNPROT  COARSE   OCT 29 11:00:00  Y    s_926509179.514.926509183
AUTOBACKUP  UNPROT  COARSE   OCT 29 12:00:00  Y    s_926511850.517.926511853

Regarding the format specification ‘%F’, I see no DBID, no time stamp and also no sequence number. Looks like, that the format specification is not valid for the autobackups located in ASM.

So … with the RMAN Default (‘%F’; # default), RMAN will send the autobackup to the flash recovery area, if it is used, and in my case, it sends it to ASM. However, the format specification has nothing to do with the ‘%F’ described in the documentation. I do have something totally different.

Ok. Let’s change the controlfile autobackup format to exactly the same thing like it was before and check what happens. Afterwards, lets quickly force a controlfile autobackup creation.

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

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

SQL> ALTER SYSTEM SET "_controlfile_autobackup_delay"=0;

System altered.

SQL> create tablespace DBI datafile size 16M;

Tablespace created.

A new controlfile should have been created right away, but in the ASM directory we see no new controlfile autobackup.

ASMCMD> ls -l
Type        Redund  Striped  Time             Sys  Name
AUTOBACKUP  UNPROT  COARSE   OCT 29 11:00:00  Y    s_926509179.514.926509183
AUTOBACKUP  UNPROT  COARSE   OCT 29 12:00:00  Y    s_926511850.517.926511853

Where did Oracle put my new controlfile autobackup? I just changed the same value with the same value. After a little bit of looking around, I have noticed that a new controlfile autobackup was created in the good old $ORACLE_HOME/dbs/

oracle@oel001:/u00/app/oracle/product/12.1.0.2/dbs/ [OCM121] ls -rtl c-*
-rw-r----- 1 oracle asmadmin 10387456 Oct 31 10:03 c-3827054096-20161031-00

And furthermore, the format specification looks now exactly, how it is documented, incl. the DBID, the time stamp
and so on.

So, with ‘%F’ non-default, Oracle will put it in $ORACLE_HOME/dbs on UNIX and to %ORACLE_HOME%Database in case you are on Windows. In the end, the following configurations look the same, but they are totally different.

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

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

Now you could say, I don’t care if Oracle puts it into ASM or into $ORACLE_HOME/dbs. In case you are running RAC you should care, because it makes a major difference. If one host crashes, you can’t access your controlfile autobackups anymore. And what about crosschecks? If you run now a crosscheck from host B, it does not see the controlfile autobackups from host A, and after a while you will end up with a big mess.

Conclusion. Sometimes, the same value is not the same value. 😉 And for RAC and RAC One Node, better stay with the default, which is ‘%F’; #default.
Cheers,
William