Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

RMAN Backup Control File Tips

Expert Oracle Database Tips by Donald BurlesonMarch 25, 2015

RMAN - Backing Up the Control File

As was shown in the first chapter, the control fileis of great importance to the Oracle database.  If the control file is lost, the database will not run.  Therefore, we need to protect control files from any failure and back them up correctly.  A backup of the control file can be created using RMAN as follows:

RMAN> backup current controlfile;

Using the above command, a new backup set is created and the control file is backed up.

If we want to create a backup of control files each time we do a backup of the database, use the include current control file command.  In this example, we backup datafile 4 and the current control file together using one command: 

RMAN> backup datafile 4 include current controlfile;

When the system01.dbf file is backed up, the control file and the spfile are automatically backed up.  This is shown in the following example:

C:\oracle\---------->dir
               0 File(s)              0 bytes
RMAN> backup device type disk datafile 1;

C:\oracle\--------->dir
O1_mf_ncsnf_tag20090808t002639_57s00o1y_.bkp
o1_mf_nnndf_tag20090808t002639_57rzzhg5_.bkp

From the above example, it is obvious that even though we did not individually backup the control file and the spfile, by backing up the system01.dbf file, those files have been backed up automatically.

If the autobackupfeature in RMAN configuration is enabled, then each time a structural change is made to the database, an automatic backup of the control file is performed.  This concept was described in detail in Chapter 1 under the  section on autobackup.

To create an image copy of the control file,use the following command:

RMAN> backup as copy current controlfile format c:\bkp_controlfile.ctl;

Using this command, c:\bkp_controlfile.ctl is created.  This file will be a binary copy of the current control file.  This type of file may be used directly without RMAN restoration when all control files are lost.  In the scenario below, we create an image copy of the control file and recover the database using this file from loss of all control files:

C:\>rman target \
RMAN> backup as copy current controlfile format 'c:\control.ctl';

#We take image copy of current control file
<....... output omitted .......>
output filename=C:\control.ctl tag=tag20090819t134500 recid=1
stamp=695310300
RMAN> exit
Recovery Manager complete.
 
C:\>sqlplus "/ as sysdba"
SQL>
shutdown immediate
SQL>
host
 
C:\>cd c:\oracle\product\10.2.0\oradata\test
#Below, after shutting down the database, we delete all control files
and copy newly created image copy of control file to original
destination
C:\oracle\product\10.2.0\oradata\test>del *.ctl
C:\>copy control.ctl c:\oracle\product\10.2.0\oradata\test
        1 file(s) copied.
C:\>exit
SQL>
startup nomount
SQL>
alter
system set
control_files='c:\oracle\product\10.2.0\oradata\test\control.ctl'
scope=spfile;
System altered.
#Above, in startup nomount mode, we change control_files parameter in
spfile and indicate newly create image copy of control file. Then
shutdown the database and bring it to mount mode.
 
SQL>
shutdown immediate
SQL>
startup mount
SQL>
alter
database open;
alter database open
*
Error at line 1:
ORA-01589: must use resetlogs or noresetlogs option for database open
#Now, we do not need to open database in resetlogs mode, or we lose
data in redo log files. So we connect to RMAN and recover the database. RMAN automatically finds proper redo log file and apply all changes to
datafiles
SQL>
exit
C:\>rman target /
RMAN> recover database;
<....... output omitted .......>
archive log thread 1 sequence 2 is already on disk as file
C:\oracle\product\10.2.0\oradata\test\redo01.log
archive log filename=C:\oracle\product\10.2.0\oradata\test\redo01.log
thread=1 sequence=2
media recovery complete, elapsed time: 00:00:01
Finished recover at 19-AUG-09
 
#Now, we can easily open the database using resetlogs option
RMAN> alter database open resetlogs;
database opened
RMAN>

% Note:  The resetlogs operation, performed after having applied the online redo log file in recovery, is done because the control file used is a backup control file and the resetlogs operation synchronizes datafile and redo log headers to the control file.

We can make a RMAN backup set from the control file created above.  To do that, use the backup controlfilecopy command as shown below:

RMAN> backup as copy current controlfile format 'c:\control.ctl';
RMAN> backup controlfilecopy 'c:\control.ctl';
channel ora_disk_1: starting full datafile backupset
input control file copy name=C:\control.ctl
RMAN>

 

 

 
 
 
Get the Complete
Oracle Backup & Recovery Details 

The landmark book "Oracle Backup & Recovery: Expert secrets for using RMAN and Data Pump " provides real world advice for resolving the most difficult Oracle performance and recovery issues. Buy it for 40% off directly from the publisher.
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster