Connecting to RMAN

Connecting to the Target Database Without a Catalog from the Command Line

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/oracle@trgt 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/oracle@trgt 
 
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

Connecting to the Target Database Without a Catalog from the RMAN Prompt

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/oracle@trgt 
 
 

Connecting to the Target Database and Recovery Catalog from the Command Line

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@catdb # Oracle Net authentication % rman TARGET SYS/oracle@trgt CATALOG rman/cat@catdb

Connecting to the Target Database and Recovery Catalog from the RMAN Prompt

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@catdb

This example uses Oracle Net authentication:
% rman
RMAN> CONNECT TARGET SYS/oracle@trgt 
RMAN> CONNECT CATALOG rman/cat@catdb 
 
 

Connecting to a Target Database in an Oracle Real Application Cluster

RMAN can only connect to one instance in an Oracle Real Application Clusters database at a time. Assume that trgt1, trgt2, and trgt3 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/oracle@trgt2 CATALOG rman/cat@catdb
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/oracle@trgt1'; CONFIGURE CHANNEL 2 DEVICE TYPE sbt CONNECT = 'SYS/oracle@trgt2'; CONFIGURE CHANNEL 3 DEVICE TYPE sbt CONNECT = 'SYS/oracle@trgt3';
Then, make a whole database backup by running the following command:
BACKUP DATABASE;

---------------------------------------------------------------------------------------------------------------

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.

Connecting to an Auxiliary Database from the Command Line

To connect to an auxiliary instance from the operating system command line, enter the following:
% rman AUXILIARY SYS/aux@auxdb

To connect to the target, auxiliary, and recovery catalog databases, issue the following (all on one line):
% rman TARGET SYS/oracle@trgt CATALOG rman/cat@catdb AUXILIARY SYS/aux@auxdb 
 

Connecting to an Auxiliary Database from the RMAN Prompt

Alternatively, you can start RMAN and connect to the auxiliary database from the RMAN prompt:
% rman RMAN> CONNECT AUXILIARY SYS/aux@auxdb
To connect to the target, auxiliary, and recovery catalog databases, issue:
% rman RMAN> CONNECT TARGET SYS/oracle@trgt RMAN> CONNECT CATALOG rman/cat@catdb RMAN> CONNECT AUXILIARY SYS/aux@auxdb

Hiding Passwords When Connecting to Databases

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:
  • Run the CONNECT commands at the RMAN prompt. If the password is not provided in the connect string, then RMAN prompts for the password.
  • Run a command file at the RMAN prompt that contains the connection information. You can set the read privileges on the command file to prevent unauthorized access.
For example, if you are running RMAN in an UNIX environment, then you can use the following procedure:
  1. Start RMAN without connecting to any databases:
    % rman
    
    
  2. Place the connection information in a text file. For example, place the following lines in a file called connect.rman:
    CONNECT TARGET SYS/oracle@trgt 
    CONNECT CATALOG rman/cat@catdb
    
    
  3. Change the permissions on the connect script so that everyone can execute the script but only the desired users have read access. For example, enter:
    % chmod 711 connect.rman
    
    
    
  4. Run the script from the RMAN prompt to connect to the target and catalog databases. For example:
    RMAN> @connect.rman
    

 

 

 

 

No comments:

Post a Comment