Let’s dig a little bit deeper about control files in the Oracle Database. And, learn how to enable and disable the auto-backup of the control file in Oracle DB. In case you are not using the Recovery catalog, then enabling the auto backup of Control files of your database is highly recommended.
In this tutorial, I am going to explain the auto backup of the control file in detail and will answer few important questions regarding it. These questions can definitely help you at your workplace.
When does RMAN perform the Auto Backup of The Control files?
RMAN auto backups the control file and server parameter file when –
- RMAN has successfully completed the BACKUP or COPY command.
- RMAN has successfully completed the CREATE CATALOG command.
- When there are any changes to the physical structure of the database. And by changes to the physical structure, I mean Adding or deleting a tablespace or data file, Putting tablespace either online or offline, renaming a data file or adding online redo logs. RMAN will process the auto backup of the control file, even if those changes are made through SQL*Plus.
What Process Performs The Auto-Backup?
If you are preparing for an interview then here is an important question for you-
What process performs the auto backup of the control file in case of structural changes to the database?
Since everything is taking place in RMAN thus we tend to think and answer “The RMAN process” performs the auto backup. But it’s wrong, actually, Oracle Server Process performs the auto backup of the control file and server parameter file when there is any structural change in the database.
How To Enable Auto Backup of The Control File
By default automatic control file backup is disabled. Enabling it is really very simple. Let’s see how
Step 1: Start the RMAN and connect with your target database
RMAN target /
This command will connect me to my database ORCL.
Step 2: Enable the auto backup of the control file
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
On successful execution of this command, the auto backup of the control file will be enabled.
How To Disable Auto Backup of The Control File.
There are two ways to disable the auto backup of the control file. Let’s check them out –
Step 1: Start the RMAN and connect with your target database
RMAN target /
Again, this command will connect me to my database ORCL.
Step 2: Disable the auto backup of the control file
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP off;
This command is the same as the last one except for the last keyword which is “off” instead of “on” this time. On successful execution of this command, the auto backup of the control file will be disabled.
That’s the first way to disable the auto backup of the control file. Let’s check out the second way.
Reset the “CONTROLFILE AUTOBACKUP” parameter.
As I mentioned earlier, by default the auto backup of the control file in RMAN is off. So, in the second method, we are going to set the “controlfile autobackup” parameter to its default state which is “off”. Let’s do that.
Step 1: Start the RMAN and connect with your target database
RMAN target /
Again, this command will connect me to my database ORCL.
Step 2: Reset the “CONTROLFILE AUTOBACKUP” parameter.
RMAN> configure controlfile autobackup clear;
On successful execution, this statement will reset the “CONTROLFILE AUTOBACKUP” parameter to its default state.
That is how we enable and disable the Auto-Backup of the control file in the Oracle Database. For more details, you can watch my video on the same topic.
Thanks and have a great day!