Validate and Configure Data Guard Broker

Verify connectivity between the Oracle Database Exadata Cloud Service and the on-premises Oracle Exadata Database Machine through Netcat tnsping and ping.

The Oracle Data Guard broker is a distributed management framework that automates and centralizes the creation, maintenance, and monitoring of Data Guard configurations.

You can perform all management operations locally or remotely through the broker's easy-to-use interfaces: the Data Guard management pages in Oracle Enterprise Manager, which is the broker's graphical user interface (GUI), and the Data Guard command-line interface called DGMGRL.

Connect the Source and Standby Exadata Systems

Connect the source and standby Exadata systems with an Oracle Data Guard broker configuration and verify the connectivity both directions using NetCat, TNS Ping Utility, and Ping.

The steps outlined assume that the on-premises primary database is not already part of an existing Data Guard broker configuration.

  1. Determine if the on-premises primary database is already part of an existing Data Guard broker configuration.
    SQL> select decode(count(1),0,'NOCONFIG') from v$DG_BROKER_CONFIG;
    A value other than ‘NOCONFIG’ implies an existing broker configuration. If there is an existing broker configuration for the on-premises database, then it is assumed that the administrator has prior knowledge of the broker and knows how to add the new standby database to the existing broker configuration.

    If there is not an existing broker configuration, then complete the following steps.

  2. Verify the default listener is named LISTENER.
    $lsnrctl show current_listener | grep Current Listener

    The output should look similar to the following:

    Current Listener is LISTENER
  3. Verify the listener port by running the following command from the on-premises machine. The expected result is shown.
    [oracle@exa11db01 bin]$ ./lsnrctl status | grep 'Connecting'

    The output should look similar to the following:

    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=10.136.74.2)(PORT=1521))
  4. On the on-premises Oracle Exadata Database Machine, use NetCat to connect to the standby Oracle Database Exadata Cloud Service to validate connectivity
    [oracle@exa11db01 bin]$ nc -v 10.255.195.131 1521

    The output should look similar to the following:

    Ncat: Version 7.50 (https://nmap.org/ncat )
    Ncat: Connected to 10.255.195.131:1521.
  5. On the on-premises Oracle Exadata Database Machine, use the TNS Ping Utility for Linux to connect to the standby Oracle Database Exadata Cloud Service to validate connectivity
    [oracle@exa11db01 bin]$ tnsping DB1_phx3g7

    The output should look similar to the following:

    TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 23-JAN-2021 
    19:46:55
    Copyright (c) 1997, 2020, Oracle.  All rights reserved.
    Used parameter files:
    /u01/app/oracle/product/19.0.0.0/dbhome_1/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (SDU=65536) (RECV_BUF_SIZE=134217728) 
    (SEND_BUF_SIZE=134217728) (ADDRESS_LIST = (FAILOVER=on) 
    (CONNECT_TIMEOUT=3)(RETRY_COUNT=3) (ADDRESS = (PROTOCOL = TCP)(HOST 
    =10.255.195.131)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) 
    (SERVICE_NAME = db11) (UR=A)))
    OK (40 msec)
  6. On the on-premises Oracle Exadata Database Machine, ping the standby Oracle Database Exadata Cloud Service to validate connectivity
    [oracle@exa11db01 bin]$ ping 10.255.195.131

    The output should look similar to the following:

    PING 10.255.195.131 (10.255.195.131) 56(84) bytes of data.
    64 bytes from 10.255.195.131: icmp_seq=1 ttl=60 time=19.7 ms
    64 bytes from 10.255.195.131: icmp_seq=2 ttl=60 time=19.6 ms
    64 bytes from 10.255.195.131: icmp_seq=3 ttl=60 time=19.5 ms
    ^C
    --- 10.255.195.131 ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 2003ms
    rtt min/avg/max/mdev = 19.521/19.633/19.718/0.141 ms
  7. On the Oracle Database Exadata Cloud Service, use NetCat to connect to the on-premises Oracle Exadata Database Machine to validate connectivity.
    [oracle@exacs82-vm3sv1 ~]$ nc -v 10.136.74.2

    The output should look similar to the following:

    -bash: nc: command not found
  8. On the Oracle Database Exadata Cloud Service, use the TNS Ping Utility for Linux to connect to the on-premises Oracle Exadata Database Machine to validate connectivity
    [oracle@exacs82-vm3sv1 ~]$ tnsping db1

    The output should look similar to the following:

    TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 23-JAN-2021 
    19:53:02
    Copyright (c) 1997, 2020, Oracle.  All rights reserved.
    Used parameter files:
    /u02/app/oracle/product/19.0.0.0/dbhome_5/network/admin/DB1/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (SDU=65536) (RECV_BUF_SIZE=134217728) 
    (SEND_BUF_SIZE=134217728) (ADDRESS_LIST = (FAILOVER=on) 
    (CONNECT_TIMEOUT=3)(RETRY_COUNT=3) (ADDRESS = (PROTOCOL = TCP)(HOST = 
    10.136.74.2)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = 
    db11) (UR=A)))
    OK (40 msec)
  9. On the Oracle Database Exadata Cloud Service, ping the on-premises Oracle Exadata Database Machine to validate connectivity
    [oracle@exacs82-vm3sv1 ~]$ ping 10.136.74.2

    The output should look similar to the following:

    PING 10.136.74.2 (10.136.74.2) 56(84) bytes of data.
    64 bytes from 10.136.74.2: icmp_seq=1 ttl=60 time=18.6 ms
    64 bytes from 10.136.74.2: icmp_seq=2 ttl=60 time=18.6 ms
    64 bytes from 10.136.74.2: icmp_seq=3 ttl=60 time=18.5 ms
    64 bytes from 10.136.74.2: icmp_seq=4 ttl=60 time=18.4 ms
    ^C
    --- 10.136.74.2 ping statistics ---
    4 packets transmitted, 4 received, 0% packet loss, time 3003ms
    rtt min/avg/max/mdev = 18.442/18.574/18.665/0.162 ms

