Oracle8i Recovery Manager User's Guide and Reference
Release 2 (8.1.6)

Part Number A76990-01





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

Recovery Manager Command Syntax, 40 of 50




To compile and execute job commands, which are one or more statements executed within the braces of run. The run command compiles the list of job commands into one or more job steps and then executes them immediately. RMAN compiles and executes each command before processing the next one.


Keywords and Parameters

Refer to individual entries for information about commands that you can run from the RMAN prompt.


executes a series of RMAN commands stored in an operating system file with the specified full pathname, for example, @$ORACLE_HOME/dbs/cmd/cmd1.rman. If you do not specify the full pathname, the current working directory is assumed, for example, @cmd1.rman. Do not use quotes around the string or leave whitespace between the @ and filename. RMAN processes the specified file as if its contents had appeared in place of the @ command.

Note: The file must contain only complete Recovery Manager commands. A syntax error will result if the file contains a partial command.  


is identical to @filename unless used within a script. If contained in a script, @@filename directs RMAN to look for the specified filename in the same path as the command file from which it was called.

For example, assume that your working directory on UNIX is $ORACLE_HOME, and you invoke RMAN from the command line as follows:

% rman @$ORACLE_HOME/rdbms/admin/dba/scripts/cmd1.rman 

Assume that the @@cmd2.rman command appears inside the cmd1.rman script. In this case, the @@ command directs RMAN to look for the file cmd2.rman in the directory $ORACLE_HOME/rdbms/admin/dba/scripts

execute script script_name 

runs the specified stored script. To obtain a listing of all stored scripts, use SQL*Plus to connect to the recovery catalog database as the catalog owner and issue the following query:

select * from rc_stored_script;

See Also: "RC_STORED_SCRIPT" for more information about RC_STORED_SCRIPT, and "createScript" for information about creating scripts. 


Making a Backup

This example backs up a database using a single server process to perform the backup:

     allocate channel c1 type disk;
     backup database;
Restoring a Tablespace

This example takes tablespace tbs_1 offline, restores it, then performs complete media recovery:

run {  
     allocate channel ch1 type 'sbt_tape';  
     restore tablespace tbs_1 ; 
     recover tablespace tbs_1 ;  
     sql "ALTER TABLESPACE tbs_1 ONLINE" ; 
     release channel ch1 ;  
Executing a Script

This example executes the stored script backupdb:

run {  execute script backupdb; } 

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

All Rights Reserved.