Oracle® Database Recovery Manager Reference 10g Release 1 (10.1) Part Number B10770-02 |
|
|
View PDF |
run::=
backupCommands::=
Text description of backupCommands
restoreCommands::=
Text description of restoreCommands
maintenanceCommands::=
Text description of maintenanceCommands
miscellaneousCommands::=
Text description of 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.
Refer to individual entries for information about commands that you can run from the RMAN prompt.
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; }
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"; }
This example executes the stored script backup_db
:
RUN { EXECUTE SCRIPT backup_db; }