Oracle9i Recovery Manager Reference
Release 1 (9.0.1)

Part Number A90136-02
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

RMAN Commands , 18 of 60


COPY

Syntax


Text description of copy.gif follows
Text description of the illustration copy.gif

copy_option::=


Text description of copy_opt.gif follows
Text description of the illustration copy_opt.gif

copy_inputfile::=


Text description of copy_inp.gif follows
Text description of the illustration copy_inp.gif

Purpose

Create an image copy of a file. The output file is always written to disk. You can copy the following types of files:

In many cases, copying datafiles is more beneficial than backing them up, since the output is suitable for use without any additional processing. In contrast, you must process a backup set with a RESTORE command before it is usable. So, you can perform media recovery on a datafile copy, but not directly on a backup set, even if it backs up only one datafile and contains a single backup piece.

If CONFIGURE CONTROLFILE AUTOBACKUP is set to ON, then RMAN automatically performs a control file autobackup in these situations:

Restrictions and Usage Notes

Keywords and Parameters

copy_option 

Specifies optional parameters affecting either the input or output files or both. 

 

TAG = 'tag_name' 

Specifies the tag of the input file or output file copy. You cannot apply a tag to a copy of an archived log, current control file, or standby control file. 

 

LEVEL = integer 

Includes the input file or output file copy in the incremental backup strategy by making it serve as a basis for subsequent incremental backup sets. Typically, you specify LEVEL 0. If you do not use the LEVEL option, then the datafile copy has no impact on the incremental backup strategy. 

 

NOCHECKSUM 

Suppresses block checksums. Unless you specify this option, Oracle computes a checksum for each block. RMAN verifies the checksum when restoring the copy. If the database is already maintaining block checksums, then this flag has no effect. 

 

CHECK LOGICAL 

Tests data and index blocks that pass physical corruption checks for logical corruption, for example, corruption of a row piece or index entry. If RMAN finds logical corruption, then it logs the block in the alert.log and server session trace file.

Provided the sum of physical and logical corruptions detected for a file remain below its MAXCORRUPT setting, the RMAN command completes and Oracle populates V$BACKUP_CORRUPTION and V$COPY_CORRUPTION with corrupt block ranges. If MAXCORRUPT is exceeded, then the command terminates without populating the views.

Note: For COPY and BACKUP, the MAXCORRUPT setting represents the total number of physical and logical corruptions permitted on a file. 

 

keepOption 

Overrides any configured retention policy for this copy so that the copy is not considered obsolete.

See Also: "keepOption" 

copy_inputfile 

specifies the type of input file, that is, the file that you want to copy.  

 

DATAFILE datafileSpec 

Specifies a list of one or more datafiles as input.

See Also: "datafileSpec"

Note: If you specify a filename, then it must be the name of a current datafile as listed in the control file. 

 

DATAFILECOPY 'filename' 

Specifies a list of one or more datafile copies as input. Specify the datafile copies by 'filename' or TAG = 'tag_name'. The filename must not be the name of a current datafile listed in the control file. The existing copy may have been created by either a previous COPY command or by an external operating system utility.  

 

ARCHIVELOG 'filename' 

Specifies the filename of an input archived redo log. The archived log may have been created by the Oracle archiving session or by a previous copy command. Specify the archived redo log by filename. 

 

CURRENT CONTROLFILE 

Specifies the current control file.

If you specify the FOR STANDBY option, RMAN makes a control file that can be used for creation of a standby database. 

 

CONTROLFILECOPY 'filename' 

Specifies the filename of a control file copy. You can also set TAG = 'tag_name' to specify a list of one or more control file copies.

This command copies a control file copy. The copy can be:

  • A copy of a normal control file (that is, not a standby control file)

  • A standby control file copy created by using the COPY STANDBY CONTROLFILE command or the SQL statement ALTER DATABASE CREATE STANDBY CONTROLFILE

RMAN inspects the header of the control file copy to determine whether it is a standby or nonstandby control file.

Note: The control file copy is marked as a backup control file, so media recovery will be necessary if you mount the control file copy. This command is equivalent to the ALTER DATABASE BACKUP CONTROLFILE TO '...' statement. 

TO AUXNAME 

Specifies that Oracle should copy the input datafile to the filename specified in an earlier SET AUXNAME command for the input datafile. 

TO 'filename' 

Specifies the filename of the output file copy. 

Examples

Copying a Datafile: Example

This example copies the datafile tbs_01.f with the NOCHECKSUM option to the output file temp3.f, marking it as a level 0 backup:

COPY
  NOCHECKSUM 
  DATAFILE '$ORACLE_HOME/dbs/tbs_01.f' TO '$ORACLE_HOME/copy/temp3.f'
  LEVEL 0;

Copying the Control File: Example

This example copies the current control file and gives the copy the tag weekly_cf_copy:

COPY 
  CURRENT CONTROLFILE TO '$ORACLE_HOME/copy/cf1.f' 
  TAG = weekly_cf_copy;

Creating a Long-Term Database Copy: Example

This example copies the database and exempts it from the current retention policy:

COPY 
  KEEP FOREVER NOLOGS
  CURRENT CONTROLFILE TO '/archive/cf1.f',
  DATAFILE 1 TO '/archive/df1.copy',
  DATAFILE 2 TO '/archive/df2.copy';

Creating a Standby Control File: Example

This example uses the preconfigured DISK channel to create a copy of the current target control file that can be used as a standby control file:

COPY CURRENT CONTROLFILE FOR STANDBY TO '/cf_standby.f';

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback