The contents are of my own testing and deployments. Not guaranteed that these might work in your environment. Please test before usage.
In this blog, I will teach you how to take control file backups in the Oracle database.
There is a lot of method in the Oracle database in a few of the below for your reference!
1)Manual method in rman
2)Backup the control file in the SQL prompt
3)Backup control file as copy
1)Manual method in rman
This is the backup that only contains RMAN repository data for the backup within the current Rman session.
1)Connect the RMAN issues to the below commands
RMAN> BACKUP CURRENT CONTROLFILE;
Starting backup at 27-APR-23
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
using channel ORA_DISK_7
using channel ORA_DISK_8
using channel ORA_DISK_9
using channel ORA_DISK_10
using channel ORA_DISK_11
using channel ORA_DISK_12
using channel ORA_DISK_13
using channel ORA_DISK_14
using channel ORA_DISK_15
using channel ORA_DISK_16
using channel ORA_DISK_17
using channel ORA_DISK_18
using channel ORA_DISK_19
using channel ORA_DISK_20
using channel ORA_DISK_21
using channel ORA_DISK_22
using channel ORA_DISK_23
using channel ORA_DISK_24
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 27-APR-23
channel ORA_DISK_1: finished piece 1 at 27-APR-23
piece handle=/u01/ramesh/backup/Ramesh_FULL_PROD_t1135286973_s88_p1 tag=TAG20230427T212933 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 27-APR-23
RMAN>
2) Back up the control file in the SQL prompt.
If you want to take a backup in sqlplus utility u can issue the below command .
SQL> ALTER DATABASE BACKUP CONTROLFILE TO '/u01/backup/control.bkp';
Database altered.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@oracle backup]$
[oracle@oracle backup]$ cd /u01/backup
[oracle@oracle backup]$ ll
total 139044
-rw-r-----. 1 oracle oinstall 12923904 Apr 21 12:04 1_40_1132351466.dbf
-rw-r-----. 1 oracle oinstall 34688512 Apr 21 19:31 1_41_1132351466.dbf
-rw-r-----. 1 oracle oinstall 4775936 Apr 22 18:25 1_42_1132351466.dbf
-rw-r-----. 1 oracle oinstall 37938688 Apr 22 18:26 1_43_1132351466.dbf
-rw-r-----. 1 oracle oinstall 3885056 Apr 23 11:21 1_44_1132351466.dbf
-rw-r-----. 1 oracle oinstall 27712000 Apr 27 21:18 1_45_1132351466.dbf
-rw-r-----. 1 oracle oinstall 10043392 Apr 27 21:26 control.bkp
-rw-r-----. 1 oracle oinstall 10043392 Apr 27 21:24 controlfile_copy.ctl
-rw-r--r--. 1 oracle oinstall 1706 Apr 19 20:15 impjohn.log
-rw-r-----. 1 oracle oinstall 352256 Apr 19 20:12 scott.dmp
-rw-r--r--. 1 oracle oinstall 1939 Apr 19 20:12 scott.log
[oracle@oracle backup]$
3)Backup control file as a copy.
If you want to take a current control file copy you can use the below command.
RMAN>BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/u01/backup/controlfile_copy.ctl';
Thank you for your time!!
0 Comments