Remove Data Files From the Standby Exadata Instance

Run a script to remove the data files from the standby database.

  1. Log into your Oracle Database Exadata Cloud Service instance.
  2. Create a script to remove the data files.
    SQL> set heading off linesize 999 pagesize 0 feedback off trimspool on
    SQL> spool /tmp/files.lst
    SQL> select 'asmcmd rm '||name from v$datafile union all select 'asmcmd rm 
    '||name from v$tempfile union all select 'asmcmd rm '||member from 
    v$logfile;
    SQL> spool off
    SQL> create pfile='/tmp/ ORACLE_UNQNAME.pfile' from spfile;         
    SQL> exit
  3. Shut down the database on the Oracle Database Exadata Cloud Service instance.
    srvctl stop database -d DB1_phx3g7
  4. Remove the data files by editing the files.1st file and removing the following lines:
    SQL> select 'asmcmd rm '||name from v$datafile union all select 'asmcmd rm 
    '||name from v$tempfile union all select 'asmcmd rm '||member from 
    v$logfile;
    SQL> spool off
  5. Change the file permissions to be readable, writable and executable by all users.
    chmod 777 /tmp/files.1st
  6. Save and execute the script.
    ./tmp/files.lst
All files for the starter database are removed.

Copy the Password Files

Locate the Password file on the on-premises Exadata system and copy the file to the Oracle Database Exadata Cloud Service instance. The Password file on the on-premises Exadata system is located on the Oracle Automatic Storage Management (Oracle ASM) disk.

  1. Check the current configuration of the on-premises database and display the output.
    srvctl config database -d db1
    The output includes the Password file.
  2. Edit the oratab file and add Oracle ASM to it.
    vi /etc/oratab 
    db11:/u01/app/oracle/product/19.0.0.0/dbhome
    _1:N
    +ASM1:/u01/app/19.0.0.0/grid:N
  3. Use the Oracle ASM command-line utility and get the Password file.
    asmcmd pwget --dbuniquename db1
    The output includes the Password file.
  4. Log into the Oracle ASM command-line utility, then use the command pwcopy to copy the Password file to the local disk.
    The output includes the Password file.
  5. Use the command ls -lrt to confirm that the file is copied to the local disk.
  6. Use the SCP network protocol to save the password file to the Oracle Database Exadata Cloud Service instance.
    scp -i Key.ssh -r pwddb1 opc@10.255.195.131:/tmp/pwddb1
  7. Log into the Oracle Database Exadata Cloud Service instance as opc user and change the mode to 777 for the password file.
    chmod 777 /tmp/pwddb1
  8. Log into the Oracle Database Exadata Cloud Service instance as su -oracle user and display the directories.
    sudo su - oracle
    ls -lrt
    source DB1.env
  9. Using the Oracle ASM command-line utility, copy the file from the tmp folder to $ORACLE_HOME/dbs where you want the password file to reside.
    ASMCMD> pwcopy --dbuniquename DB1_phx3g7 /tmp/pwddb1 +DATAC1/DB1_phx3g7/PASSWORD/passwd
    An error message similar to the following will appear. This is expected because the password is already registered.
    ASMCMD-9453: failed to register password file as a CRS resource
    copying /u02/app/oracle/product/19.0.0.0/dbhome_5/dbs/pwddb1 -> +DATAC1/DB1_phx3g7/PASSWORD/passwd
    ASMCMD-9453: failed to register password file as a CRS resource
  10. Using the Oracle ASM command-line utility, verify that the password file is copied.
    ls -al