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

2014-11-24 09:16:38 · 作者: · 浏览: 0

8.2 Opening a Standby Database for Read-Only or Read/Write Access

8.2以只读或者可读写方式打开备库来访问

When a standby database is open for read-only access, users can query the standby database but cannot update it. Thus, you can reduce the load on the primary database by using the standby database for reporting purposes. You can periodically open the standby database for read-only access and perform ad hoc queries to verify Redo Apply is updating the standby database correctly. (Note that for distributed queries, you must first issue theALTER DATABASE SET TRANSACTION READ ONLY statement before you can issue a query on the read-only database.)

当备库是以只读方式打开时,用户只能在备库上查询而不能更新它。那么你可以为主库减轻负载而在备库上出报表,你可以定期的以只读方式打开备库,查询验证重做应用是否正确的更新到备库。针对分布式查询,你必须在只读数据库查询之前发出ALTER DATABASE SET TRANSACTION READ ONLY语句。

Figure 8-1 shows a standby database open for read-only access.

Figure 8-1 Standby Database Open for Read-Only Access

\

Description of "Figure 8-1 Standby Database Open for Read-Only Access"

See Also:

Assessing Whether or Not to Open a Standby Database

Opening a Physical Standby Database for Read-Only Access

A physical standby database can be opened temporarily in read/write mode for development, reporting, or testing purposes, and then flashed back to a point in the past to be reverted back to a physical standby database. When the database is flashed back, Data Guard automatically synchronizes the standby database with the primary database, without the need to re-create the physical standby database from a backup copy of the primary database.

物理备库可以暂时打开以读/写模式用来开发,报告或测试的目的,然后闪回到过去一个点来恢复到一个物理备用数据库。当数据库闪回以后,Data Guard自动同步主库与备库之间的数据,而不需要从主数据库的备份副本重新创建物理备用数据库。

See Also:

Section 12.6 for a scenario that describes activating a physical standby database as a read/write reporting database, and then resynchronizing the database with the primary database 第12.6节的场景,描述活动的物理备用数据库为读/写报告数据库,然后与主数据库重新同步数据库。

8.2.1 Assessing Whether or Not to Open a Standby Database

8.2.1 评估是否要打开备库

As you decide whether or not to open a physical standby database for read-only or read/write access, consider the following:

决定是否要以只读方式或者读写方式打开物理备库,可以考虑如下:

Opening the physical standby database read-only may lengthen the time it takes to recover from a failure or outage, because the database must be restarted after a failover.

以只读方式打开物理备库可以延长失败或中断恢复的时间,因为数据库必须在故障切换后重新启动。

As long as the physical standby database has not been opened read-only since the last time it was started, a restart is unnecessary after failover, thus increasing system availability.

只要物理备库自从上次启动没有以只读方式打开,在故障切换后,重启是必须的,那么就会增加系统的可用性。

While a standby database is open for read-only or read/write access, it does not apply redo data received from the primary database, thus it is not kept transactionally consistent with the primary database.

当备库是以只读方式打开或者读写方式打开,就不会应用来自主库的重做数据,那么就不能与主库保持一致性的事务。

When a physical standby database is open, redo data from the primary database is received by the standby database, but the log files are not applied. At some point, you need to resume Redo Apply on the standby database, and apply the archived redo log files to resynchronize the standby database with the primary database. Because of the additional time required to apply any accumulated archived redo log files, having a standby database open for read-only access can increase the time required to complete failovers or switchovers.

当物理备库是打开时,来自主库的重做数据被备库接收,但是不会被应用。在有点伤,你需要在备库上重新应用重做数据,应用归档日志来同步备库和主库之间的