Data Guard - Snapshot Standby Database配置
Data Guard - Snapshot Standby Database配置
概述
--------
一般情況下,物理standby資料庫處於mount狀態接收和應用主庫的REDO日誌,物理standby資料庫不能對外提供訪問。如果需要只讀訪問,那麼可以臨時以read-only的方式open物理備庫,或者配置ACTIVE DATA GUARD,那麼物理standby資料庫可以進行只讀(read-only)訪問(比如報表業務查詢),但是物理standby資料庫不能進行讀寫操作(read-write)。
有些情況下,為了實現系統的壓力測試或者Real Application Testing(RAT)或者其他讀寫操作測試,那麼可以臨時將物理standby資料庫轉換為snapshot standby資料庫然後進行測試,因為snapshot standby資料庫是獨立於主庫的,並且是可以進行讀寫操作(read-write)。測試過程中snapshot standby資料庫正常接收主庫的歸檔日誌,保證主庫的資料安全,但是不會應用這些日誌,當壓力測試結束後,可以非常簡單的再將snapshot standby轉換為物理standby資料庫,繼續同步主庫日誌。
配置
---------
1.物理standby配置閃回日誌
SQL> Alter system set db_recovery_file_dest_size=500M;
System altered.
SQL> Alter system set db_recovery_file_dest='/u01/app/oracle/snapshot_standby';
System altered.
2.物理standby停止應用日誌
SQL> alter database recover managed standby database cancel;
Database altered.
3.物理standby轉換為snapshot standby,並且open snapshot standby
SQL> alter database convert to snapshot standby;
Database altered.
SQL> alter database open;
Database altered.
檢查snapshot standby資料庫角色是SNAPSHOT STANDBY,open模式是READ WRITE:
SQL> select DATABASE_ROLE,name,OPEN_MODE from v$database;
DATABASE_ROLE NAME OPEN_MODE
---------------- --------- --------------------
SNAPSHOT STANDBY FSDB READ WRITE
4.對snapshot standby資料庫進行壓力測試或者Real Application Testing(RAT)或者其他讀寫操作。
5.測試結束後,再將snapshot standby轉換為physical standby,並且重新開始應用日誌
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Database mounted.
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Database altered.
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Database mounted.
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
5.轉換為物理standby後,檢視備庫角色是PHYSICAL STANDBY,open模式是MOUNTED
SQL> select DATABASE_ROLE,name,OPEN_MODE from v$database;
DATABASE_ROLE NAME OPEN_MODE
---------------- --------- --------------------
PHYSICAL STANDBY FSDB MOUNTED
6.檢查主庫和物理備庫日誌是同步的
主庫日誌:
SQL> select ads.dest_id,max(sequence#) "Current Sequence",
max(log_sequence) "Last Archived"
from v$archived_log al, v$archive_dest ad, v$archive_dest_status ads
where ad.dest_id=al.dest_id
and al.dest_id=ads.dest_id
and al.resetlogs_change#=(select max(resetlogs_change#) from v$archived_log )
group by ads.dest_id;
DEST_ID Current Sequence Last Archived
---------- ---------------- -------------
1 361 361
2 361 362
--備庫日誌
SQL> select al.thrd "Thread", almax "Last Seq Received", lhmax "Last Seq Applied"
from (select thread# thrd, max(sequence#) almax
from v$archived_log
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) al,
(select thread# thrd, max(sequence#) lhmax
from v$log_history
where resetlogs_change#=(select resetlogs_change# from v$database)
group by thread#) lh
where al.thrd = lh.thrd;
Thread Last Seq Received Last Seq Applied
---------- ----------------- ----------------
1 361 361
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25462274/viewspace-2141859/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 11gR2 Active Data Guard 閃回 - flashback database / snapshot standby - 3Database
- 11gR2 Active Data Guard 閃回 - flashback database / snapshot standby - 2Database
- Data Guard之Snapshot Standby資料庫功能[轉]資料庫
- 建立Data guard logical standby database須知Database
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- ORA-01555 on Active Data Guard Standby DatabaseDatabase
- Physical Standby Database 切換到 Snapshot Standby DatabaseDatabase
- Oracle 11g Data Guard 使用 duplicate from active database 建立 standby databaseOracleDatabase
- Oracle 11g Data Guard 使用duplicate from active database 建立 standby databaseOracleDatabase
- data_guard 雙standby pfile 檔案配置
- 【DataGuard】Oracle 11g物理Data Guard之Snapshot Standby資料庫功能Oracle資料庫
- 【DG】Data Guard搭建(physical standby)
- 【轉】【DataGuard】Oracle 11g物理Data Guard之Snapshot Standby資料庫功能Oracle資料庫
- Oracle 11R2 snapshot Data GuardOracle
- oracle9i(9204)dg(data guard)_ place the standby database in manual recovery modeOracleDatabase
- flashback database 結合 data guardDatabase
- DATA GUARD 中alter database 命令Database
- data guard 歸檔日誌管理 (standby)
- DATA GUARD物理STANDBY的 SWITCHOVER切換
- Oracle Data Guard配置Oracle
- Creating a 10gr2 Data Guard Physical Standby database with Real-Time applyDatabaseAPP
- 聊聊Oracle 11g的Snapshot Standby Database(上)OracleDatabase
- 聊聊Oracle 11g的Snapshot Standby Database(下)OracleDatabase
- Script to Collect Data Guard Physical and Active Standby Diagnostic InformationORM
- DATA GUARD物理STANDBY的FAILOVER切換AI
- DATA GUARD物理STANDBY的 SWITCHOVER切換[zt]
- Data Guard Broker系列之二:Data Guard Broker配置實戰
- Oracle 11g RAC Data Guard 物理standby 建立Oracle
- Data Guard學習之物理standby建立步驟
- 基於同一主機配置Oracle 11g Data Guard(logical standby)Oracle
- 【DataGuard】Oracle 11g DataGuard 新特性之 Snapshot Standby DatabaseOracleDatabase
- Oracle 12.2 How to Generate AWRs in Active Data Guard Standby DatabasesOracleDatabase
- Data Guard 之RMAN備份線上搭建物理standby
- Standby (Data guard) 常用維護命令及相關概念
- 管理物理STANDBY資料庫——DATA GUARD概念和管理資料庫
- 建立物理STANDBY資料庫——DATA GUARD概念和管理資料庫
- 物理data guard備standby庫的時候報錯。
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項OracleLinux