[Инсталляция Oracle Active DataGuard 12.1 в операционной системе Centos 6.7]: Настройка сетевых служб Oracle для создания дупликата primary на standby


Настройка Listener на Primary

$ cd $ORACLE_HOME/network/admin


$ vi listener.ora


LISTENER =
(ADDRESS_LIST=
		(ADDRESS=(PROTOCOL=tcp)(HOST=moscow.localdomain)(PORT=1521))
		(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))

SID_LIST_LISTENER=
			(SID_LIST=
					(SID_DESC=
					(GLOBAL_DBNAME=master)
					(ORACLE_HOME=/u01/oracle/database/12.1)
					(SID_NAME=orcl12)
					)
			)


Настройка Listener на Standby

$ cd $ORACLE_HOME/network/admin


$ vi listener.ora


LISTENER =
(ADDRESS_LIST=
		(ADDRESS=(PROTOCOL=tcp)(HOST=piter.localdomain)(PORT=1521))
		(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))

SID_LIST_LISTENER=
			(SID_LIST=
					(SID_DESC=
					(GLOBAL_DBNAME=slave)
					(ORACLE_HOME=/u01/oracle/database/12.1)
					(SID_NAME=orcl12)
					)
			)


Настройка tnsnames.ora на Primary и Standby

$ vi tnsnames.ora


***

primary =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = moscow.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = master)
    )
  )


standby =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = piter.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = slave)
    )
  )


Проверка работы сетевых служб

$ lsnrctl stop


$ lsnrctl start


$ lsnrctl status

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 15-AUG-2015 15:31:07

Copyright (c) 1991, 2014, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=moscow.localdomain)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date                15-AUG-2015 15:30:08
Uptime                    0 days 0 hr. 0 min. 59 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/oracle/database/12.1/network/admin/listener.ora
Listener Log File         /u01/oracle/diag/tnslsnr/moscow/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=moscow.localdomain)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "master" has 2 instance(s).
  Instance "orcl12", status UNKNOWN, has 1 handler(s) for this service...
  Instance "orcl12", status READY, has 1 handler(s) for this service...
Service "master_DGB" has 1 instance(s).
  Instance "orcl12", status READY, has 1 handler(s) for this service...
Service "orcl12XDB" has 1 instance(s).
  Instance "orcl12", status READY, has 1 handler(s) for this service...
The command completed successfully

Нужно, чтобы поднялся сервис master и slave на каждом из серверов. Стартуют не сразу. Иногда нужно минут 5 подождать.


С обоих серверов должен проходить tnsping:

$ tnsping primary
$ tnsping standby

Должно быть OK.