Oracle8i Backup and Recovery Guide
Release 8.1.5

A67773-01

Library

Product

Contents

Index

Prev Prev Next


host

Syntax


Purpose

To invoke an O/S command-line sub-shell from within RMAN.

Requirements

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

Keywords and Parameters

host  

enables you to execute an O/S 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.

 

Examples

Executing an O/S 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 O/S 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
df.3
% exit
exit
RMAN-06134: host command complete

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



Prev

Top

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index