一、前言 随着Oracle ADG技术的逐渐成熟,大多数数据库环境都使用ADG作为灾备和报表数据库,可以说是标配。
那么如果主数据库由于BUG或者维护,需要更新补丁,该如何去操作呢? 本文参考MOS文档:How do you apply a Patchset,PSU or CPU in a Data Guard Physical Standby configuration (Doc ID 278641.1) 环境准备:
##如果已配置DG Broker
dgmgrl sys/oracle@orcl
edit database orcl set state='LOG-TRANSPORT-OFF';
##未配置DG Broker
SQL> alter system set log_archive_dest_state_2=defer scope=both sid='*';
##已配置DG Broker,打开apply-on
edit database orcl_stby set state='ONLINE';
##备库开启到read only,开启ADG
alter database open;
6.执行检查,确保补丁安装成功。 主库:
opatch lspatches
select action_time,action,version,id,bundle_series,comments from dba_registry_history;
备库:
opatch lspatches
select action_time,action,version,id,bundle_series,comments from dba_registry_history;
检查ADG同步情况:
##已配置DG Broker
show database orcl
show database orcl_stby
##未配置DG Broker
select process,group#,thread#,sequence# from v$managed_standby;
select group#,thread#,sequence#,bytes/1024/1024,archived,status from v$standby_log;