暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

探讨DataGuard中的最大保护模式

原创 张猛 2022-08-27
520

在今天的文章中,我们将讨论有关DataGuard中最大保护模式的问题。

如果选择“最大保护模式”(MaxProtection) 方式的物理备库无法以任何方式访问时,那么主库将无法完成SQL操作。

实践验证。

1、检查Data Guard 的当前配置。

DGMGRL> show configuration
 
Configuration - primary
 
  Protection Mode: MaxProtection
  Members:
  physical - Primary database
    primary  - Physical standby database 
 
Fast-Start Failover: DISABLED
 
Configuration Status:
SUCCESS   (status updated 54 seconds ago)
复制

2、关闭物理备库。

[Primary-01-03-2017 22:22-56] SQL> shu immediate;
ORA-01154: database busy. Open, close, mount, and dismount not allowed now
复制

我们收到此错误的原因是因为保护模式是“最大保护”模式。

3、强制关闭物理备库。

[root@primary ~]# ps -ef | grep ora_smon | grep -v grep
oracle   14514     1  0 16:01 ?        00:00:00 ora_smon_primary
复制
[root@primary ~]# kill -9 14514
复制

4、然后在主库中创建一个新表。

[Physical-01-03-2017 22:22-53] SQL> create table test.locations_yedek as select * from hr.locations;
复制

此时可以看到,数据库没有任何输出并持续等待状态。

5、我们再次打开物理备库。

[oracle@primary ~]$ sqlplus / as sysdba
 
SQL*Plus: Release 12.1.0.2.0 Production on Wed Mar 1 22:26:43 2017
 
Copyright (c) 1982, 2014, Oracle.  All rights reserved.
 
Connected to an idle instance.
 
 
[Primary-01-MAR-17] SQL> startup;
ORACLE instance started.
 
Total System Global Area 3472883712 bytes
Fixed Size                  2930272 bytes
Variable Size             822086048 bytes
Database Buffers         2634022912 bytes
Redo Buffers               13844480 bytes
Database mounted.
Database opened.
复制

一旦物理备库打开到 MOUNT 状态时,就会同步主库中创建的表,同时主库的命令也顺利完成。

6、检查发现"LOCATIONS_YEDEK"表已同时出现在两个数据库中。

主库:

[Physical-01-03-2017 22:27-26] SQL> select table_name from dba_tables where owner='TEST';
 
TABLE_NAME
--------------------------------------------------------------------------------
REGIONS_YEDEK
JOBS_YEDEK
EMPLOYEES_YEDEK
JOBHISTORY_YEDEK
DEPARTMENTS_YEDEK
LOCATIONS_YEDEK
 
6 rows selected.
复制

备库:

[Primary-01-03-2017 22:28-00] SQL> select table_name from dba_tables where owner='TEST';
 
TABLE_NAME
--------------------------------------------------------------------------------
REGIONS_YEDEK
JOBS_YEDEK
EMPLOYEES_YEDEK
JOBHISTORY_YEDEK
DEPARTMENTS_YEDEK
LOCATIONS_YEDEK
 
6 rows selected.
复制
原文标题:Maximum Protection Mode in DataGuard
原文作者:Onur ARDAHANLI  
原文地址:https://dbtut.com/index.php/2022/07/03/maximum-protection-mode-in-dataguard/
复制
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论