Skip to content
Home » Oracle » Building a Physical Standby Database (02/14) - Prepare configuration files on both sides

Building a Physical Standby Database (02/14) - Prepare configuration files on both sides

Building a Physical Standby Database (01/14) - Install an empty database on standby
There are four configuration files needs to be prepared on both sides, the first three are network-related, the last one is for remote authentication of users with SYSDBA:
  1. /etc/hosts
    1. Register all domain information of four nodes on it, for example:
    2. [root@primary01 ~]# vi /etc/hosts
      #Public
      10.1.1.1    primary01.example.com   primary01
      10.1.1.2    primary02.example.com   primary02
      10.2.1.1    standby01.example.com   standby01
      10.2.1.2    standby02.example.com   standby02

      #Private
      10.1.2.1    primary01-priv.example.com      primary01-priv
      10.1.2.2    primary02-priv.example.com      primary02-priv
      10.2.2.1    standby01-priv.example.com      standby01-priv
      10.2.2.2    standby02-priv.example.com      standby02-priv

      #Virtual
      10.1.1.11   primary01-vip.example.com       primary01-vip
      10.1.1.12   primary02-vip.example.com       primary02-vip
      10.2.1.21   standby01-vip.example.com       standby01-vip
      10.2.1.22   standby02-vip.example.com       standby02-vip

    3. Distribute /etc/hosts to other nodes.
    4. [root@primary01 ~]# scp /etc/hosts primary02:/etc/hosts
      [root@primary01 ~]# scp /etc/hosts standby01:/etc/hosts
      [root@primary01 ~]# scp /etc/hosts standby02:/etc/hosts
  2. tnsnames.ora
    1. Append two entries to the file for the two standby nodes, for example:
    2. [oracle@primary01 ~]$ vi /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
      ...
      standb1 =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = standby01)(PORT = 1521))
          (CONNECT_DATA =
            (SERVER = DEDICATED)
            (SERVICE_NAME = standb.example.com)(UR=A)
          )
        )

      standb2 =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = TCP)(HOST = standby02)(PORT = 1521))
          (CONNECT_DATA =
            (SERVER = DEDICATED)
            (SERVICE_NAME = standb.example.com)(UR=A)
          )
        )

    3. Distribute tnsnames.ora to other nodes.
    4. [oracle@primary01 ~]# scp /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora primary02:/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
      [oracle@primary01 ~]# scp /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora standby01:/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
      [oracle@primary01 ~]# scp /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora standby02:/u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
  3. listener.ora
    1. Append a static listener for DGMGRL and RMAN access.
    2. [oracle@primary01 ~]$ vi /u01/app/11.2.0/grid/network/admin/listener.ora
      ...
      SID_LIST_LISTENER=
        (SID_LIST=
          (SID_DESC=
            (SID_NAME=primdb1)
            (GLOBAL_DBNAME=primdb_DGMGRL.example.com)
            (ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
          )
        )
      ...

    3. Edit listener.ora on other nodes in a similar way.
    4. [oracle@primary02 ~]$ vi /u01/app/11.2.0/grid/network/admin/listener.ora
      ...
      [oracle@standby01 ~]$ vi /u01/app/11.2.0/grid/network/admin/listener.ora
      ...
      [oracle@standby02 ~]$ vi /u01/app/11.2.0/grid/network/admin/listener.ora
      ...
  4. password files
  5. Simply copy the password file from the primary server to standby servers.
    [oracle@primary01 ~]$ scp /u01/app/oracle/product/11.2.0/db_1/dbs/orapwprimdb1 standby01:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwstandb1 [oracle@primary01 ~]$ scp /u01/app/oracle/product/11.2.0/db_1/dbs/orapwprimdb1 standby02:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwstandb2
Building a Physical Standby Database (03/14) - Prepare pfile for both primary and standby database

Leave a Reply

Your email address will not be published. Required fields are marked *