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 , 9 of 60


BACKUP

Syntax


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

backupSpec::=


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

backupOperand::=


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

backupSpecOperand::=


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

Purpose

To back up a database, tablespace, datafile (current or copy), control file (current or copy), archived log, or backup set. You can back up a target or standby database.

When performing a backup, specify the files that you want to back up. RMAN puts the input files into one or more backup sets, which are RMAN-specific logical structures. The backup set is the smallest unit of a backup. RMAN only records backup sets in the repository that complete successfully.

Each backup set contains at least one backup piece, which is a physical file containing the backed up data. You can also use the BACKUP command to generate a proxy copy, which is a backup to a third-party medium in which the entire data transfer is conducted by a media manager.

You control the number of backup sets that Oracle produces as well as the number of input files that RMAN places into a single backup set. Any I/O errors when reading files or writing backup pieces cause Oracle to abort the job.

If CONFIGURE CONTROLFILE AUTOBACKUP is ON, then RMAN performs a control file autobackup in these circumstances:

The BACKUP command optimizes backups, that is, does not back up files that are identical to files that are already backed up, when the following conditions are met:

Restrictions and Usage Notes

When using the BACKUP command you must:

When using the BACKUP command, you cannot do the following:

Keywords and Parameters

FULL 

copies all blocks into the backup set, skipping only datafile blocks that have never been used. RMAN makes full backups by default if neither FULL nor INCREMENTAL is specified. The server session does not skip blocks when backing up archived redo logs or control files. A full backup has no effect on subsequent incremental backups, so it is not considered a part of the incremental backup strategy. 

INCREMENTAL LEVEL = integer 

Copies only those data blocks that have changed since the last incremental integer backup, where integer is any integer from 1 to 4. For example, in a level 2 backup RMAN backs up all blocks used since the most recent level 2, level 1, or level 0 backup. This type of incremental backup is also called a differential backup to distinguish it from a cumulative backup.

A level 0 backup must exist as the base backup for an incremental strategy. An incremental backup at level 0 is identical in content to a full backup, but unlike a full backup the level 0 backup is considered a part of the incremental strategy. If no level 0 backup exists when you run a level 1 or higher backup, RMAN makes a level 0 backup automatically.

Oracle performs checks when attempting to create an incremental backup at a level greater than 0. These checks ensure that the incremental backup will be usable by a subsequent RECOVER command. Among the checks performed are:

  • A level 0 backup set must exist, or level 0 datafile copies must exist for each datafile in the BACKUP command. These backup sets must not be marked UNAVAILABLE. If no level 0 backup exists, RMAN automatically makes one.

  • Sufficient incremental backups taken since the level 0 must exist and be available such that the incremental backup to be created is usable.

If you specify INCREMENTAL, then in the backupSpec clause you must set one of the following parameters: DATAFILE, DATAFILECOPY, TABLESPACE, or DATABASE. RMAN does not support incremental backups of control files, archived redo logs, or backup sets.

Note that you cannot make inconsistent incremental backups when the database is in NOARCHIVELOG mode. Hence, you cannot generate incremental backups when a NOARCHIVELOG database is open and in use.

See Also: "CHANGE" 

PLUS ARCHIVELOG 

When you specify PLUS ARCHIVELOG, RMAN performs these steps:

  1. Runs an ALTER SYSTEM ARCHIVE LOG CURRENT statement.

  2. Runs the BACKUP ARCHIVELOG ALL command. Note that if backup optimization is enabled, then RMAN only backs up logs that have not yet been backed up.

  3. Backs up the files specified in the BACKUP command.

  4. Runs an ALTER SYSTEM ARCHIVE LOG CURRENT statement.

  5. Backs up any remaining archived redo logs.

The backupSpecPlus clause includes the same options as the backupSpec clause. 

backupSpec 

A BACKUP specification list contains a list of one or more backupSpec clauses. A backupSpec clause minimally contains a list of one or more objects to be backed up.

Each backupSpec clause generates one or more backup sets. A backupSpec clause generates multiple backup sets if the number of datafiles specified in or implied by its list of objects exceeds the FILESPERSET limit. 

 

BACKUPSET 

Backs up either ALL backup sets or backup sets specified by primary_key or completion time. Use this parameter in conjunction with the DEVICE TYPE sbt clause to back up all backups on disk to tape. You cannot back up from tape to tape or from tape to disk: only from disk to disk or disk to tape.

Note if you specify the DELETE INPUT option, then RMAN deletes all copies of the backup set that exist on disk. For example, if you duplexed a backup to 4 locations, then RMAN deletes all 4 backup sets. The ALL option is redundant, that is, it does not add any functionality.

RMAN performs backup set failover when backing up backup sets. RMAN searches for all available backup copies when the copy that it is trying to back up is corrupted or missing. This behavior is similar to RMAN's behavior when backing up archived logs that exist in multiple archiving destinations.

Note: You can duplex backups of backup sets by using BACKUP COPIES and SET BACKUP COPIES.

See Also: "completedTimeSpec" 

 

DATAFILE datafileSpec 

Specifies a list of one or more datafiles.

Note: If you back up datafile 1, which is the first file of the SYSTEM tablespace, RMAN includes the control file in the backup set.

See Also: "datafileSpec" 

 

DATAFILECOPY 'filename' 

Specifies the filenames of one or more datafile image copies. 

 

DATAFILECOPY TAG = tag_name 

Specifies a list of one or more datafile copies, identified by tag. If multiple datafile copies with this tag exist, then Oracle backs up only the most current datafile copy of any particular datafile.  

 

TABLESPACE tablespace_name 

Specifies the names of one or more tablespaces. RMAN backs up all datafiles that are currently part of the tablespaces.

This keyword is provided merely as a convenience; Oracle translates the tablespace name internally into a list of datafiles. 

 

DATABASE 

Specifies datafiles in the database.

To include the current control file in the backup set, specify the INCLUDE CURRENT CONTROLFILE clause. You can include only datafiles and the standby control file in the backup set: you cannot include archived redo logs. 

 

archivelogRecordSpecifier clause 

Specifies a range of archived redo logs to be backed up. RMAN does not signal an error if the command finds no logs to back up, because this situation probably exists because no new logs were generated after the previous BACKUP ARCHIVELOG ALL DELETE INPUT command.

If you specify BACKUP ARCHIVELOG ALL, then RMAN backs up exactly one copy of each distinct log sequence number. For example, if you archive logs to multiple destinations, RMAN backs up one copy of each log sequence number--not each archived copy of each log sequence number. For other commands, such as DELETE, ALL does refer to every log, even duplicate log sequences.

See Also: "archivelogRecordSpecifier" for syntax, and Oracle9i Recovery Manager User's Guide for explanations of backup failover for logs and automatic log switching 

 

CURRENT CONTROLFILE 

specifies the current control file.

If you specify FOR STANDBY, then RMAN generates a backup of the control file that is usable during creation of a standby database. The backup contains only the standby control file.

Note: You cannot assign a tag to a current control file. 

 

CONTROLFILECOPY 'filename' 

specifies the filename of a control file copy. The control file copy can be:

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

  • A standby control file copy created 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. 

FORMAT = 'format_string' 

Specifies a filename to use for the backup piece. Any name that is legal as a sequential filename on the platform is allowed, if each backup piece has a unique name. If backing up to disk, then any legal disk filename is allowed, provided it is unique. If you do not specify the FORMAT parameter, RMAN stores the backup pieces in a port-specific directory ($ORACLE_HOME/dbs on UNIX).

You can specify up to four FORMAT strings. RMAN uses the second, third, and fourth values only when BACKUP COPIES, SET BACKUP COPIES, or CONFIGURE ... BACKUP COPIES is in effect. When choosing the format for each backup piece, RMAN uses the first format value for copy 1, the second format value for copy 2, and so on. If the number of format values exceeds the number of copies, then the extra formats are not used. If the number of format values is less than the number of copies, then RMAN reuses the format values, starting with the first one.

Specify FORMAT in any of these places, listed in order of precedence:

  1. The backupSpec clause

  2. The BACKUP command

  3. The ALLOCATE CHANNEL command

  4. The CONFIGURE CHANNEL command

If specified in more than one of these places, then RMAN searches for the FORMAT parameter in the order shown.

Note that the entire FORMAT string is processed in a port-specific manner by the target instance to derive the final backup piece name. The following substitution variables are available in FORMAT strings to aid in generating unique filenames. The formatting of this information varies by platform. 

 

%c 

Specifies the copy number of the backup piece within a set of duplexed backup pieces. If you did not duplex a backup, then this variable is 1 for backup sets and 0 for proxy copies. If one of these commands is enabled, then the variable shows the copy number. The maximum value for %c is 256. 

 

%d 

Specifies the name of the database. 

 

%D 

Specifies the current day of the month from the Gregorian calendar in format DD

 

%F 

Combines the DBID, day, month, year, and sequence into a unique and repeatable generated name. 

 

%M 

Specifies the month in the Gregorian calendar in format MM

 

%n 

Specifies the name of the database, padded on the right with x characters to a total length of eight characters. For example, if the prod1 is the database name, then the padded name is prod1xxx

 

%p 

Specifies the piece number within the backup set. This value starts at 1 for each backup set and is incremented by 1 as each backup piece is created.

Note: If you specify PROXY, then the %p variable must be included in the FORMAT string either explicitly or implicitly within %U

 

%s 

Specifies the backup set number. This number is a counter in the control file that is incremented for each backup set. The counter value starts at 1 and is unique for the lifetime of the control file. If you restore a backup control file, then duplicate values can result. Also, CREATE CONTROLFILE initializes the counter back to 1

 

%t 

Specifies the backup set time stamp, which is a 4-byte value derived as the number of seconds elapsed since a fixed reference time. The combination of %s and %t can be used to form a unique name for the backup set. 

 

%T 

Specifies the year, month, and day in this format: YYYYMMDD

 

%u 

Specifies an 8-character name constituted by compressed representations of the backup set number and the time the backup set was created. 

 

%U 

Specifies a convenient shorthand for %u_%p_%c that guarantees uniqueness in generated backup filenames. If you do not specify a format, RMAN uses %U by default. 

 

%Y 

Specifies the year in this format: YYYY

 

%% 

Specifies the '%' character. For example, %%Y translates to the string %Y

CHANNEL channel_id 

Specifies the case-sensitive name of a channel to use when creating backup sets. Use any name that is meaningful, for example ch1 or dev1. Oracle uses the channel ID to report I/O errors. If you do not specify this parameter, then RMAN dynamically assigns the backup sets to any available channels during job execution.

Note: You can also specify this parameter in the backupSpec clause. 

CUMULATIVE 

Copies the data blocks used since the most recent backup at level n-1 or lower, where n is an integer from 1 to 4. For example, in a cumulative level 2 backup RMAN backs up all blocks used since the most recent level 1 or level 0 backup. 

MAXSETSIZE = integer 

Specifies a maximum size for a backup set in bytes (default), kilobytes (K), megabytes (M), and gigabtyes (G). Thus, to limit a backup set to 3 Mb, specify MAXSETSIZE = 3M. The default size is in bytes, rounded down from kilobtyes. For example, MAXSETSIZE = 3000 is rounded down to 2 K (2048 bytes). The minimum value must be >= the database block size.

RMAN attempts to limit all backup sets to this size. Use MAXSETSIZE to configure backup sets so that each fits on one tape rather than spans multiple tapes. Otherwise, if one tape of a multivolume backup set fails, then you lose the data on all the tapes rather than just one.

When files are located on one disk and do not create an I/O distribution problem, the MAXSETSIZE parameter is easier to use than FILESPERSET. The FILESPERSET parameter is more useful for managing I/O distribution for backups of files on multiple disks.

Note: Because FILESPERSET has a default, both MAXSETSIZE and FILESPERSET take effect when MAXSETSIZE is set. RMAN attempts to limit the size in bytes of the backup sets according to the MAXSETSIZE parameter, treating FILESPERSET as an upper limit for the number of files to include in each set. 

FILESPERSET = integer 

Specifies the maximum number of input files in each backup set. If you set FILESPERSET = n, then RMAN never includes more than n files in a backup set. The default for FILESPERSET is the lesser of these two values: 64, number of input files divided by the number of channels. For example, if you back up 100 datafiles by using two channels, RMAN sets FILESPERSET to 50.

RMAN always attempts to create enough backup sets so that all allocated channels have work to do. An exception to the rule occurs when there are more channels than files to back up. For example, if RMAN backs up two datafiles when three channels are allocated and FILESPERSET = 1, then one channel is necessarily idle.

See Also: The MAXSETSIZE parameter, which limits backup sets by total bytes rather than number of files included 

PARMS = 'channel_parms' 

Specifies a quoted string containing operating system-specific information. RMAN passes the string to the operating system-dependent layer each time a backup piece is created. Currently, no PARMS settings are available when specified in the BACKUP command, although you can specify PARMS in the ALLOCATE CHANNEL or CONFIGURE CHANNEL command. 

POOL = integer 

Specifies the media pool in which the backup should be stored. Consult your media management documentation to see whether the POOL option is supported. 

TAG tag_name 

Creates a user-specified tag for the backup set. Typically, a tag is a meaningful name such as monday_evening_backup or weekly_full_backup. Tags must be 30 characters or less. Note that tags are reusable, so that backup set 100 can have the tag monday_evening_backup one week while backup set 105 has the same tag the next week. 

 

You can also specify the tag at the backupSpec level. If you specify the tag at:

  • The command level, then all backup sets created by this command are given this tag.

  • The backupSpec level, then backup sets created as a result of different backup specifications can have different tags.

  • Both levels, then the tag in the backupSpec takes precedence.

Note: You cannot automatically assign a different tag name to each backup. The easiest way to give each backup a new tag is to write a backup script and then edit it with an operating system utility before each execution. 

keepOption 

Overrides any configured retention policy for this backup so that the backup is not considered obsolete. You can use CHANGE to alter the keep status. Note that you must be connected to a recovery catalog when you specify KEEP FOREVER.

See Also: "keepOption" 

SKIP 

excludes datafiles or archived redo logs from the backup set.

Note: You can also specify this option in the backupSpec clause. 

 

OFFLINE 

specifies that offline datafiles should be excluded from the backup set.  

 

READONLY 

specifies that read-only datafiles should be excluded from the backup set. 

 

INACCESSIBLE 

specifies that datafiles or archived redo logs that cannot be read due to I/O errors should be excluded from the backup set.

A datafile is only considered inaccessible if it cannot be read. Some offline datafiles can still be read because they still exist on disk. Others have been deleted or moved and so cannot be read, making them inaccessible. 

NOEXCLUDE 

When specified on BACKUP DATABASE command, RMAN backs up all tablespaces, including any for which a CONFIGURE EXCLUDE command has been entered. This option does not override SKIP OFFLINE or SKIP READONLY

PROXY 

Backs up the specified files by using the proxy copy functionality, which gives the media management software control over the data transfer between storage devices and the Oracle datafiles on disk. The media manager--not RMAN--decides how and when to move data.

When you run BACKUP with the PROXY option, RMAN performs these steps:

  1. Searches for a channel of the specified device type that is proxy-capable. If no such channel is found, then RMAN issues an error message. RMAN attempts a conventional (that is, nonproxy) backup of the specified files unless the ONLY option is specified, in which case it does not attempt a conventional backup.

  2. If RMAN locates a proxy-capable channel, it calls the media manager to determine whether it can proxy copy the file. If the media manager cannot proxy copy the file, then RMAN uses conventional backup sets to back up the file.

Note: If you specify PROXY, then the %p variable must be included in the FORMAT string either explicitly or implicitly within %U

 

ONLY 

Causes Oracle to issue an error message when it cannot proxy copy rather than creating conventional backup sets. 

VALIDATE 

Causes RMAN to scan the specified files and verify their contents. RMAN creates no output files. Use this command periodically to check for physical and logical errors in database files.

Note: You cannot validate backups of backup sets. 

FORCE 

Causes RMAN to ignore backup optimization. In other words, even if CONFIGURE BACKUP OPTIMIZATION is set to ON, RMAN backs up all specified files.

Note: You can also specify this option in the backupSpecOperand clause. 

DISKRATIO = integer 

