This section explains the conventions used in this chapter including:
The text in this reference adheres to the following conventions:
UPPERCASE
monospace :
Calls attention to RMAN keywords, SQL keywords, column headings in tables and views, and initialization parameters.
lowercase
monospace
: Calls attention to variable text in RMAN examples.
italics
: Calls attention to RMAN or SQL placeholders, that is, text that should not be entered as-is but represents a value to be entered by the user.
This section describes the conventions for RMAN command syntax.
The RMAN language is free-form. Keywords must be separated by at least one white space character (such as a space, tab, or line break). An RMAN command starts with a keyword corresponding to one of the commands described in Chapter 2, "RMAN Commands", followed by arguments and ending with a semicolon, as shown in the syntax diagrams. A command can span multiple lines.
A comment can be inserted by using a #
character at any point in a line. After the #
character, the remainder of the line is ignored. For example:
# run this command once each day BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY # using incrementally updated backups WITH TAG "DAILY_BACKUP" # daily backup routine DATABASE;
This reference uses syntax diagrams to show Recovery Manager commands. These syntax diagrams use lines and arrows to show syntactic structure, as shown in the following example for the RMAN CATALOG command.
lcatalog::=
This section describes the components of syntax diagrams and gives examples of how to write RMAN commands. Syntax diagrams are made up of these items:
Keywords have special meanings in Recovery Manager syntax. In the syntax diagrams, keywords appear in rectangular boxes and an uppercase font, like the word CATALOG
in the example diagram. When used in text and code examples, RMAN keywords appear in uppercase, monospace font, for example, CATALOG
DATAFILECOPY
. You must use keywords in RMAN statements exactly as they appear in the syntax diagram, except that they can be either uppercase or lowercase.
Placeholders in syntax diagrams indicate non-keywords. In the syntax diagrams, they appear in ovals, as in the word integer in the example diagram. When described in text, RMAN placeholders appear in lowercase italic, for example, 'filename'. Placeholders are usually:
Names of database objects (tablespace_name)
Oracle datatype names (date_string)
Subclauses (datafileSpec)
When you see a placeholder in a syntax diagram, substitute an object or expression of the appropriate type in the RMAN statement. For example, to write a DUPLICATE
TARGET
DATABASE
TO
'database_name' command, use the name of the duplicate database you want to create, such as dupdb
, in place of the database_name placeholder in the diagram.
Some placeholder values are enclosed in required or optional quotes. The syntax diagrams show single quotes, though in all cases double quotes are also legal in RMAN syntax. For example, you specify either 'filename' or "filename". For the SQL
command, it is recommended that you use double quotes because the SQL statement itself may also contain a quote, and the most common type of quote in a SQL statement is a single quote. Single and double quotes do not mean the same in SQL as they do in RMAN.
The only system-independent, legal environment variables in RMAN quoted strings are ?
for the Oracle home and @
for the SID. However, you can use operating system specific environment variables on the target system within quoted strings. The environment variables are interpreted by the database server and not the RMAN client.
The following table shows placeholders that appear in the syntax diagrams and provides examples of the values you might substitute for them in your statements.
Placeholder | Description | Examples |
---|---|---|
Quoted strings such as 'filename ', 'tablespace_name ', 'channel_name ', 'channel_parms ' |
A string of characters contained in either single or double quotes. A quoted string may contain white space, punctuation, and RMAN and SQL keywords. | "?/dbs/cf.f"
|
Nonquoted strings such as channel_id , tag_name , date_string |
A sequence of characters containing no white space and no punctuation characters and starting with an alphabetic character. | ch1 |
integer |
Any sequence of only number characters. | 67843 |
The RMAN language contains a number of reserved words, which are or have been in the past used in RMAN commands. The following table lists all of the current reserved words.
Reserved Word | Reserved Word | Reserved Word | Reserved Word | Reserved Word | Reserved Word |
---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you must use one of the reserved words as an argument to an RMAN command (for example, as a filename, tablespace name, tag name, and so on), surround it with quotes. Otherwise, RMAN cannot parse your command correctly and generates an error. These are examples of correct and incorrect commands that use RMAN reserved words with quotes:
ALLOCATE CHANNEL backup DEVICE TYPE DISK; # incorrect ALLOCATE CHANNEL 'backup' DEVICE TYPE DISK; # correct BACKUP DATABASE TAG full; # incorrect BACKUP DATABASE TAG 'full'; # correct
In general, you should avoid using reserved words in ways that conflict with their primary meaning in the RMAN command language.