Configure the Connections

Configure the static listener, redo transport, and TCP socket size connections for the on-premises and Oracle Cloud Infrastructure (OCI) instances.

Configure the Static Listeners

Configure the static listener files in the on-premises and Oracle Cloud Infrastructure (OCI) instances. A static listener is required for the initial instantiation of the standby database. When a database is down, a static listener enables a remote connection to an instance, enabling you to use Oracle Data Guard to start the instance.

Do not have any line breaks or white spaces in the listener.ora files.
  1. There should be a default listener on the primary on-premises database, do not change the default listener.
  2. On the primary database, append the SID_LIST_LISTENER file to include the database unique name, Oracle Home, and the Oracle System Identifier (SID) of the primary database.
    SID_LIST_LISTENER = 
    		(SID_LIST = (SID_DESC = 
    (GLOBAL_DBNAME = DB_UNIQUE_NAME of the primary database) (ORACLE_HOME = Local Oracle Home of the primary database) 
    				(SID_NAME = ORACLE SID of the primary database) 
    		))
  3. There should be a default listener on the standby database in OCI, do not change the default listener.
  4. On the standby database in OCI, append the SID_LIST_LISTENER file to include the database unique name, Oracle Home of OCI, and the Oracle System Identifier (SID) of the primary database.
    SID_LIST_LISTENER = 
    		(SID_LIST = (SID_DESC = 
    (GLOBAL_DBNAME = DB_UNIQUE_NAME of the primary database) (ORACLE_HOME = Local Oracle Home of OCI) 
    				(SID_NAME = ORACLE SID of the primary database) 
    		))

Configure for Redo Transport

Configure Oracle Net Encryption and TNS Entries for redo transport to protect unencrypted tablespaces from being visible on the network. Entries for each database are needed in both the primary and standby tnsnames.ora files for proper redo transport.

IP addresses are used since there is no DNS between on-premises and cloud environments to resolve server names to IP addresses. Use the following example, replacing values relevant to the configuration.

Oracle Real Application Clusters (Oracle RAC) configurations cannot resolve the scan listener name; therefore, you must use an address list to define all nodes. Those will be added later, the initial instance should only list one IP address in the tns entries to ensure that Oracle Recovery Manager (RMAN) is always connecting to the same nodes.

  1. For Oracle Cloud Infrastructure (OCI) instances, place the following entries in the sqlnet.ora file on all cloud machines that are located in the $ORACLE_HOME/network/admin directory.
    SQLNET.ENCRYPTION_SERVER=REQUIRED 
    SQLNET.CRYPTO_CHECKSUM_SERVER=REQUIRED 
    SQLNET.ENCRYPTION_TYPES_SERVER=(AES256,AES192,AES128) 
    SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER=(SHA1) 
    SQLNET.ENCRYPTION_CLIENT=REQUIRED 
    SQLNET.CRYPTO_CHECKSUM_CLIENT=REQUIRED 
    SQLNET.ENCRYPTION_TYPES_CLIENT=(AES256,AES192,AES128) 
    SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT=(SHA1)
  2. For the OCI instance, change the tnsnames.ora file.
    Ensure that you do not have any line breaks or white spaces in the tnsnames.ora file.
    Standby_db_unique_name = (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 = StandbyDB_IP_address)(PORT = 1521)) 
    ) 
    (CONNECT_DATA = 
    (SERVER = DEDICATED) 
    (SERVICE_NAME = Primary_db_SID) 
    (UR=A) 
    )) 
    
    Primary_db_unique_name = (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 = Primary_DB_IP_ address)(PORT = 1521)) 
    ) 
    (CONNECT_DATA = 
    (SERVER = DEDICATED) 
    (SERVICE_NAME = Primary_db_SID) 
    (UR=A) 
    ))
  3. For on-premises, place the following entries in the sqlnet.ora file on all on-premises machines that are located in the $ORACLE_HOME/network/admin directory.
    SQLNET.ENCRYPTION_SERVER=REQUIRED 
    SQLNET.CRYPTO_CHECKSUM_SERVER=REQUIRED 
    SQLNET.ENCRYPTION_TYPES_SERVER=(AES256,AES192,AES128) 
    SQLNET.CRYPTO_CHECKSUM_TYPES_SERVER=(SHA1) 
    SQLNET.ENCRYPTION_CLIENT=REQUIRED 
    SQLNET.CRYPTO_CHECKSUM_CLIENT=REQUIRED 
    SQLNET.ENCRYPTION_TYPES_CLIENT=(AES256,AES192,AES128) 
    SQLNET.CRYPTO_CHECKSUM_TYPES_CLIENT=(SHA1) 
    
  4. For the primary, on-premises database host, change the tnsnames.ora file.
    The primary database may already have a TNS entry in the on-premises tnsnames.ora with a server name for the HOST. In this case, change the server name in the entry to use the IP address for the host.
    Ensure that you do not have any line breaks or white spaces in the tnsnames.ora file.
    Primary_db_unique_name = (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 = PrimaryDB_IP_address)(PORT = 1521)) 
    ) 
    (CONNECT_DATA = 
    (SERVER = DEDICATED) 
    (SERVICE_NAME = Primary_db_SID ) 
    (UR=A) 
    )) 
    
    Standby_db_unique_name = (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 = StandbyDB_IP_address)(PORT = 1521)) 
    ) 
    (CONNECT_DATA = 
    (SERVER = DEDICATED) 
    (SERVICE_NAME = Primary_db_SID ) 
    (UR=A) 
    ))

Start the Listeners

Start the SID_LIST_LISTENER in the standby database in Oracle Cloud Infrastructure (OCI) and the primary, on-premises database.

  1. Start the listener on the primary database.
    $ORACLE_HOME/bin/lsnrctl reload
  2. Verify the listener status on the primary database.
    [oracle@primary_host admin]$ lsnrctl status
  3. Start the listener on the OCI database instance.
    $ORACLE_HOME/bin/lsnrctl reload
  4. Verify the listener status on the OCI database instance.
    [oracle@OCI_database_instance admin]$ lsnrctl status

Start the Standby Database

Start the standby database on Oracle Cloud Infrastructure.

Start the standby database by using either the Server Control utility or SQL*Plus.
  • Use the Server Control (srvctl) utility to start the database:
    srvctl start instance -d standby DB_UNIQUE_NAME -i standby instance name -o mount
  • Use SQL*Plus to start the database:
    $ ./sqlplus / as sysdba
    SQL> startup mount;

Set the TCP Socket Size

Set the TCP socket size to a maximum of 128MB for the on-premises system and the cloud instance for optimal transport performance. If the values between the on-premises and cloud instances don't match, the network protocol will negotiate the lower of the two values.

  1. As a root user, check the TCP socket size for the on-premises system.
    /sbin/sysctl -a | egrep net.core.[w,r]mem_max
    The output will look similar to the following:
    net.core.rmem_max = 4194304 net.core.wmem_max = 1048576
  2. As a root user, check the TCP socket size for the cloud instance.
    /sbin/sysctl -a | egrep net.core.[w,r]mem_max
    The output will look similar to the following:
    net.core.rmem_max = 134217728
    net.core.wmem_max = 134217728
  3. If the TCP socket size of your cloud instance is not 134217728, edit the /etc/sysctl.conf file settings for net.core.wmem_max and net.core.rmem_max to 134217728.