Oracle Active Data Guard(ADG)配置注意事项

一、概述

Oracle Active Data Guard(ADG)是Oracle数据库的一项高可用性和灾备解决方案。它是Oracle Data Guard的一个组件,旨在提供实时的数据保护和灾备功能。Active Data Guard建立在Oracle Data Guard技术之上,它允许在主数据库和一个或多个辅助数据库之间实时复制数据。与传统的灾备解决方案不同,Active Data Guard允许辅助数据库在读取模式下打开,从而提供了更大的灵活性和可用性。

最新一个项目,部署了ADG,中间遇到了一些坑。特地作一下记录,以备查询。

二、注意事项

2.1 sys密码

主备之间的sys密码一定要相同,最可靠的方法就是主库的sys密码文件,拷贝一份至备库

主库修改sys的密码的方法:

方法一:

alter user sys identified by Sys;

方法二:

[oracle@rac1 ~]$ cd $ORACLE_HOME/dbs
[oracle@rac1 dbs]$ pwd
/u01/app/oracle/product/11.2.0/db_1/dbs
[oracle@rac1 dbs]$ orapwd file=orapwapac password=sys force=y
[oracle@rac1 dbs]$ ls -ltr orapwapac
-rw-r----- 1 oracle oinstall 1536 Jul 25 18:21 orapwapac
[oracle@rac1 dbs]$

注意:

密码文件格式:orapw+sid,如orapwapac

如果sys密码不对,会报如下错误:

ARC2: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC2: Becoming the heartbeat ARCH
ARC2: Becoming the active heartbeat ARCH
ARC3: Archival started
Error 1017 received logging on to the standby
FAL[client, ARC2]: Error 16191 connecting to srmwl for fetching gap sequence
Attempt to start background Managed Standby Recovery process
MRP0: Background Managed Standby Recovery process started
Managed Standby Recovery not using Real Time Apply
Media Recovery Waiting for thread 1 sequence 51828
Error 1017 received logging on to the standby
FAL[client, USER]: Error 16191 connecting to srmwl for fetching gap sequence

15 rows selected.

 

 

2.2 备库的监听文件listener.ora 

备库的监听一定要是静态,静态,静态,重要的事件说三遍。

[oracle@oa_new_db admin]$ cat listener.ora,添加如下配置:

 

SID_LIST_LISTENER =  
(SID_LIST =  
  (SID_DESC =  
  (GLOBAL_DBNAME = orcl)
  (SID_NAME = orcl)
  )
)

注:GLOBAL_DBNAME和SID_NAME,根据实际情况,改成实际值即可。

2.3 主备库的tnsname.ora

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.3.0.122)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

ORCL_DG =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.3.0.163)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)(UR = A)
)
)

注意:备库要添加选项(UR=A)

2.4 主备验证连通性

主备节点上执行,如果都能正常连通,说明正常。

sqlplus sys/Sys@orcl as sysdba
sqlplus sys/Sys@orcl_dg as sysdba

 

2.5 创建备库(主库上执行)

[oracle@rac1 ~]$rman target sys/Sys@orcl auxiliary sys/Sys@orcl_dg


RMAN> duplicate target database for standby from active database nofilenamecheck;

 

 
posted @ 2023-10-18 21:57  雪竹子  阅读(458)  评论(0编辑  收藏  举报