oracle 11g中的snapshot standby特性
在oracle 11g中,data guard最吸引人的,除了active data guard的實時查詢特性(即可以以只讀方式開啟物理standby資料庫的同時MRP程式能繼續做recover),快照備
用資料庫這個特性也是不錯,比較適用於快速部署一個臨時的與線上環境相同的測試資料庫.它是透過還原點(restore point)和閃回資料庫的原理(flashback database),
可以以讀/寫方式開啟物理備用資料庫,對資料庫進行修改,之後再根據還原點,恢復到物理備用資料庫.
操作相當簡單,以下測試:
一.物理備用資料庫到快照備用資料庫
--檢視當前備用資料庫的角色
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY
--關閉並啟動到mount
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 730714112 bytes
Fixed Size 2256832 bytes
Variable Size 482345024 bytes
Database Buffers 243269632 bytes
Redo Buffers 2842624 bytes
Database mounted.
--轉換物理standby到快照standby
SQL> alter database convert to snapshot standby;
Database altered.
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL> alter database open;
Database altered.
--檢視當前備用資料庫的角色
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ WRITE SNAPSHOT STANDBY
--可以看到,oracle 有建了一個還原點
SQL> select name,storage_size from v$restore_point;
NAME
--------------------------------------------------------------------------------
STORAGE_SIZE
------------
SNAPSHOT_STANDBY_REQUIRED_08/10/2015 05:33:52
52428800
--測試是否可以修改資料庫
SQL> create table scott.test02 as select * from dba_objects;
Table created.
SQL> select count(1) from scott.test02;
COUNT(1)
----------
86267
二.快照備用資料庫到物理備用資料庫
--檢視當前備用資料庫的角色
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
MOUNTED SNAPSHOT STANDBY
--關閉並啟動到mount
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 730714112 bytes
Fixed Size 2256832 bytes
Variable Size 482345024 bytes
Database Buffers 243269632 bytes
Redo Buffers 2842624 bytes
Database mounted.
--轉換快照standby到物理standby
SQL> alter database convert to physical standby;
Database altered.
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 730714112 bytes
Fixed Size 2256832 bytes
Variable Size 482345024 bytes
Database Buffers 243269632 bytes
Redo Buffers 2842624 bytes
Database mounted.
Database opened.
SQL> alter database recover managed standby database disconnect;
Database altered.
--檢視當前備用資料庫的角色
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY
--檢視在快照standby時建的測試表已經不存在了
SQL> select * from scott.test02;
select * from scott.test02
*
ERROR at line 1:
ORA-00942: table or view does not exist
備註:
物理standby是最高保護模式(maximum protection),是不能轉換為snapshot standby的.
物理standby使用了standby redo log,在create restore point後,要alter system switch logfile;,以保證還原點的scn在物理standby庫上是
歸檔的,不然可能無法成功閃回到還原點.
物理standby在切換為快照standby後,如果間隔很長時間,primary資料庫產生的大量的重做日誌,這樣可以在轉換為物理standby後,透過
對primary資料庫的增量備份並recover到物理standby,來加快物理standby的還原速度.
用資料庫這個特性也是不錯,比較適用於快速部署一個臨時的與線上環境相同的測試資料庫.它是透過還原點(restore point)和閃回資料庫的原理(flashback database),
可以以讀/寫方式開啟物理備用資料庫,對資料庫進行修改,之後再根據還原點,恢復到物理備用資料庫.
操作相當簡單,以下測試:
一.物理備用資料庫到快照備用資料庫
--檢視當前備用資料庫的角色
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY
--關閉並啟動到mount
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 730714112 bytes
Fixed Size 2256832 bytes
Variable Size 482345024 bytes
Database Buffers 243269632 bytes
Redo Buffers 2842624 bytes
Database mounted.
--轉換物理standby到快照standby
SQL> alter database convert to snapshot standby;
Database altered.
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL> alter database open;
Database altered.
--檢視當前備用資料庫的角色
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ WRITE SNAPSHOT STANDBY
--可以看到,oracle 有建了一個還原點
SQL> select name,storage_size from v$restore_point;
NAME
--------------------------------------------------------------------------------
STORAGE_SIZE
------------
SNAPSHOT_STANDBY_REQUIRED_08/10/2015 05:33:52
52428800
--測試是否可以修改資料庫
SQL> create table scott.test02 as select * from dba_objects;
Table created.
SQL> select count(1) from scott.test02;
COUNT(1)
----------
86267
二.快照備用資料庫到物理備用資料庫
--檢視當前備用資料庫的角色
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
MOUNTED SNAPSHOT STANDBY
--關閉並啟動到mount
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 730714112 bytes
Fixed Size 2256832 bytes
Variable Size 482345024 bytes
Database Buffers 243269632 bytes
Redo Buffers 2842624 bytes
Database mounted.
--轉換快照standby到物理standby
SQL> alter database convert to physical standby;
Database altered.
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 730714112 bytes
Fixed Size 2256832 bytes
Variable Size 482345024 bytes
Database Buffers 243269632 bytes
Redo Buffers 2842624 bytes
Database mounted.
Database opened.
SQL> alter database recover managed standby database disconnect;
Database altered.
--檢視當前備用資料庫的角色
SQL> select open_mode,database_role from v$database;
OPEN_MODE DATABASE_ROLE
-------------------- ----------------
READ ONLY WITH APPLY PHYSICAL STANDBY
--檢視在快照standby時建的測試表已經不存在了
SQL> select * from scott.test02;
select * from scott.test02
*
ERROR at line 1:
ORA-00942: table or view does not exist
備註:
物理standby是最高保護模式(maximum protection),是不能轉換為snapshot standby的.
物理standby使用了standby redo log,在create restore point後,要alter system switch logfile;,以保證還原點的scn在物理standby庫上是
歸檔的,不然可能無法成功閃回到還原點.
物理standby在切換為快照standby後,如果間隔很長時間,primary資料庫產生的大量的重做日誌,這樣可以在轉換為物理standby後,透過
對primary資料庫的增量備份並recover到物理standby,來加快物理standby的還原速度.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28539951/viewspace-1767427/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 11g Dataguard中的snapshot standby特性
- 在oracle 10g中實現oracle 11g的snapshot standby特性Oracle 10g
- 【DataGuard】Oracle 11g DataGuard 新特性之 Snapshot Standby DatabaseOracleDatabase
- 聊聊Oracle 11g的Snapshot Standby Database(上)OracleDatabase
- 聊聊Oracle 11g的Snapshot Standby Database(下)OracleDatabase
- 【DataGuard】Oracle 11g物理Data Guard之Snapshot Standby資料庫功能Oracle資料庫
- oracle 11g中的 oracle restart特性OracleREST
- 【轉】【DataGuard】Oracle 11g物理Data Guard之Snapshot Standby資料庫功能Oracle資料庫
- 【DATAGUARD】 將11g物理備庫轉換為Snapshot Standby
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- oracle snapshot standby資料庫的scheduler jobs不執行Oracle資料庫
- 【DG】之 Snapshot standby模式模式
- 11g Using Snapshot Standby Database. (文件 ID 443720.1)Database
- Physical Standby Database 切換到 Snapshot Standby DatabaseDatabase
- 11g 新特性—— Active Database Duplication for A standby databaseDatabase
- snapshot standby快照備庫角色
- Data Guard - Snapshot Standby Database配置Database
- oracle 11g 的新特性Oracle
- 【DataGuard】Oracle 11g physical standby switchoverOracle
- 建立Oracle 11g logical standbyOracle
- Oracle 11g Cross platform Active StandbyOracleROSPlatform
- 11g RMAN新特性 active database duplication createing standbyDatabase
- 【DataGuard】Oracle 11g DataGuard 新特性之 Active Standby:Real-Time Apply+QueryOracleAPP
- Oracle 11g 新特性Oracle
- Oracle 18C新特性之PDB snapshot(快照) CarouselOracle
- 11g rman新特性 duplicate target database for standby from active databaseDatabase
- [20230425]注意snapshot standby與activate standby的區別.txt
- Oracle 11g 中 Direct path reads 特性 說明Oracle
- 【ORACLE新特性】11G 分割槽新特性Oracle
- Oracle 11g RAC Data Guard 物理standby 建立Oracle
- Oracle 11g 鎖特性增加Oracle
- Oracle 11g Aix 雙機 物理Standby配置 01OracleAI
- Oracle 11g Aix 雙機 物理Standby配置 02OracleAI
- Oracle 11g Aix 雙機 物理Standby配置 03OracleAI
- Oracle 11g Aix 雙機 物理Standby配置 04OracleAI
- Data Guard之Snapshot Standby資料庫功能[轉]資料庫
- Oracle 11g 新特性簡介Oracle
- Oracle 11g 新特性之DRCPOracle