Databases Reference
In-Depth Information
These are the same conditions that need to be in place before connecting to your database and that are described
in Recipe 2-1. If you haven't already done so, review Recipe 2-1 and ensure that you have the proper OS variables set
and that you have access to a privileged database user.
You can connect to RMAN either through the operating system command-line interface or through Enterprise
Manager (EM). Using EM for backup and recovery is covered in Chapter 19 of this topic. This chapter uses the
command-line interface for its examples.
■
even if you use the screen based enterprise Manager tool, it's useful to understand the RMAN commands used for
backup and recovery operations. This knowledge can be particularly useful when debugging and troubleshooting problems.
Tip
The following example assumes you have logged on to a Linux/Unix server using the
oracle
operating system account
assigned to a privileged group, such as
dba
. You can then invoke RMAN and connect to the target database as follows:
$ rman target /
Here is a snippet of the output:
connected to target database: O12C (DBID=3412777350)
If you're using a password file, then you need to specify the username and password that have been granted
proper system privileges:
$ rman target <user>/<password>
If you're accessing your target database remotely via Oracle Net, you will need a password file on the target server
and will also need to specify a connection string as follows:
$ rman target <user with sys* priv>/<password>@<database connection string>
You can also invoke RMAN and then connect to your target database as a second step, from the RMAN prompt:
$ rman
RMAN> connect target /
To exit RMAN, enter the
exit
command as follows:
RMAN> exit
■
On Linux systems, when typing in the
rman
command from the OS prompt, if you get an error, such as “rman: can't
open target,” make sure your pATh variable includes ORACLe_hOMe/bin directory before the /usr/X11R6/bin directory.
Tip
How It Works
Before you can connect to RMAN, you need to ensure that you have the proper OS variables set and that you have
access to an account with
sys*
privileges. Once those are in place, you can start RMAN and connect to your target
database via the
rman
command-line utility.