Oracle® Database Backup and Recovery Reference 10g Release 2 (10.2) Part Number B14194-03 |
|
|
PDF · Mobi · ePub |
run::=
restoreCommands::=
maintenanceCommands::=
miscellaneousCommands::=
The RUN command lets you group a series RMAN commands into a block to be executed sequentially. It also creates a scope within which a script can override default configured channels for a task using the ALLOCATE CHANNEL and RELEASE CHANNEL commands, and other parameters using the SET command with appropriate arguments. On completing the execution of the commands listed in the RUN block, the channels allocated within the RUN block are released and settings returned to their values.
Upon reading the closing brace of the RUN
block, RMAN compiles the list of job commands into one or more job steps and then executes the steps immediately.
Execute this command only at the RMAN prompt.
You must precede and follow the list of job commands with an opening and closing brace.
Refer to individual entries for information about commands that you can run from the RMAN prompt.
Making a Backup: Example This example backs up a database by using a single manually allocated channel to perform the backup:
RUN { ALLOCATE CHANNEL c1 TYPE sbt; BACKUP DATABASE; }
Restoring and Recovering a Tablespace: Example This example takes tablespace tools
offline, restores it, then performs complete media recovery:
RUN { SQL "ALTER TABLESPACE tools OFFLINE IMMEDIATE"; RESTORE TABLESPACE tools; RECOVER TABLESPACE tools; SQL "ALTER TABLESPACE tools ONLINE"; }
Executing an RMAN Script: Example This example executes the stored script backup_db
:
RUN { EXECUTE SCRIPT backup_db; }