Question: What is the proper syntax for the
RMAN COPY command?
Answer: As of Oracle 10g the RMAN COPY
command has been deprecated.
The current preferred syntax is to use the BACKUP as COPY
command. The reasoning behind this change was that when you create
a backup with the COPY command you had to use RMAN to extract
individual datafiles from a given backup set.
The BACKUP AS COPY command creates image copies and removes the
need to extract them from a backup set. This BACKUP AS COPY command
allows you to copy a database, tablespaces, datafiles, archived redo
logs as well as control files.
One great use of the BACKUP AS COPY command is in the creation of
an image of the controlfile. The following command can be
RMAN> backup as copy current
controlfile format 'c:\bkp_controlfile.ctl';
This creates the following:
This is actually a binary copy of the current controlfile. In
the event all controlfiles are lost, this file can be used directly
without RMAN restoration.
The following example from the Rampant TechPress book
Oracle Backup and Recovery by Kamran Agayev shows the creation
of the image copy of the controlfile and how the database can be
recovered from the loss of all controlfiles using this image file:
C:\>rman target \
RMAN> backup as
copy current controlfile format 'c:\control.ctl';
#We take image copy of current control file
tag=tag20090819t134500 recid=1 stamp=695310300
Recovery Manager complete.
C:\>sqlplus "/ as sysdba"
after shutting down the database, we delete all control files and
copy newly created image copy of control file to original
1 file(s) copied.
SQL> alter system set
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
alter database open
at line 1: ORA-01589: must use resetlogs or noresetlogs option for
#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
C:\>rman target /
<....... output omitted
log thread 1 sequence 2 is already on disk as file
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;
An RMAN backup set can be made 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';
starting full datafile backupset
input control file copy name=C:\control.ctl
The syntax of the BACKUP AS COPY command looks like the following
for tablespace users, datafile, spfile and archivelogs:
RMAN> backup as copy tablespace users format
RMAN> backup as copy datafile 4 format
RMAN> backup as copy spfile format
RMAN> backup as copy archivelog all
Burleson is the American Team
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
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
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
and include the URL for the page.
Copyright © 1996 - 2020
All rights reserved by
is the registered trademark of Oracle Corporation.