Oracle 11.2.0.4 physical dataguard和snapshot dataguard切換
平臺:
suse 11sp4
Oracle11.2.0.4
適用於資料遷移,災備演練,詳細過程如下:
——————convert physical standby to snapshot database
1、Stop Redo Apply, if it is active.
2、Ensure that the database is mounted, but not open.
3、Ensure that a fast recovery area has been configured. It is not necessary for flashback database to be enabled.
4、Issue the following SQL statement to perform the conversion:
SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
select process,status,group#,thread#,sequence#,blocks from v$managed_standby;
select FLASHBACK_ON from v$database;
sys@ORA11G> select name, LOG_MODE, FLASHBACK_ON,OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database;
NAME LOG_MODE FLASHBACK_ON OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS DB_UNIQUE_NAME
--------- ------------ ------------------ -------------------- ---------------- -------------------- ------------------------------
ORA11G ARCHIVELOG NO READ ONLY WITH APPLY PHYSICAL STANDBY NOT ALLOWED oradg
sys@ORA11G> alter database recover managed standby database cancel;
Database altered.
sys@ORA11G> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORA11G> startup mount
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2254952 bytes
Variable Size 553650072 bytes
Database Buffers 1577058304 bytes
Redo Buffers 4923392 bytes
Database mounted.
sys@ORA11G> select process,status,group#,thread#,sequence#,blocks,BLOCK#,DELAY_MINS,ACTIVE_AGENTS from v$managed_standby;
sys@ORA11G> alter system set db_recovery_file_dest_size=200m;
System altered.
sys@ORA11G> ho mkdir /oracle/11.2.0.4/oradata/oradg/flash
sys@ORA11G> alter system set db_recovery_file_dest='/oracle/11.2.0.4/oradata/oradg/flash';
System altered.
sys@ORA11G> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
Database altered.
sys@ORA11G> select name, LOG_MODE, FLASHBACK_ON,OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database;
NAME LOG_MODE FLASHBACK_ON OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS DB_UNIQUE_NAME
--------- ------------ ------------------ -------------------- ---------------- -------------------- ------------------------------
ORA11G ARCHIVELOG RESTORE POINT ONLY MOUNTED SNAPSHOT STANDBY NOT ALLOWED oradg
sys@ORA11G> alter database open;
Database altered.
sys@ORA11G> select * from v$flash_recovery_area_usage;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE 0 0 0
REDO LOG 0 0 0
ARCHIVED LOG 0 0 0
BACKUP PIECE 0 0 0
IMAGE COPY 0 0 0
FLASHBACK LOG 95.24 0 2
FOREIGN ARCHIVED LOG 0 0 0
sys@ORA11G> select name,space_limit,space_used,number_of_files from v$recovery_file_dest
2 ;
NAME SPACE_LIMIT SPACE_USED NUMBER_OF_FILES
-------------------------------------------------- ----------- ---------- ---------------
/oracle/11.2.0.4/oradata/oradg/flash 110100480 104857600 2
---conver to physical
sys@ORA11G> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORA11G> startup mount;
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2254952 bytes
Variable Size 553650072 bytes
Database Buffers 1577058304 bytes
Redo Buffers 4923392 bytes
Database mounted.
sys@ORA11G> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Database altered.
sys@ORA11G> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
sys@ORA11G> startup
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2254952 bytes
Variable Size 553650072 bytes
Database Buffers 1577058304 bytes
Redo Buffers 4923392 bytes
Database mounted.
Database opened.
sys@ORA11G> select name, LOG_MODE, FLASHBACK_ON,OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database;
NAME LOG_MODE FLASHBACK_ON OPEN_MODE DATABASE_ROLE
-------------------------------------------------- ------------ ------------------ -------------------- ----------------
SWITCHOVER_STATUS DB_UNIQUE_NAME
-------------------- ------------------------------
ORA11G ARCHIVELOG NO READ ONLY PHYSICAL STANDBY
RECOVERY NEEDED oradg
sys@ORA11G> select * from v$flash_recovery_area_usage;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE 0 0 0
REDO LOG 0 0 0
ARCHIVED LOG 0 0 0
BACKUP PIECE 0 0 0
IMAGE COPY 0 0 0
FLASHBACK LOG 0 0 0
FOREIGN ARCHIVED LOG 0 0 0
7 rows selected.
sys@ORA11G> recover MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
Media recovery complete.
sys@ORA11G>
sys@ORA11G>
sys@ORA11G>
sys@ORA11G> select name, LOG_MODE, FLASHBACK_ON,OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database;
NAME LOG_MODE FLASHBACK_ON OPEN_MODE DATABASE_ROLE
-------------------------------------------------- ------------ ------------------ -------------------- ----------------
SWITCHOVER_STATUS DB_UNIQUE_NAME
-------------------- ------------------------------
ORA11G ARCHIVELOG NO READ ONLY WITH APPLY PHYSICAL STANDBY
NOT ALLOWED oradg
suse 11sp4
Oracle11.2.0.4
適用於資料遷移,災備演練,詳細過程如下:
——————convert physical standby to snapshot database
1、Stop Redo Apply, if it is active.
2、Ensure that the database is mounted, but not open.
3、Ensure that a fast recovery area has been configured. It is not necessary for flashback database to be enabled.
4、Issue the following SQL statement to perform the conversion:
SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
select process,status,group#,thread#,sequence#,blocks from v$managed_standby;
select FLASHBACK_ON from v$database;
sys@ORA11G> select name, LOG_MODE, FLASHBACK_ON,OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database;
NAME LOG_MODE FLASHBACK_ON OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS DB_UNIQUE_NAME
--------- ------------ ------------------ -------------------- ---------------- -------------------- ------------------------------
ORA11G ARCHIVELOG NO READ ONLY WITH APPLY PHYSICAL STANDBY NOT ALLOWED oradg
sys@ORA11G> alter database recover managed standby database cancel;
Database altered.
sys@ORA11G> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORA11G> startup mount
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2254952 bytes
Variable Size 553650072 bytes
Database Buffers 1577058304 bytes
Redo Buffers 4923392 bytes
Database mounted.
sys@ORA11G> select process,status,group#,thread#,sequence#,blocks,BLOCK#,DELAY_MINS,ACTIVE_AGENTS from v$managed_standby;
sys@ORA11G> alter system set db_recovery_file_dest_size=200m;
System altered.
sys@ORA11G> ho mkdir /oracle/11.2.0.4/oradata/oradg/flash
sys@ORA11G> alter system set db_recovery_file_dest='/oracle/11.2.0.4/oradata/oradg/flash';
System altered.
sys@ORA11G> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
Database altered.
sys@ORA11G> select name, LOG_MODE, FLASHBACK_ON,OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database;
NAME LOG_MODE FLASHBACK_ON OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS DB_UNIQUE_NAME
--------- ------------ ------------------ -------------------- ---------------- -------------------- ------------------------------
ORA11G ARCHIVELOG RESTORE POINT ONLY MOUNTED SNAPSHOT STANDBY NOT ALLOWED oradg
sys@ORA11G> alter database open;
Database altered.
sys@ORA11G> select * from v$flash_recovery_area_usage;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE 0 0 0
REDO LOG 0 0 0
ARCHIVED LOG 0 0 0
BACKUP PIECE 0 0 0
IMAGE COPY 0 0 0
FLASHBACK LOG 95.24 0 2
FOREIGN ARCHIVED LOG 0 0 0
sys@ORA11G> select name,space_limit,space_used,number_of_files from v$recovery_file_dest
2 ;
NAME SPACE_LIMIT SPACE_USED NUMBER_OF_FILES
-------------------------------------------------- ----------- ---------- ---------------
/oracle/11.2.0.4/oradata/oradg/flash 110100480 104857600 2
---conver to physical
sys@ORA11G> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@ORA11G> startup mount;
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2254952 bytes
Variable Size 553650072 bytes
Database Buffers 1577058304 bytes
Redo Buffers 4923392 bytes
Database mounted.
sys@ORA11G> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
Database altered.
sys@ORA11G> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
sys@ORA11G> startup
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size 2254952 bytes
Variable Size 553650072 bytes
Database Buffers 1577058304 bytes
Redo Buffers 4923392 bytes
Database mounted.
Database opened.
sys@ORA11G> select name, LOG_MODE, FLASHBACK_ON,OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database;
NAME LOG_MODE FLASHBACK_ON OPEN_MODE DATABASE_ROLE
-------------------------------------------------- ------------ ------------------ -------------------- ----------------
SWITCHOVER_STATUS DB_UNIQUE_NAME
-------------------- ------------------------------
ORA11G ARCHIVELOG NO READ ONLY PHYSICAL STANDBY
RECOVERY NEEDED oradg
sys@ORA11G> select * from v$flash_recovery_area_usage;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES
-------------------- ------------------ ------------------------- ---------------
CONTROL FILE 0 0 0
REDO LOG 0 0 0
ARCHIVED LOG 0 0 0
BACKUP PIECE 0 0 0
IMAGE COPY 0 0 0
FLASHBACK LOG 0 0 0
FOREIGN ARCHIVED LOG 0 0 0
7 rows selected.
sys@ORA11G> recover MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
Media recovery complete.
sys@ORA11G>
sys@ORA11G>
sys@ORA11G>
sys@ORA11G> select name, LOG_MODE, FLASHBACK_ON,OPEN_MODE, database_role, SWITCHOVER_STATUS, db_unique_name from v$database;
NAME LOG_MODE FLASHBACK_ON OPEN_MODE DATABASE_ROLE
-------------------------------------------------- ------------ ------------------ -------------------- ----------------
SWITCHOVER_STATUS DB_UNIQUE_NAME
-------------------- ------------------------------
ORA11G ARCHIVELOG NO READ ONLY WITH APPLY PHYSICAL STANDBY
NOT ALLOWED oradg
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24585765/viewspace-2151843/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【DATAGUARD】Oracle Dataguard物理備庫切換最佳實踐(sqlplus)OracleSQL
- oracle11g dataguard切換Oracle
- DATAGUARD失敗切換
- DATAGUARD強行切換
- Oracle 11.2.0.4 Dataguard兩則故障處理Oracle
- Oracle DataGuard 主備切換 (switchover) oracle11gOracle
- 【DATAGUARD】Oracle Dataguard nologging 塊修復Oracle
- ORACLE 12C DATAGUARD環境搭建和主從切換Oracle
- 基於單機的DataGuard切換文件
- 【DATAGUARD】Oracle Dataguard體系架構詳解Oracle架構
- DataGuard---->物理StandBy的角色切換之switchover
- 基於多種場景DataGuard切換方案
- 【DATAGUARD】Oracle19c dataguard新特性及部署Oracle
- oracle dataguard broker 配置Oracle
- 11.2.0.4 Dataguard臨時讀寫三種方法
- Oracle dataguard failover 實戰OracleAI
- Oracle 單機配置DataGuardOracle
- 【Dataguard】Oracle多租戶環境對Dataguard的影響Oracle
- oracle 19c dataguard silent install (oracle 19c dataguard 靜默安裝)Oracle
- Oracle之11g DataGuardOracle
- Oracle 11.2 DataGuard RAC To RAC搭建Oracle
- oracle 11.2.0.4 DataGuard Broker配置過程中可能遇到的問題及解決方法Oracle
- Oracle Dataguard故障轉移(failover)操作OracleAI
- 7 Oracle DataGuard 命令列參考Oracle命令列
- 【Dataguard】DataGuard運維注意事項運維
- 物理DataGuard客戶端無縫切換--客戶端TAF 配置客戶端
- 【DATAGUARD】Oracle21c Dataguard建立注意事項及主要引數介紹Oracle
- 【DATAGUARD】Oracle 通過Dataguard指定恢復時間用於找回丟失資料Oracle
- 【DATAGUARD】Oracle19c Data Guard BrokerOracle
- Oracle 18c&19c physical dg切換總結Oracle
- 【DATAGUARD】Dataguard遠端同步配置最佳實踐
- Oracle dataguard報錯:Error 1017 received logging on to the standbyOracleError
- Oracle資料庫(DataGuard)遷移方案(上)Oracle資料庫
- Oracle資料庫(DataGuard)遷移方案(中)Oracle資料庫
- Oracle資料庫(DataGuard)遷移方案(下)Oracle資料庫
- Oracle 11g dataguard 配置簡約步驟Oracle
- Convert a Physical Standby Database into a Snapshot Standby DatabaseDatabase
- RAC+ASM+DATAGUARDASM