Oracle Active Data Guard is a new option with Oracle 11g.
Oracle Active Data Guard enables read-only access to a physical standby database for queries, sorting, reporting, Web-based access, and so on, while continuously applying changes received from the production database.
In older versions of Oracle Data Guard, you were able to open your standby database in read-only mode, but the database was not able to receive the redo from the production DB.
For some applications Active Data Guard can represent a more efficient use of Oracle licenses on the standby database. Active Data Guard is available on Enterprise Edition only and is cost option which must be licensed on both the primary and standby database.
Before you perform these actions, a Data Guard Broker configuration should be already configured. If you need to configure Data Guard Broker, GO HERE.
Enable Active Data Guard using DG Broker
Connect to DG Broker and disable the MRP Process
$ dgmgrl
DGMGRL> connect sys
DGMGRL> show configuration
DGMGRL> edit database 'STDBY' set state = 'apply-off';
DGMGRL> show configuration
Open the physical standby database in read-only mode
sqlplus> alter database open read only;
Connect to DG Broker again and enable the MRP Process
$ dgmgrl
DGMGRL> connect sys
DGMGRL> edit database 'STDBY' set state = 'apply-on';
DGMGRL> show configuration
Now you can perform any Read Operation on the Standby!!!
As you can see, this process is very simple, you just type a few commands, re-start your DB and you are ready to test this amazing feature!!!
Redo data will continue to be received and applied by the database while it is operating in read only mode.
If you perform any DDL and DML operation in PROD, you will see those operations also reflected on the Standby. As an example you can insert some data into a table in PROD and that row will be also inserted in the Standby.
To determine whether a standby database is using Active Data Guard use the following query:
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLE OPEN_MODE
-------------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY
Disable Active Data Guard using DG Broker
Connect to DG Broker and disable the MRP Process
$ dgmgrl
DGMGRL> connect sys
DGMGRL> show configuration
DGMGRL> edit database 'STDBY' set state = 'apply-off';
DGMGRL> show configuration
Shutdown the physical standby database
sqlplus> shutdown immediate;
sqlplus> startup mount;
Connect to DG Broker again and enable the MRP Process
$ dgmgrl
DGMGRL> connect sys
DGMGRL> edit database 'STDBY' set state = 'apply-on';
DGMGRL> show configuration
Now you Physical standby will be performing as usual
Enable Active Data Guard using SQL*Plus
We need to mention that the preferred method to Enable the Active Data Guard is by using the Broker.
As you can see, this process is very simple, you just type a few commands, re-start your DB and you are ready to test this amazing feature!!!
Redo data will continue to be received and applied by the database while it is operating in read only mode.
Connect to the physical standby, cancel the managed standby recovery, then open it in read only mode. After that enable again the managed recovery process
sqlplus> alter database recover managed standby database cancel
sqlplus> alter database open read only;
sqlplus> alter database recover managed standby database using current logfile disconnect;
Now the standby has been placed in managed recovery mode applying the log files while it is open.
Now you can perform any Read Operation on the Standby
If you perform any DDL and DML operation in PROD, you will see those operations also reflected on the Standby.
Confirm, changes applying on standby database
On the primary create any table, do a log switch and check the maximum log sequence number:
SQL> create table test (cd number);
SQL> alter system switch logfile;
SQL> select max(Sequence#) from v$log;
Connect to the Standby and also check the maximum log sequence number and the existence of that table:
SQL> select max(Sequence#) from v$log;
SQL> describe test;
Disable Active Data Guard using SQL*Plus
Connect to the physical standby and shut it down
sqlplus> shutdown immediate
Then Startup and mount it.
sqlplus> startup mount;
sqlplus> alter database recover managed standby database using current logfile disconnect;
Now you Physical standby will be performing as usual
Checking Different Scenarios
If you start a database in SQL*Plus using the STARTUP command and then invoke managed recovery, the Active Data Guard will be enabled.
For example:
SQL> STARTUP
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLE OPEN_MODE
-------------------- --------------------
PHYSICAL STANDBY READ ONLY
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE disconnect;
SQL> SELECT database_role, open_mode FROM v$database;
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLE OPEN_MODE
-------------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY
However, if the database is started in SQL*Plus using the STARTUP MOUNT command and then managed recovery is invoked, Active Data Guard will not be enabled.
SQL> STARTUP MOUNT
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLE OPEN_MODE
-------------------- --------------------
PHYSICAL STANDBY MOUNTED
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE disconnect;
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLE OPEN_MODE
-------------------- --------------------
PHYSICAL STANDBY MOUNTED
If the database has been started in SQL*Plus using STARTUP MOUNT and the database is subsequently opened read only, then invoking managed recovery will enable Active Data Guard.
For example:
SQL> STARTUP MOUNT
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLE OPEN_MODE
-------------------- --------------------
PHYSICAL STANDBY MOUNTED
SQL> ALTER DATABASE OPEN READ ONLY;
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLE OPEN_MODE
-------------------- --------------------
PHYSICAL STANDBY READ ONLY
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE disconnect;
SQL> SELECT database_role, open_mode FROM v$database;
DATABASE_ROLE OPEN_MODE
-------------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY
参考至:http://pafumi.net/Active_Data_Guard.html
如有错误,欢迎指正
邮箱:czmcj@163.com
相关推荐
官方资料:Oracle Active Data Guard新特性_白皮书主要特性:•全面的Oracle感知数据库保护 •独特的损坏桧测和自动修复•手动或自动地快速故陣切换到同步生产 副本•将生产负载分流到以只读方式打开的 問步备用...
ORACLE ACTIVE DATA GUARD技术白皮书.docx
大牛出手,全是干货,Oracle 11gR2使用Active Data Guard 搭建物理 Data Guard。 注:文档打开密码见压缩包注释 看不到注释的 文档打开密码 tianlesoftware
同一台主机部署Oracle 11g物理Active Data Guard详细过程
本专题讲座将介绍如何使用 Oracle Active Data Guard 的 Oracle Data Guard 特性将执行许多不同类型系统和数据库计划维护的流程以滚动方式实现自动化。这可以为 Oracle Active Data Guard 配置中的只读用户实现零...
在一台主机上实现部署Oracle 11g物理Active Data Guard的过程
ORACLE19c中的Active Data Guard的使用.pdf
使用Oracle Active Data Guard实现PMS2.0数据库读写分离初探.pdf
Active Data Guard是一个简单的高性能解决方案,可以维护用于从生产数据库中卸载资源密集型查询、报告和备份操作的最新副本。
诗檀软件-基于Oracle 12c Far Sync+Active Data Guard ADG的灾备两地三中心搭建手册】.pdf
客户的Oracle 11gR2 Active Data Guard环境,主数据库的standby_file_management=AUTO,备用数据库的standby_file_management=MANUAL,导致在主数据库为表空间添加的数据文件操作没有同步到备用数据库,在$ORACLE_...
ctive Data Guard Far Sync是Oracle 12c的新功能(也称为Far Sync Standby),Far Sync功能的实现是通过在距离主库(Primary Database)相对较近的地点配置Far Sync实例,主库(Primary Database) 同步(synchronous)...
Oracle 11.2.0.3 使用 ADG 搭建Data Guard 案例
·使用Oracle Active Data Guard启用只读服务与灾难恢复功能 ·发生故障时顺利转移数据库和应用程序 ·利用Oracle Data Guard切换尽量缩短计划内停机时间 ·利用Oracle Recovery Manager进行备份与恢复
Oracle数据库Data Guard技术介绍.pptx
Real-time Data Protection and Availability,Advanced Capabilities,Flashback ,Preserve Buffer Cache During Role Change ,Multi-Instance Redo Apply Enhancements,Extend the Footprint of Active Data Guard ...
运维 oracle rac dataguard 正确 停机 启动 步骤,主用机,备用机,如何正确的启动,停机,开启同步等。
业务连续性• RAC, RAC One Node, GoldenGate, Active Data Guard…• 运维管理• OEM packs(自我诊断包、 自我调优包、 变更管理包, 配置管理包…)• 海量数据管理(VLDB)• Partitioning(分区),高级压缩• 数据...
Oracle 11g:ORACLE ACTIVE DATA GUARD.pdf Oracle Database 11g 高可用性.pdf Oracle 数据库 11g 中的分区.pdf Oracle 数据库 11g :真正应用测试与可管理性概述.pdf Oracle 数据库 11g:可管理性概述.pdf ...
Oracle 11g:ORACLE ACTIVE DATA GUARD.pdf Oracle Database 11g 高可用性.pdf Oracle 数据库 11g :真正应用测试与可管理性概述.pdf Oracle 数据库 11g 中的分区.pdf Oracle 数据库 11g:可管理性概述.pdf ...