Directs RMAN to assign datafiles to each backup set and spread them across the specified number of drives. For example, assume that you use 10 disks, the disks supply data at 10 bytes/second, and the tape drive requires 50 bytes/second to keep streaming. You can set DISKRATIO = 5 to spread the backup load across five disks for each backup set.

If you set FILESPERSET but not DISKRATIO, then DISKRATIO defaults to the same value as FILESPERSET. If you specify neither parameter, DISKRATIO defaults to 4. RMAN compares the DISKRATIO value to the actual number of devices involved in the backup and uses the lowest value. For example, if DISKRATIO = 4 and the datafiles are on three disks, then RMAN attempts to spread the backup load for each set among three disks.

The DISKRATIO parameter is easier for datafile backups when the datafiles are striped or reside on separate disk spindles and you either:

  • Use a high-bandwidth tape drive that requires several datafiles to be multiplexed in order to keep the tape drive streaming

  • Make backups while the database is open and you need to spread the I/O load across several disk spindles in order to leave bandwidth for online operations

Note: Do not spread I/O over more than the minimum number of disks to keep the tape streaming. Otherwise, you increase restore time for a file without increasing performance. 

NOT BACKED UP 

Backs up only those files (of the files specified on the command) that RMAN has not backed up since the specified time. If SINCE TIME is not specified, then only those files that have never been backed up will be backed up. This option is a convenient way to back up new files after adding them to the database.

This clause is a useful way to back up files that were not backed up during a previous aborted backup. For example, you back up the database, but the instance crashes halfway through. You can then restart the backup by using the NOT BACKUP UP clause and avoid backing up those files that you already backed up. This feature is only useful if RMAN generates multiple backup sets during the backup. Consequently, you may want to set the FILESPERSET parameter to a low value so that RMAN generates multiple backup sets. 

 

SINCE TIME = 'date_string' 

Specifies the date after which RMAN should back up files that have no backups. The date_string is either a date in the current NLS_DATE_FORMAT, or a SQL date expression such as 'SYSDATE-1'.

When determining whether a file has been backed up or not, the SINCE date that was entered is compared with the completion time of the most recent backup. The completion time for a file in a backup set is the completion time of the entire backup set. In other words, all files in the same backup set have the same completion time. 

NOCHECKSUM 

Suppresses block checksums. A checksum is a number that is computed from the contents of a data block. If the DB_BLOCK_CHECKSUM initialization parameter is true, then Oracle computes a checksum for each block and stores it in the block before writing the block to disk. When Oracle reads the block from disk later, it makes sure that the block generates the same checksum. If it does not, then the block is damaged.

Unless you specify the NOCHECKSUM option, Oracle computes a checksum for each block and stores it in the backup. The checksum is verified when restoring from the backup and written to the datafile when restored. If the database is already maintaining block checksums, then this flag has no effect. The checksum is always verified and stored in the backup in this case.

See Also: Oracle9i Database Reference for more information about the DB_BLOCK_CHECKSUM initialization parameter 

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.

If the sum of physical and logical corruptions detected for a file remain below its MAXCORRUPT setting, then the RMAN command completes and Oracle populates V$BACKUP_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. 

COPIES = integer 

Specifies the number of identical backups (1 - 4) that RMAN should generate. The default value is 1. You can specify duplexing on more than one command. The order of precedence is as follows, with settings higher on the list overriding settings lower on the list:

  • BACKUP COPIES

  • SET BACKUP COPIES

  • CONFIGURE ... BACKUP COPIES

DEVICE TYPE deviceSpecifier 

Allocates automatic channels for the specified device type only. This option is valid only if you have configured channels and have not manually allocated channels. For example, if you configure disk and tape channels, then configure sbt as the default device type, this command allocates disk channels only:

BACKUP DEVICE TYPE DISK DATABASE;

See Also: "deviceSpecifier" 

backupSpecOperand 

Specifies a variety of options and parameters that affect the backupSpec clause. Most of the backupSpecOperand options are the same as the backupOperand options. Only the options unique to this clause are described below. 

 

INCLUDE CURRENT CONTROLFILE 

creates a snapshot of the current control file and places it into each backup set produced by this clause.

