OracleDataGuard_备库以只读或读写方式打开访问(二)

2014-11-24 09:16:38 · 作者: · 浏览: 3
数据。因为应用任何所需的额外时间累积的归档重做日志文件,因为需要申请任何累计归档重做日志文件,有一个备用数据库只读访问打开会增加完成故障切换或换药所需的额外时间。

You can use a physical standby database for reporting purposes or as a clone database while also maintaining the ability to complete a failover or switchover quickly if you configure more than one standby database on the standby system.

如果你的备用系统上配置多个备用数据库,你可以使用一个物理备用数据库进行报表用途或克隆一个数据库,同时还保持了完整的故障切换或正常切换。

For example, based on your business requirements, you might:

例如,基于你的业务需求,你可以:

Configure two physical standby databases with one standby database always performing Redo Apply to be as current as possible with the primary database and the other standby database open in read-only mode during business hours for reporting purposes.

配置两个物理备库,其中一个备库尽可能经常用来执行重做应用主库的日志,另外一个则以只读方式打开在业务期间达到出报表的目的。

Configure a physical standby database to maintain a copy of the primary database for disaster recovery purposes and also configure a logical standby database to off-load reporting tasks that require access to the latest data from the primary database.

配置物理备库来维护主库的副本来达到灾难恢复的目的,配置逻辑备库来卸载报表任务,这需要访问到主库最新的数据。

When configuring more than one standby database on the same system, consider using the DEPENDENCY attribute of the LOG_ARCHIVE_DEST_ninitialization parameter to define one archival destination to receive redo data on behalf of all of the destinations, rather than transmitting redo data to each individual destination. See Section 5.7.5 for more information.

8.2.2 Opening a Physical Standby Database for Read-Only Access

You can alternate between having a physical standby database open for read-only access and performing Redo Apply using the following procedures.

你可以使用以下过程在物理备库只读方式打开访问和执行重做应用来轮流切换。

To open a standby database for read-only access when it is currently shut down:

当备库是关闭状态,直接使用STARTUP命令来以只读方式打开备库:

Start, mount, and open the database for read-only access using the following statement:

SQL> STARTUP;

To open a standby database for read-only access when it is currently performing Redo Apply:

当目前正在执行重做应用,以只读方式打开备库来访问:(首先取消重做应用,然后再打开数据库)

Cancel Redo Apply:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

Open the database for read-only access:

SQL> ALTER DATABASE OPEN;
###################################################################################### SYS@PRODSTD>alter database open;
Database altered.
SYS@PRODSTD>select OPEN_MODE from v$database;
OPEN_MODE ---------- READ ONLY
SYS@PRODSTD> ------------------------------------------------------------------------------------------------------------------ Sat Mar 29 13:22:29 2014 alter database open Sat Mar 29 13:22:29 2014 SMON: enabling cache recovery Sat Mar 29 13:22:30 2014 Database Characterset is AL32UTF8 replication_dependency_tracking turned off (no async multimaster replication found) Physical standby database opened for read only access. Completed: alter database open
########################################################################################

You do not need to shut down the instance to open it for read-only access.

Note:

By default, the ALTER DATABASE OPEN statement opens physical standby databases in read-only mode. The Oracle database determines if this is a physical standby database based on information in the control file. 默认的, ALTER DATABASE OPEN 这条语句是以只读凡是打开物理备库。oracle数据库是以控制文件里的信息是否是物理备库来决定的。

To change the standby database from being open for read-only a