Time for action – connecting to Data Guard broker

You can connect the DGMGRL interface locally by specifying only the username with the password, or just using / if OS authentication is possible. If you are connecting from a remote machine, you must use Oracle Net Services name to connect the Data Guard broker. Use the following steps to see some examples of broker connections:

  1. To connect from either a primary or a standby database server with OS authentication enabled, you can connect using / as follows:
    [oracle@oracle-primary ~]$ dgmgrl /
    DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production
    Copyright (c) 2000, 2009, Oracle. All rights reserved.
    Welcome to DGMGRL, type "help" for information.
    Connected.
    DGMGRL>
    
  2. In order to connect to the broker CLI database, authentication is required. Add the following line to the sqlnet.ora file to gain authentication:
    [oracle@oracle-primary admin]$ cat sqlnet.ora|grep SQLNET
    SQLNET.AUTHENTICATION_SERVICES = (NONE)
    
  3. Connecting with OS authentication will not be possible as shown in the following command line:
    [oracle@oracle-primary]$ dgmgrl /
    DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production
    Copyright (c) 2000, 2009, Oracle. All rights reserved.
    Welcome to DGMGRL, type "help" for information.
    ORA-01031: insufficient privileges
    
  4. Connect using database user SYS login credentials as follows:
    [oracle@oracle-primary]$ dgmgrl sys/free2go
    DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production
    Copyright (c) 2000, 2009, Oracle. All rights reserved.
    Welcome to DGMGRL, type "help" for information.
    Connected.
    
  5. Try connecting it from the primary to the standby database, and vice versa, using the Oracle Net Services name as follows:
    [oracle@oracle-stby ~]$ dgmgrl sys/free2go@turkey
    DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production
    Copyright (c) 2000, 2009, Oracle. All rights reserved.
    Welcome to DGMGRL, type "help" for information.
    Connected.
    
  6. You can also include DGMGRL commands in the connection string. The following command will connect to the broker and show us the output of the show database 'turkey_un' statement:
    [oracle@oracle-primary ~]$ dgmgrl sys/free2go "show database 'turkey_un'"
    DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production
    Copyright (c) 2000, 2009, Oracle. All rights reserved.
    Welcome to DGMGRL, type "help" for information.
    Connected.
    Database - turkey_un
      Role:            PRIMARY
      Intended State:  TRANSPORT-ON
      Instance(s):
        TURKEY
    Database Status:
    SUCCESS
    
  7. When the SILENT keyword is used, it will suppress the introduction lines of DGMGR as follows:
    [oracle@oracle-primary]$ dgmgrl -silent sys/free2go@turkey  "show configuration verbose"
    Configuration - PACKT
      Protection Mode: MaxPerformance
      Databases:
        turkey_un - Primary database
        INDIA_UN  - Physical standby database
    Fast-Start Failover: DISABLED
    Configuration Status:
    SUCCESS
    
  8. Exit the broker command-line interface with the EXIT command as follows:
    DGMGRL> exit
    [oracle@oracle-primary ~]$
    

What just happened?

We have seen how to connect to the command line utility DGMGRL using different approaches, after the configuration of the Data Guard broker.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.164.143