If you specify FOR STANDBY, then RMAN creates a backup of the control file usable for creation of a standby database. The backup set includes the standby control file and the object backed up. 

 

DELETE INPUT 

deletes the input files upon successful creation of the backup set. Specify this option only when backing up archived logs, datafile copies, or backup sets. It is equivalent to issuing DELETE for the input files.

The ALL option applies only to archived logs. If you run DELETE ALL INPUT, then the command deletes all copies of corresponding archived redo logs or datafile copies that match the selection criteria. For example, if you specify the SEQUENCE n clause, then RMAN deletes all archive logs with same sequence number n, including duplicate archived logs (that is, logs with same log sequence number and thread).

Note: The BACKUP ARCHIVELOG command only backs up one copy of each distinct log sequence number, so if the DELETE INPUT option is requested without the ALL keyword, RMAN only deletes the copy of the file that it backs up.

See Also: "CONNECT" for information on the effect of recovery catalog compatibility on this command 

Examples

Backing Up a Database: Example

This command backs up the database to tape and then backs up the control file that contains the record of the database backup:

BACKUP DATABASE;
BACKUP CURRENT CONTROLFILE;

Backing Up Tablespaces and Datafiles: Example

This command uses two backupSpec clauses to back up tablespaces and datafiles and lets RMAN perform automatic parallelization of the backup:

RUN
{
  ALLOCATE CHANNEL dev1 DEVICE TYPE DISK FORMAT '/fs1/%U';
  ALLOCATE CHANNEL dev2 DEVICE TYPE DISK FORMAT '/fs2/%U'; 
  BACKUP 
    (TABLESPACE SYSTEM,sales1,sales2,sales3 FILESPERSET 20)
    (DATAFILE 12,14,15);
}

Backing Up Multiple Copies of Archived Redo Logs: Example

This example backs up the archived redo logs in /oracle/arch/dest1 to one set of tapes and the logs from /oracle/arch/dest2 to another set of tapes. This scenario assumes that you have two tape drives available.

# channel configuration
CONFIGURE DEVICE TYPE sbt PARALLELISM 2;
CONFIGURE CHANNEL 1 DEVICE TYPE sbt PARMS="ENV=(NSR_SERVER=tape_server_1)"; 
CONFIGURE CHANNEL 2 DEVICE TYPE sbt PARMS="ENV=(NSR_SERVER=tape_server_2)"; 

# backup
BACKUP 
  FILESPERSET=20 
  FORMAT='AL_%d/%t/%s/%p' 
  (ARCHIVELOG LIKE '/oracle/arch/dest1/%' CHANNEL ORA_SBT_TAPE_1) 
  (ARCHIVELOG LIKE '/oracle/arch/dest2/%' CHANNEL ORA_SBT_TAPE_2); 

Backing Up Multiple Copies of Archived Logs and Deleting the Input: Example

This example assumes that you have two archive destinations set: /arch/dest1 and /arch/dest2. The command backs up one log for each unique sequence number and then deletes all logs from both archiving directories.

BACKUP ARCHIVELOG LIKE '/arch/dest%' DELETE ALL INPUT;

Backing Up Backup Sets to Tape: Example

In this example, you want to keep recent backup sets on disk and older backup sets on tape. You do not want backup sets to exist on disk and tape simultaneously. Hence, you execute this command to back up older backups created more than two weeks ago to tape and then delete the input backup pieces:

BACKUP DEVICE TYPE sbt BACKUPSET CREATED BEFORE 'SYSDATE-14' 
  DELETE INPUT;

Specifying DEVICE TYPE on the BACKUP Command: Example

This example configures DISK as the default device type, then backs up archived logs to tape:

CONFIGURE DEFAULT DEVICE TYPE TO DISK;
BACKUP DEVICE TYPE sbt ARCHIVELOG ALL;

Performing a Cumulative Incremental Backup: Example

This example backs up all blocks changed in the database since the most recent level 0 or level 1 backup:

BACKUP INCREMENTAL LEVEL 2 CUMULATIVE SKIP INACCESSIBLE DATABASE;

Duplexing a Backup Set: Example

This example duplexes a backup of datafile 1 to separate file systems:

BACKUP COPIES 2 DATAFILE 1 FORMAT '/fs1/df1_%U', '/fs2/df1_%U';

Specifying How Channels Divide a Workload: Example

This example parallelizes a backup operation by specifying which channels should back up which files and to which location:

RUN
{
  ALLOCATE CHANNEL ch1 DEVICE TYPE sbt PARMS="ENV=(NSR_SERVER=tape_server_1)";
  ALLOCATE CHANNEL ch2 DEVICE TYPE DISK RATE 1500K;
  ALLOCATE CHANNEL ch3 DEVICE TYPE sbt PARMS="ENV=(NSR_SERVER=tape_server_2)";
  BACKUP 
    (DATAFILE 1,2,3,4        # channel ch1 backs up datafiles to tape drive #1
    CHANNEL ch1)
    (CONTROLFILECOPY '/oracle/copy/cf.f'
    CHANNEL ch2)             # channel ch2 backs up control file copy to disk
    (ARCHIVELOG FROM TIME 'SYSDATE-14'
    CHANNEL ch3);            # channel ch3 backs up archived redo logs to tape drive #2
}

Performing an Oracle Real Application Clusters Backup: Example

The following script distributes datafile and archived log backups across two nodes in an Oracle Real Application Clusters environment:

RUN
{
  ALLOCATE CHANNEL node_1 DEVICE TYPE sbt
    CONNECT 'SYS/sys_pwd@node_1'
    PARMS 'ENV=(DSMO_NODE=KDFDWD01_ORACLE)'
    FORMAT '%d_set%s_%t_piece%p';
  SET LIMIT CHANNEL node_1 KBYTES=1000000;
  SET COMMAND ID TO 'node_1';
  ALLOCATE CHANNEL node_2 DEVICE TYPE sbt
    CONNECT 'SYS/sys_pwd@node_2'
    PARMS 'ENV=(DSMO_NODE=KDFDWD01_ORACLE)'
    FORMAT '%d_set%s_%t_piece%p';
  SET LIMIT CHANNEL node_2 KBYTES=1000000;
  SET COMMAND ID TO 'node_2';
  BACKUP FILESPERSET 1
    (TABLESPACE SYSTEM, rbs, data1, data2
    CHANNEL node_1)
    (TABLESPACE temp, reccat, data3, data4
    CHANNEL node_2);
  BACKUP FILESPERSET 20
    (ARCHIVELOG UNTIL TIME 'SYSDATE' LIKE '/node1/arc/%'
    DELETE ALL INPUT   # deletes all logs that match LIKE criteria
    CHANNEL node_1);
    (ARCHIVELOG UNTIL TIME 'SYSDATE' LIKE '/node2/arc/%'
    DELETE ALL INPUT   # deletes all logs that match LIKE criteria 
    CHANNEL node_2);
}

Creating a Control File for a Standby Database: Example

This example creates a backup of the current control file that can be used to create a standby database:

BACKUP STANDBY CONTROLFILE;

Checking for Corruption: Example

This example backs up datafile 3 and specifies that no more than two blocks with corruption should be tolerated:

RUN
{
  SET MAXCORRUPT FOR DATAFILE 3 TO 2;
  BACKUP CHECK LOGICAL
    DATAFILE 3;
}

Creating a Long-Term Backup: Example

This example creates a consistent backup of the database that is exempt from the retention policy and tells RMAN to keep the backup for the next year, but not to keep the archived logs necessary to recover it:

SHUTDOWN;
STARTUP MOUNT;
BACKUP DATABASE UNTIL 'SYSDATE+365' NOLOGS;

Backing Up Files with No Recent Backups: Example

This example backs up all database files and archived logs that have not been backed up in the last month:

BACKUP DATABASE, ARCHIVELOG ALL NOT BACKED UP SINCE TIME 'SYSDATE-31';

Using a UNIX Shell Script to Generate Unique Tag Names: Example

This sample UNIX shell script can generate RMAN backups with unique backup tag names:

#!/bin/sh
today=`date +%a`
rman <<EOF
CONNECT TARGET /;
CONNECT CATALOG rman/rman@rcdb;
BACKUP DATABASE PLUS ARCHIVELOG TAG '$today';
EOF

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