centos 7.5搭建oracle DG

一.背景

1.IP分配
主库:192.168.12.5 node1
备库:192.168.12.6 node2

2.环境
主库已安装数据库软件,已建库,并有业务数据
备库已安装数据库软件,未建库

 

二、配置主备库网络

1.主库监听:
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.5)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

2.主库网络服务:
ORADB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.5)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oradb)
    )
  )

ORADBSTD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.6)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oradbstd)
    )
  )

3.备库监听:
LISTENER=
  (DESCRIPTION=
      (ADDRESS_LIST=
           (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.12.6)(PORT=1521))
      )
  )

4.备库网络服务:
ORADB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.5)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oradb)
    )
  )

ORADBSTD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.6)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oradbstd)
    )
  )

5.测试主备网络:
主库:
[oracle@node1 admin]$ tnsping oradb

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 25-JUL-2020 00:08:29

copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.5)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oradb)))
OK (0 msec)
[oracle@node1 admin]$ tnsping oradbstd

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 25-JUL-2020 00:08:31

copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.6)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oradbstd)))
OK (0 msec)

备库:
[oracle@node2 admin]$ tnsping oradb

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 25-JUL-2020 00:12:22

copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.5)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oradb)))
OK (0 msec)
[oracle@node2 admin]$ tnsping oradbstd

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 25-JUL-2020 00:12:28

copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.12.6)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = oradbstd)))
OK (0 msec)

全部都为OK,主备网络配置完成。

  

三、主库开启归档模式,开启force logging

sql> alter database archivelog;

Database altered.

sql> alter database force logging;

Database altered.

sql> alter database open;

Database altered.

  

四、主库添加

主库生成文本参数文件,并修改参数

 

相关文章

Centos下搭建性能监控Spotlight
CentOS 6.3下Strongswan搭建IPSec VPN
在CentOS6.5上安装Skype与QQ
阿里云基于centos6.5主机VPN配置
CentOS 6.3下配置multipah
CentOS安装、配置APR和tomcat-native