Oracle9i Recovery Manager User's Guide Release 1 (9.0.1) Part Number A90135-01 |
|
This chapter describes how to start and stop the Recovery Manager (RMAN) command-line interface and make database connections. This chapter contains these topics:
You have the following basic options for starting RMAN:
% rman TARGET / CATALOG rman/rman@rcat % rman TARGET sys/target_pwd@target_str NOCATALOG % rman TARGET / CATALOG rman/rman@rcat AUXILIARY sys/aux_pwd@aux_str
% rman
If you connect to the target database on the command line when you start RMAN, then after the RMAN prompt is displayed you can begin executing commands.
If you start RMAN without connecting to the target database, then you must issue CONNECT
TARGET
command at the RMAN prompt before you can begin performing backup and recovery operations.
You can connect to the following types of databases:
When connecting to the target database, you must have the SYSDBA
privilege. You can connect as SYSDBA
using a password file or using operating system authentication.
If the target database uses password files, then you can connect using a password. Use a password file for either local or remote access. You must use a password file if you are connecting remotely as SYSDBA
using a net service name.
If you connect to the database using operating system authentication, remember to configure the environment variable specifying the Oracle SID. For example, to set the SID to prod1
at the UNIX command line enter:
% ORACLE_SID=prod1; export ORACLE_SID
Note that a SYSDBA
privilege is not required when connecting to the recovery catalog. The only requirement is that the RECOVERY_CATALOG_OWNER
role be granted to the schema owner.
See Also:
The first chapter of the Oracle9i Database Administrator's Guide to learn how to authenticate users on a database, and to create a password file |
RMAN provides a number of command-line options that you can specify when starting RMAN. For example, you can start RMAN:
See Also:
CONNECT
syntax
You can start Recovery Manager at the operating system command line without connecting to a database by issuing the RMAN
command without any arguments. For example, enter:
% rman
If you did not specify the LOG
option at the command line, then RMAN displays the RMAN prompt:
RMAN>
After the RMAN prompt is displayed, you can issue further commands to connect to the target database, recovery catalog database, or auxiliary database.
If you start RMAN without specifying either CATALOG
or NOCATALOG
on the command line, then RMAN makes no repository connection. The first time a command is issued that requires the repository, 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.
In these examples, assume that these variables have the following meanings:
|
User with |
|
The password for connecting as |
|
The net service name for the target database |
To connect from the operating system command line, enter the connection as in the following examples:
# example of operating system authentication % rman TARGET / NOCATALOG # example of Oracle Net authentication % rman TARGET SYS/target_pwd@target_str NOCATALOG
Note that you can also start RMAN without specifying either NOCATALOG
or CATALOG
as follows:
# example of operating system authentication % rman TARGET / # example of Oracle Net authentication % rman TARGET SYS/target_pwd@target_str
If you do not specify the NOCATALOG
keyword on the command line, and if you also do not specify CONNECT
CATALOG
after RMAN has started, then RMAN connects in NOCATALOG
mode by default the first time that you run a command that requires a repository. For example:
% rman TARGET / RMAN> BACKUP DATABASE; # RMAN defaults to NOCATALOG mode
Alternatively, start RMAN and connect to the target database from the RMAN prompt, as in this example:
% rman NOCATALOG RMAN> CONNECT TARGET
This example connects to the target database by using a password file:
% rman NOCATALOG RMAN> connect target SYS/target_pwd@target_str
In these examples, assume that you maintain a recovery catalog and that these variables have the following meanings:
To connect to the target and recovery catalog databases from the operating system command line, enter the connection as in the following examples:
# operating system authentication % rman TARGET / CATALOG rman/cat_pwd@cat_str # Oracle Net authentication % rman TARGET SYS/target_pwd@target_str CATALOG rman/cat_pwd@cat_str
Alternatively, start RMAN and connect to the target database from the RMAN prompt. This example uses operating system authentication:
% rman RMAN> CONNECT TARGET RMAN> CONNECT CATALOG rman/cat_pwd@cat_str
This example uses Oracle Net authentication:
% rman RMAN> CONNECT TARGET SYS/target_pwd@target_str RMAN> CONNECT CATALOG rman/cat_pwd@cat_str
RMAN can only connect to one instance in an Oracle Real Application Clusters database at a time. Assume that inst1
, inst2
, and inst3
are net service names for three instances in an Oracle Real Application Clusters configuration. In this case, you can connect to the target database using only one of these net service names. For example, you can connect as follows:
% rman TARGET SYS/target_pwd@inst2 CATALOG rman/cat_pwd@cat_str
Each net service name must specify one and only one instance. You cannot specify a net service name that uses Oracle Net features to distribute connections to more than one instance.
Note that the fact that RMAN connects to only one instance for its initial target connection does not preclude running a backup using all three instances. For example, you can configure automatic channels to connect to each cluster instance as follows:
CONFIGURE DEFAULT DEVICE TYPE TO sbt; CONFIGURE DEVICE TYPE sbt PARALLELISM 3; CONFIGURE CHANNEL 1 DEVICE TYPE sbt CONNECT = 'SYS/target_pwd@inst1'; CONFIGURE CHANNEL 2 DEVICE TYPE sbt CONNECT = 'SYS/target_pwd@inst2'; CONFIGURE CHANNEL 3 DEVICE TYPE sbt CONNECT = 'SYS/target_pwd@inst3';
Then, make a whole database backup by running the following command:
BACKUP DATABASE;
To use the DUPLICATE
command or to perform RMAN TSPITR, you need to connect to an auxiliary instance. In these examples, assume that these variables have the following meanings:
If the auxiliary database uses password files for authentication, then you can connect using a password for either local or remote access. If you are connecting remotely through a net service name, then authentication through a password file is mandatory.
To connect to an auxiliary instance from the operating system command line, enter the following:
% rman AUXILIARY sys/aux_pwd@aux_str
To connect to the target, auxiliary, and recovery catalog databases, issue the following (all on one line):
% rman TARGET sys/target_pwd@target_str CATALOG rman/cat_pwd@cat_str \ > AUXILIARY sys/aux_pwd@aux_str
Alternatively, you can start RMAN and connect to the auxiliary database from the RMAN prompt:
% rman RMAN> CONNECT AUXILIARY sys/aux_pwd@aux_str
To connect to the target, auxiliary, and recovery catalog databases, issue:
% rman RMAN> CONNECT TARGET sys/target_pwd@target_str RMAN> CONNECT CATALOG rman/cat_pwd@cat_str RMAN> CONNECT AUXILIARY sys/aux_pwd@aux_str
To connect to RMAN from the operating system command line and hide authentication information, you must first start RMAN and then perform either of the following actions:
CONNECT
commands at the RMAN prompt
For example, if you are running RMAN in an UNIX environment, then you can use the following procedure:
% rman
connect_rman
:
CONNECT TARGET sys/target_pwd@target_str CONNECT CATALOG rman/cat_pwd@cat_str
% chmod 711 connect_rman
RMAN> @connect_rman
The RMAN pipe interface is an alternative method for issuing commands to RMAN and receiving the output. By using a pipe, RMAN can interface with the DBMS_PIPE
PL/SQL package and avoid the operating system command shell altogether.
RMAN does not permit the pipe interface to be used with public pipes, because they are a potential security problem. With a public pipe, any user who knows the name of the pipe can send commands to RMAN and intercept its output.
If the pipes are not already initialized, then RMAN creates them as private pipes. If you want to put commands on the input pipe before starting RMAN, be careful to first create the pipe by calling DBMS_PIPE.CREATE_PIPE
. Whenever a pipe is not explicitly created as a private pipe, the first access to the pipe automatically creates it as a public pipe, and RMAN returns an error if it is told to use a public pipe.
Note that the order of steps in the procedure does not have to be exactly as shown in scenario 1. In scenario 2, you put commands into the pipe and then connect to the database.
To use RMAN in pipe mode (scenario 1):
PIPE
option. For example, issue:
% rman PIPE abc TARGET sys/password@some_db
You can also specify the TIMEOUT
option, which forces RMAN to exit automatically if it does not receive any input from the input pipe in the specified number of seconds. For example, enter:
% rman PIPE abc TARGET sys/password@some_db TIMEOUT = 60
RMAN-00572
when it is ready to accept input instead of displaying the standard RMAN prompt.
EXIT
command to force RMAN to terminate. Alternatively, use the TIMEOUT
option, in which case RMAN terminates automatically after not receiving any input for the specified length of time).
To use RMAN in pipe mode (scenario 2):
RMAN-00572
when it is ready to accept input instead of displaying the standard RMAN prompt.
PIPE
option, and specify TIMEOUT =
0
. For example, enter:
% rman PIPE abc TARGET sys/password@some_db TIMEOUT = 0
Oracle9i Supplied PL/SQL Packages and Types Reference for documentation on the
See Also:
DBMS_PIPE
package and "RMAN Pipe Interface" for a brief overview of RMAN pipes
To quit RMAN and terminate the program, type EXIT
or QUIT
at the RMAN prompt. For example:
RMAN> exit
See Also:
Oracle9i Recovery Manager Reference for |
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|