CONNECT
The DGMGRL CONNECT command connects you to a database or far sync instance that is a member of a Data Guard broker configuration.
Syntax
CONNECT <username>/<password>[@<connect_identifier>] [AS { SYSDBA | SYSDG }] CONNECT <username>[/@<connect_identifier>] [AS { SYSDBA | SYSDG }] CONNECT /@<connect_identifier> [AS { SYSDBA | SYSDG }] CONNECT / [AS { SYSDBA | SYSDG }] CONNECT
Command Parameters
- username
-
Represents the username with which you want to connect to the configuration member. You will be prompted for a password after you enter a username and optionally, a connect-identifier.
- connect-identifier
-
This parameter is optional. It is an Oracle Net Services connect identifier for the configuration member to which you want to connect. The exact syntax depends upon the Oracle Net Services communications protocol your Oracle installation uses.
Usage Notes
-
The username and password must be valid for the configuration member to which you are trying to connect.
The username you specify must have the
SYSDGorSYSDBAprivilege. -
The
ASclause is optional. If it is specified, then DGMGRL attempts to connect as either SYSDG or SYSDBA, whichever one was specified. If theASclause is not specified, then DGMGRL first attempts anAS SYSDGconnection; if that fails, it then attempts anAS SYSDBAconnection. -
Each time the
CONNECTcommand is run, the broker checks if the default directories containing the client-side broker files exist.- If the
DG_ADMINenvironment variable is defined, and the directory specified in this variable exists with the required permissions, thelog,dat, andcalloutsubdirectories are created under the$DG_ADMIN/config_ConfigurationSimpleNamedirectory. - If the
DG_ADMINenvironment variable is not defined, or the directory specified byDG_ADMINdoes not have the required permissions, then broker does not create any subdirectories.
- If the
-
If the
CONNECTcommand returns an error, check to see that you specified a validconnect-identifier. -
When the
CONNECTcommand is successful, the name of the configuration member to which the connection has been made is shown.
Command Examples
Example 1: Connecting to a Local Configuration Member
This example connects to the default configuration member on the local system.
DGMGRL> CONNECT sysdg;
Password: password
Connected to "North_Sales"
Connected as SYSDG.Example 2: Connecting to a Remote Configuration Member
This example connects to configuration member on the remote system.
DGMGRL> CONNECT sysdg@South_Sales;
Password: password
Connected to "South_Sales"
Connected as SYSDG.Example 3: Connecting Without Showing Connection Credentials
This example connects to a configuration member using CONNECT '/' so that connection credentials are not visible on the command line:
DGMGRL> CONNECT /@North_Sales.example.com; Connected to "North_Sales"
You must set up Oracle Wallet or SSL to use CONNECT '/'. By setting up Oracle Wallet or SSL, you can write a script to securely start and run the observer as a background job without specifying database credentials in the script.