So, you have configured the auto backup of the control files and now you are trying to find those backup pieces but have no idea where to look for it. In this tutorial you will not only know the location of the control file auto backup but also, how to set your desired location for Control file auto backup.
What Is The Location of Control File Auto Backup?
Usually, there are three locations where the files generated by auto-backup of the control files are placed. These are –
- Default location If you have not configured the FRA then the backup pieces generated by auto backup are placed at the default location. In most cases, this default location is %OracleHOME%/dbs
- Fast Recovery Area or FRA If you have set the FRA then the auto backup will generate the files in the fast recovery area.
- User Defined Location Most convenient way is to set your desired location for your Control file auto backup. Let me show you how.
How To Set The Location For Control File Auto Backup?
To set the desired location of the control file auto backup we will again be using CONFIGURE command. Using it we will change both the location and the name of the control file auto backup. Let’s do that –
Step 1: Connect with your target database using RMAN
C> RMAN target /
This command will connect me to my database ORCL.
Step 2: Write the CONFIGURATION command
RMAN>CONFIGURE controlfile autobackup FORMAT for device type disk to 'D:\autoBackup_CF\cf_%F';
In this CONFIGURATION command we used the FORMAT keyword to set the desired location and name of the backup files generated by control file auto backup.
Right after the format keyword we first tell the RMAN to save the backup at disk drive using ‘for device type disk’ reserved phrase and after that we specify the exact location where on the disk drive.
In my case I am saving those backups in the folder named autoBackup_CF which I have created in my D: drive.
Since along with the location I also wanted to change the name of the backup files thus at the end of location string I have specified ‘cf_%F’.
That means the names of the backup files will start with the ‘cf_’ and the %F will get substituted by the DB_ID, day, month, year and a sequence number. This name will be much easier to read and recognize the backup piece.
Set Control File Auto Backup To It’s Default Value.
Let’s say for some reason you want to set all these settings back to their default values. Let me show you how you can do that also.
Step 1: Again connect with your target database using RMAN
C> RMAN target /
Step 2: Set values to default
RMAN> configure controlfile autobackup format for device type disk clear;
This command will clear all the user settings and set them back to their default values.
That is how we configure or know the location of the backup pieces created by the control file auto-backup in the Oracle Database. For a more detailed demonstration please watch the video.
Thanks and have a great day.