A physical standby database is an exact, block-for-block copy of a primary database. A
physical standby is maintained as an exact copy through a process called Redo Apply,
in which redo data received from a primary database is continuously applied to a
physical standby database using the database recovery mechanisms.
A physical standby database can be opened for read-only access and used to offload
queries from a primary database. If a license for the Oracle Active Data Guard option
has been purchased, Redo Apply can be active while the physical standby database is
open, thus allowing queries to return results that are identical to what would be
returned from the primary database. This capability is known as the real-time query
feature.
备库是主库块到块的精确复制,物理备库通过redo apply进程进行精确的复制。物理备库可以以只读方式打开并且分离主库的查询操作。如果是ADG,则可以实现备库与主库一致性的查询能力,这种能力就是real-time查询特性
If a license for the Oracle Active Data Guard option has been purchased, Redo Apply
can be active while the physical standby database is open, thus allowing queries to
return results that are identical to what would be returned from the pr
imary database.
This capability is known as the real-time query feature.
如果有license,可以在redo apply进程启动的时候打开备库进行查询操作
If a license for the Oracle Active Data Guard option has not been purchased, a physical
standby database cannot be open while Redo Apply is active, so the following rules
must be observed when opening a physical standby database instance or starting Redo
Apply:
■ Redo Apply must be stopped before any physical standby database instance is
opened.
■ If one or more physical standby instances are open, those instances must be
stopped or restarted in a mounted state before starting Redo Apply.
如果没有ADG的license,当redo apply进程启动的时候备库不能被打开,因此在对备库和redo apply进程进行操作的时候需要特别注意:
1、开启备库的时候redo apply进程必须被关掉
2、在开启redo apply进程之前,那些开着的备库实例需要启动到mounted的状态。
Real-time query(备库实时查询)
The COMPATIBLE database initialization parameter must be set to 11.0 or higher to use
the real-time query feature of the Oracle Active Data Guard option.
如果使用ADG,compatible数据库初始化参数必须被设置成11.0以上
A physical standby database instance cannot be opened if Redo Apply is active on a
mounted instance of that database. Use the following SQL statements to stop Redo
Apply, open a standby instance read-only, and restart Redo Apply:
主库在mount的时候需要先关闭redo apply进程并将主库启动至open状态才可以
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL> ALTER DATABASE OPEN;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE -
> DISCONNECT;
Note: If Redo Apply is active on an open instance, additional
instances can be opened without having to stop Redo Apply.
Example: Querying V$DATABASE to Check the Standby's Open Mode
This example shows how the value of the V$DATABASE.OPEN_MODE column changes
when a physical standby is open in real-time query mode.
1. Start up and open a physical standby instance, and perform the following SQL
query to show that the database is open in read-only mode:
SQL> SELECT open_mode FROM V$DATABASE;
OPEN_MODE
--------------------
READ ONLY
2. Issue the following SQL statement to start Redo Apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE -
> DISCONNECT;
Database altered.
3. Now that the standby is in real-time query mode (that is, the standby is open in
read-only mode and Redo Apply is active), the V$DATABASE.OPEN_MODE column
changes to indicate the following:
SQL> SELECT open_mode FROM V$DATABASE;
OPEN_MODE
--------------------
READ ONLY WITH APPLY
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29802484/viewspace-2104270/
,如需转载,请注明出处,否则将追究法律责任。