Skip Headers
Oracle® Database Backup and Recovery Reference
10g Release 2 (10.2)

Part Number B14194-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

cmdLine

Syntax

cmdLine::=

Description of cmdline.gif follows
Description of the illustration cmdline.gif

Purpose

To start RMAN from the operating system command line. Use these arguments to:

If you start RMAN without specifying either CATALOG or NOCATALOG on the command line, then RMAN makes no connection to a repository. If you run a command that requires the repository, and if no CONNECT CATALOG command has been issued yet, then RMAN automatically connects in the default NOCATALOG mode. After that point, the CONNECT CATALOG command is not valid in the session.

See Also:

Oracle Database Backup and Recovery Basics to learn how to connect RMAN to database instances

Restrictions and Usage Notes

Use these arguments at the operating system command line rather than at the RMAN prompt.

Keywords and Parameters

Syntax Element Description
APPEND Causes new output to be appended to the end of the message log file. If you do not specify this parameter, and if a file with the same name as the message log file already exists, then RMAN overwrites it.
AUXILIARY = connectStringSpec Specifies a connect string to an auxiliary database, for example, AUXILIARY SYS/change_on_install@dupdb.

See Also: "connectStringSpec"

CATALOG = connectStringSpec Specifies a connect string to the database containing the recovery catalog, for example, CATALOG rman/rman@inst2.

See Also: "connectStringSpec"

CATALOG = connectStringSpec Specifies a connect string to the database containing the recovery catalog, for example, CATALOG rman/rman@inst2.

See Also: "connectStringSpec"

CHECKSYNTAX Causes RMAN to start in a mode where commands entered are checked for syntax errors, but no other processing is performed. If used with a CMDFILE or @ argument, the RMAN client starts, checks all commands in the file, then exits. If used without specifying a command file, then RMAN prompts the user for input and parses each command until the user exits the RMAN client.

RMAN reports an RMAN-0558 error for each command that is not syntactically correct.

CMDFILE = 'filename' Parses and compiles all RMAN commands in a file and then sequentially executes each command in the file. RMAN exits if it encounters a syntax error during the parse phase or if it encounters a runtime error during the execution phase. If no errors are found, then RMAN exits after the job completes.

If the first character of the filename is alphabetic, then you can omit the quotes around the filename. The contents of the command file should be identical to commands entered at the RMAN prompt.

Note: If you run a command file at the RMAN prompt rather than as an option on the operating system command line, then RMAN does not run the file as a single job. RMAN reads each line sequentially and executes it, only exiting when it reaches the last line of the script.

@filename Equivalent to CMDFILE.
LOG = 'filename' Specifies the file where RMAN records its output, that is, the commands that were processed and their results. If you do not specify this argument, then RMAN writes its message log file to standard output. The RMAN output is also stored in the V$RMAN_OUTPUT view (a memory-only view for jobs in progress) and in V$RMAN_STATUS (a control file view for completed jobs and jobs in progress).

The LOG parameter does not cause RMAN to terminate if the specified file cannot be opened. Instead, RMAN writes to standard output.

MSGNO Causes RMAN to print message numbers, that is, RMAN-xxxx, for the output of all commands. By default, RMAN does not print the RMAN-xxxx prefix.
NOCATALOG Indicates that you are using RMAN without a recovery catalog.

Note: If you do not specify either CATALOG or NOCATALOG on the command line, then RMAN defaults to NOCATALOG mode when it requires a repository connection (assuming that you have not issued CONNECT CATALOG).

SEND = 'command' Sends a vendor-specific command string to all allocated channels.

See Also: Your media management documentation to determine whether this feature is supported, and "SEND"

PIPE = 'pipe_name' Invokes the RMAN pipe interface. RMAN uses two public pipes: one for receiving commands and the other for sending output. The names of the pipes are derived from the value of the PIPE parameter. For example, you can invoke the RMAN pipe interface with the following options: PIPE rpi TARGET SYS/pwd@tdb.

RMAN opens the following pipes in the target database:

  • ORA$RMAN_RPI_IN, which RMAN uses to receive user commands

  • ORA$RMAN_RPI_OUT, which RMAN uses to send all output

All messages on both the input and output pipes are of type VARCHAR2.

See Also: Oracle Database Backup and Recovery Advanced User's Guide to learn how to pass commands to RMAN through a pipe

SCRIPT = 'script_name' Once connected to the target database and recovery catalog (which must be specified using the TARGET and CATALOG options), RMAN will run the named stored script from the recovery catalog against the target database. If there are both a global script.and a local stored script on the target database with the name script_name, RMAN will run the local script.

The single-quotes around the stored script name are required when the script name either begins with a number or is an RMAN reserved word. You should avoid creating script names that begin with a number or that match RMAN reserved words.

See "CREATE SCRIPT" for more details about stored scripts.

TARGET = connectStringSpec Specifies a connect string to the target database, for example, TARGET SYS/mypassword@inst1.

See Also: "connectStringSpec"

TIMEOUT = integer Causes RMAN to exit automatically if it does not receive input from an input pipe within integer seconds. The PIPE parameter must be specified when using TIMEOUT.

See Also: Oracle Database Backup and Recovery Advanced User's Guide to learn how to pass commands to RMAN through a pipe


Examples

Connecting Without a Recovery Catalog: Example This example connects to the target database prod1 without a recovery catalog:

% rman TARGET SYS/oracle@inst1 NOCATALOG

Connecting in Default NOCATALOG Mode: Example This example connects to the target database prod1 without specifying catalog options. Because CONNECT CATALOG is not run at the RMAN prompt, RMAN connects in default NOCATALOG mode when the first command requiring a repository connection is run:

% rman
RMAN> CONNECT TARGET
RMAN> BACKUP DATABASE;

Connecting to an Auxiliary Instance: Example This example connects to target database prod1, recovery catalog database rcat, and auxiliary instance aux1:

% rman TARGET SYS/sys_pwd@prod1 CATALOG rman/rman@rcat AUXILIARY sys/aux_pwd@aux1

Specifying a Command File: Example This example connects to the target database prod1 and the recovery catalog database rcat, and then runs the command file b_whole_10.rcv:

% rman TARGET SYS/sys_pwd@prod1 CATALOG rman/rman@rcat @'/oracle/dbs/b_whole_l0.rcv'

Syntax Check of a Command File: Example This example checks syntax of the contents of a command file b_whole_10.rcv:

% rman CHECKSYNTAX @'b_whole_l0.rcv'

Syntax Check in an Interactive Session: Example This example starts an interactive session to perform syntax checking:

% rman CHECKSYNTAX

Specifying a Stored Script: Example  This example connects to the target database prod1 and the recovery catalog database rcat, and then runs the stored script full_backup:

% rman TARGET SYS/sys_pwd@prod1 CATALOG rman/rman@rcat SCRIPT full_backup

Specifying a Message Log in Append Mode: Example This example connects to the target database prod1 without a recovery catalog and then specifies that RMAN should append messages to the message log:

% rman TARGET / NOCATALOG LOG = $ORACLE_HOME/dbs/log/msglog.f APPEND

Invoking the RMAN Pipe Interface: Example This example invokes the RMAN pipe newpipe with a 90 second timeout option:

% rman PIPE newpipe TARGET SYS/oracle@inst1 TIMEOUT = 90