Oracle8i Recovery Manager User's Guide and Reference
Release 2 (8.1.6)

Part Number A76990-01





Go to previous page Go to beginning of chapter Go to next page

Recovery Manager Command Syntax, 25 of 50




To invoke an operating system command-line sub-shell from within RMAN.


Execute this command at the RMAN prompt or within the braces of a run command.

Keywords and Parameters


enables you to execute an operating system command. Use this parameter:

  • with a 'command', in which case RMAN runs the command in the specified string and then continues.

  • without a 'command', in which case RMAN displays a command prompt and resumes after you exit the sub-shell.



Executing an Operating System Copy Within RMAN

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';
Hosting to the Operating System Within a Copy Job

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
% exit
RMAN-06134: host command complete

RMAN-03022: compiling command: release
RMAN-03023: executing command: release
RMAN-08031: released channel: c1

Go to previous page Go to beginning of chapter Go to next page
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.