ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Active Data Guard

Active Data Guard

原创 Linux操作系统 作者:lwitpub 时间:2011-09-09 20:26:52 0 删除 编辑

Oracle 11gR2 - Active Data Guard.
Active Data Guard allows a standby database to be opened for read-only access while redo is still being applied. However, this benefit is offset to a certain extent by the fact that Active Data Guard is available on Enterprise Edition only and is cost option which must be licensed on both the primary and standby database.

1. How to determine whether a standby database is using Active Data Guard, use the following query:
SQL> SELECT database_role, open_mode FROM v$database;

For example:
SQL> SELECT database_role, open_mode FROM v$database;

DATABASE_ROLE     OPEN_MODE
----------------                  --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY

2. How to start the ADG.
### 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:
$ sqlplus / as sysdba
SQL> STARTUP

ORACLE instance started.
Total System Global Area 6497189888 bytes
Fixed Size 2238672 bytes
Variable Size 3372222256 bytes
Database Buffers 3103784960 bytes
Redo Buffers 18944000 bytes
Database mounted
Database opened

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 WITH SESSION SHUTDOWN;

SQL> SELECT database_role, open_mode FROM v$database;

DATABASE_ROLE    OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY

 

### In 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:

$ sqlplus / as sysdba

SQL> STARTUP MOUNT

ORACLE instance started.

Total System Global Area 6497189888 bytes

Fixed Size 2238672 bytes

Variable Size 3372222256 bytes

Database Buffers 3103784960 bytes

Redo Buffers 18944000 bytes

Database mounted

Database opened

 

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 WITH SESSION SHUTDOWN;

 

SQL> SELECT database_role, open_mode FROM v$database;

 

DATABASE_ROLE    OPEN_MODE

----------------          --------------------

PHYSICAL STANDBY  READ ONLY WITH APPLY

 

###Of course not all databases are started using SQL*Plus.

If you start the database using SRVCTL then the default open mode can be specified in the OCR.

If the database is started using SRVCTL then the database will be opened in read-only mode. For example:

$ srvctl start database -d ORCL

 

The default start mode can be modified in the OCR using the SRVCTL MODIFY DATABASE command.

For example:

$ srvctl modify database -d ORCL-s mount

 

You can also specify the start mode as a parameter to the SRVCTL START DATABASE command

For example:

$ srvctl start database -d ORCL -o open

$ srvctl start database -d ORCL -o mount

Take care when performing a switchover or switchback that the OCR is updated as part of the procedure.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/628922/viewspace-707057/,如需转载,请注明出处,否则将追究法律责任。

下一篇: alert log on Oracle11g
请登录后发表评论 登录
全部评论

注册时间:2009-05-08

  • 博文量
    107
  • 访问量
    395278