Skip Headers

Oracle9i Recovery Manager Reference
Release 2 (9.2)

Part Number A96565-01
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 59


COPY

Syntax

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


copy_option::=
Text description of copy_option.gif follows
Text description of the illustration copy_option.gif


copy_inputfile::=
Text description of copy_inputfile.gif follows
Text description of the illustration copy_inputfile.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 backs up the control file after COPY commands. "BACKUP" describes the complete set of circumstances in which autobackups occur.

See Also:

Oracle9i Recovery Manager User's Guide to learn how to copy files with RMAN

Restrictions and Usage Notes

Keywords and Parameters

Syntax Element Description

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. Tag names are not case sensitive. RMAN gives each copy a default TAG. Refer to the TAG description in the BACKUP command for the default filename format.

Note: 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$DATABASE_BLOCK_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.

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. Note that tag names are not case sensitive.

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 the CONFIGURE 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 tools01.dbf with the NOCHECKSUM option to the output file tools01.bak, specifying it as a level 0 backup:

COPY
  NOCHECKSUM 
  DATAFILE '?/oradata/trgt/tools01.dbf' TO '?/oradata/tools01.bak'
  LEVEL 0;
Copying the Control File: Example

This example copies the current control file:

COPY CURRENT CONTROLFILE TO '?/oradata/cf1.bak';
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 '?/oradata/cf_standby.cpy';
Creating a Long-Term Database Copy: Example

The following shell script copies the control file and two datafiles and exempts them from the retention policy:

#!/usr/bin/tcsh
# a connection to the catalog is required for KEEP FOREVER
rman TARGET / CATALOG rman/rman@rcat <<EOF
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
COPY 
  KEEP FOREVER NOLOGS
  CURRENT CONTROLFILE TO '?/oradata/cf_longterm.cpy',
  DATAFILE 1 TO '?/oradata/df1_longterm.cpy',
  DATAFILE 2 TO '?/oradata/df2_longterm.cpy';
ALTER DATABASE OPEN;
EOF

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996, 2002 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