Skip Headers

Oracle9i Recovery Manager Reference
Release 2 (9.2)

Part Number A96565-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

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

RMAN Commands , 30 of 59


HOST

Syntax

Text description of host.gif follows
Text description of the illustration host.gif


Purpose

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

Restrictions and Usage Notes

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

Keywords and Parameters

Syntax Element Description

HOST

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 subshell.

Examples

Executing an Operating System Copy Within RMAN: Example

This example shuts down the database, makes a backup of datafile system01.dbf, then executes the UNIX ls command to display all backed up datafiles:

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
BACKUP DATAFILE '?/oradata/trgt/system01.dbf'
  FORMAT '/tmp/system01.dbf';
HOST 'ls -l /tmp/*dbf';
ALTER DATABASE OPEN;
Hosting to the Operating System Within a Copy Job: Example

This example makes an image copy of datafile 3, hosts out to the UNIX prompt to check that the copy is in the directory (the UNIX session output is indented and displayed in bold), then resumes the RMAN session:

RMAN> COPY DATAFILE 3 TO '?/oradata/df3.cpy';
RMAN> HOST;
 % ls $ORACLE_HOME/oradata/df3.cpy
 /net/oracle/oradata/df3.cpy
 % exit
RMAN> LIST COPY;
Issuing a SQL*Plus Query Through the Host Command

The following example uses HOST to start the UNIX shell and then runs a SQL*Plus data dictionary query:

HOST " echo 'SELECT * FROM DBA_TABLESPACES;' | sqlplus '/ AS SYSDBA' ";

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

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback