Oracle8i Backup and Recovery Guide Release 8.1.5 A67773-01 |
|
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.
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., 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 % rman @$ORACLE_HOME/rdbms/admin/dba/scripts/cmd1.rman
Assume that the |
|
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". |
This example backs up a database using a single server process to perform the backup:
run{ allocate channel c1 type disk; backup database; }
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 ; }
This example executes the stored script backupdb
:
run { execute script backupdb; }