CONTROLFILE AUTOBACK explained

When AUTOBACKUP is turned on Oracle will create backup of controlfile and spfile. When one runs backup of the database or archive log, changes in tablespace occur like creating a new tablespace, add a new datafile and dropping tablespace Oracle create a separate backup piece for the control file and spfile.

Shows how to turn on CONTROLFILE AUTOBACKUP
RMAN> connect target /

connected to target database: TEST (DBID=1992878807)

RMAN> configure CONTROLFILE AUTOBACKUP ON;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

Set AUTOBACKUP format and location
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/u01/oradata/TEST/rman/%F’;

To set AUTOBACKUP when running backup (example listed below)
RMAN> run {
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘/tmp/%F’;
backup database;
}
To clear AUTOBACKUP format and set to default location which is $ORACLE_HOME/dbs folder
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;

to turn on controlfile autobackup through PL/SQL and setting the format
SQL> VARIABLE RECNO NUMBER;
SQL> EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
SQL> EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE','DISK TO ''T_%F''');

The default format of the filename of autoback is '%F' which is “c—” which is controlled “CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'”
The following link shows the format options http://ss64.com/ora/rman_format_string.html

Shows when a new tablespace is created, new datafile is added or tablespace dropped in the alert log it will record full path to the backup piece of control file and spfile.
Mon Nov 29 19:30:14 2010
create tablespace test datafile '/u01/oradata/TEST/test.dbf' size 100M
Mon Nov 29 19:30:17 2010
Starting control autobackup
Control autobackup written to DISK device
handle '/u01/oracle/product/10.2.0/db_1/dbs/c-1992878807-20101129-01'
Completed: create tablespace test datafile '/u01/oradata/TEST/test.dbf' size 100M

Mon Nov 29 19:33:35 2010
alter tablespace test rename to test1
Mon Nov 29 19:33:35 2010
Tablespace 'TEST' is renamed to 'TEST1'.
Starting control autobackup
Control autobackup written to DISK device
handle '/u01/oracle/product/10.2.0/db_1/dbs/c-1992878807-20101129-02'
Completed: alter tablespace test rename to test1
Mon Nov 29 19:43:29 2010
alter tablespace test1 add datafile '/u01/oradata/TEST/test2.dbf' SIZE 100M
Mon Nov 29 19:43:32 2010
Starting control autobackup
Control autobackup written to DISK device
handle '/u01/oracle/product/10.2.0/db_1/dbs/c-1992878807-20101129-03'
Completed: alter tablespace test1 add datafile '/u01/oradata/TEST/test2.dbf' SIZE 100M
Mon Nov 29 20:07:10 2010
drop tablespace test1 including contents and datafiles
Mon Nov 29 20:07:11 2010
Deleted file /u01/oradata/TEST/test.dbf
Deleted file /u01/oradata/TEST/test2.dbf
Starting control autobackup
Control autobackup written to DISK device
handle '/u01/oracle/product/10.2.0/db_1/dbs/c-1992878807-20101129-04'
Completed: drop tablespace test1 including contents and datafiles

2 thoughts on “CONTROLFILE AUTOBACK explained

  1. Pingback: Different scenerios on restoring spfile « Oracle Spin for Project Managers

  2. Pingback: Different scenerios on restoring spfile | Oracle DBA Daily Experiences

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s