11g data guard 新特性

dbhelper發表於2014-12-05

Oracle Active Data Guard

Oracle Active Data Guard Oracle 資料庫 11g 企業版的選件之一,該選件可透過將資源密集型工作負載解除安裝到一個或多個同步備用資料庫來提升服務質量。Active Data Guard 針對查詢、實時報表、基於 Web 的訪問等支援對物理備用資料庫進行只讀訪問,同時可繼續應用接收自生產資料庫的更改Active Data Guard 還透過支援使用物理備份資料庫進行 RMAN 塊更改和快速增量備份,消除了在生產資料庫上執行備份引起的開銷。

11g 以前的版本physical standby open read only 和 日誌應用是不能同時進行

開啟Active Data Guard

 

SQL> startup mount

ORACLE instance started.

 

Total System Global Area 1707446272 bytes

Fixed Size                  1345408 bytes

Variable Size             989857920 bytes

Database Buffers          704643072 bytes

Redo Buffers               11599872 bytes

Database mounted.

SQL> alter database open read only;

 

Database altered.

 

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

 

Database altered.

 

SQL> select open_mode from v$database;

 

OPEN_MODE

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

READ ONLY WITH APPLY

 

SQL>

 

snapshot standby database

A snapshot standby database is a fully updatable standby database that is created by converting a physical standby database into a snapshot standby database. A snapshot standby database receives and archives, but does not apply, redo data from a primary database. Redo data received from the primary database is applied when a snapshot standby database is converted back into a physical standby database, after discarding all local updates to the snapshot standby database.

 

A snapshot standby database typically diverges from its primary database over time because redo data from the primary database is not applied as it is received. Local updates to the snapshot standby database will cause additional divergence. The data in the primary database is fully protected however, because a snapshot standby can be converted back into a physical standby database at any time, and the redo data received from the primary will then be applied.

 

A snapshot standby database provides disaster recovery and data protection benefits that are similar to those of a physical standby database. Snapshot standby databases are best used in scenarios where the benefit of having a temporary, updatable snapshot of the primary database justifies additional administrative complexity and increased time to recover from primary database failures.

 

Snapshot Standby資料庫狀態下,是完全可以更新的,備庫是可以接受主庫傳過來的日誌,但是不能夠將變化應用在備庫中。此功能適合用於程式升級,功能測試等情況,測試完畢以後再恢復到備庫狀態

Snapshot Standby 設定步驟:

 

1.  Stop Redo Apply, if it is active.

2.  On an Oracle Real Applications Cluster (RAC) database, shut down all but one instance.

3.  Ensure that the database is mounted, but not open.

4.  Issue the following SQL statement to perform. the conversion:

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

 

Total System Global Area 1707446272 bytes

Fixed Size                  1345408 bytes

Variable Size             989857920 bytes

Database Buffers          704643072 bytes

Redo Buffers               11599872 bytes

Database mounted.

SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;

 

Database altered.

 

SQL> select open_mode from v$database;

 

OPEN_MODE

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

MOUNTED

 

SQL> alter database open;

 

Database altered.

 

SQL> select open_mode from v$database;

 

OPEN_MODE

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

READ WRITE

 

注意:

Flashback Database is used to convert a snapshot standby database back into a physical standby database. Any operation that cannot be reversed using Flashback Database technology will prevent a snapshot standby from being converted back to a physical standby.

 

 

轉換回physical standby

1.  On an Oracle Real Applications Cluster (RAC) database, shut down all but one instance.

2.  Ensure that the database is mounted, but not open.

3.  Issue the following SQL statement to perform. the conversion:

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

 

Total System Global Area 1707446272 bytes

Fixed Size                  1345408 bytes

Variable Size             989857920 bytes

Database Buffers          704643072 bytes

Redo Buffers               11599872 bytes

Database mounted.

SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

Database altered.

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8494287/viewspace-1357474/,如需轉載,請註明出處,否則將追究法律責任。

相關文章