Skip Headers
Oracle® Database Backup and Recovery Reference
11g Release 1 (11.1)

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

Go to previous page
Go to next page
View PDF



Use the @ command to execute a series of RMAN commands stored in an operating system file with the specified path name.


The file must contain complete RMAN commands. Partial commands generate syntax errors.


The command file must contain complete RMAN commands.

If you use the @ command within a RUN command, then the @ command must be on its own line (see Example 2-2).

Usage Notes

RMAN processes the file as if its contents had appeared in place of the @ command. As shown in Example 2-3, you can specify substitution variables in a command file and then pass values to the command file during execution.

See Also:

RMAN to learn more about using substitution variables in RMAN



Description of at.gif follows
Description of the illustration at.gif


Syntax Element Description
filename Specifies the name of a command file, for example, @/oracle/dbs/cmd/cmd1.rman. If you do not specify the absolute path name, then the current working directory is assumed, for example, @cmd1.rman.

Any file extension (or no file extension) is legal. Do not use quotes around the string or leave whitespace between the @ keyword and the file name.


Example 2-1 Running a Command File from the Operating System Command Line

This example creates a command file and then executes it from the operating system command line.

% echo "BACKUP DATABASE;" > backup_db.rman
% rman TARGET / @backup_db.rman

Example 2-2 Running a Command File Within RMAN

This example shows how you can execute a command file from the RMAN prompt and from within a RUN command. User-entered text appears in bold.

RMAN> @backup_db.rman
2> @backup_db.rman
3> backup database;
4> **end-of-file**
5> }

Example 2-3 Specifying Substitution Variables

Suppose that you use a text editor to create command file whole_db.cmd with the following contents:

# name: whole_db.cmd

The following example starts RMAN from the operating system prompt and connects to the target database. The example then runs the @ command, passing variables to the command file to create two database backups with tag Q106:

% rman TARGET SYS/password@prod1
RMAN> @/tmp/whole_db.cmd Q106 2