Oracle8i Backup and Recovery Guide
Release 8.1.5

A67773-01

Library

Product

Contents

Index

Prev Prev Next


run

Syntax


Purpose

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.

Requirements

Keywords and Parameters

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

@filename  

executes a series of RMAN commands stored in an O/S file with the specified full pathname, e.g., @$ORACLE_HOME/dbs/cmd/cmd1.rman. If you do not specify the full pathname, the current working directory is assumed, e.g., @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.  

@@filename  

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: For more information about RC_STORED_SCRIPT, see "RC_STORED_SCRIPT". For information about creating scripts, see "createScript".  

Examples

Making a Backup

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

run{
     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';  
     sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE" ; 
     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; } 



Prev

Top

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index