Oracle8i Backup and Recovery Guide Release 8.1.5 A67773-01 |
|
To invoke an O/S command-line sub-shell from within RMAN.
Execute this command at the RMAN prompt or within the braces of a run command.
host |
enables you to execute an O/S command. Use this parameter: |
This example shuts down the database, makes a backup of datafile tbs_01.f
using a media manager, then makes an image copy of the same file on disk using a UNIX command. The database needs to be shut down cleanly to prevent fractured blocks:
shutdown immediate; run { allocate channel ch1 type disk; allocate channel ch2 type 'sbt_tape'; backup datafile '$ORACLE_HOME/dbs/tbs_01.f' channel ch2; host 'cp $ORACLE_HOME/dbs/tbs_01.f $ORACLE_HOME/dbs/copy/tbs_01.f'; }
This example makes an image copy of datafile 3, hosts out to the UNIX prompt to check that the copy is in the directory, then resumes the run job:
RMAN> run { 2> allocate channel c1 type disk; 3> copy datafile 3 to 'df.3'; 4> host; 5> release channel c1; 6> } RMAN-03022: compiling command: allocate RMAN-03023: executing command: allocate RMAN-08030: allocated channel: c1 RMAN-08500: channel c1: sid=17 devtype=DISK RMAN-03022: compiling command: copy RMAN-03023: executing command: copy RMAN-08000: channel c1: copied datafile 3 RMAN-08501: output filename=/oracle/dbs/df.3 recid=102 stamp=352745706 RMAN-03023: executing command: partial resync RMAN-08003: starting partial resync of recovery catalog RMAN-08005: partial resync complete RMAN-03022: compiling command: host % ls df.3 df.3 % exit exit RMAN-06134: host command complete RMAN-03022: compiling command: release RMAN-03023: executing command: release RMAN-08031: released channel: c1