2013-3-19資料庫DG切換
(1) DG切換
--查詢角色及切換狀態
select database_role, switchover_status from v$database;
--查詢角色及切換狀態
select database_role, switchover_status from v$database;
--查詢歸檔最大序列號:
select max(sequence#) from v$archived_log where applied='YES';
select max(sequence#) from v$archived_log where applied='YES';
--首先:主庫切換到備庫
alter database commit to switchover to physical standby with session shutdown;
shutdown immediate
startup mount
alter database recover managed standby database disconnect from session;(開啟恢復)
alter database commit to switchover to physical standby with session shutdown;
shutdown immediate
startup mount
alter database recover managed standby database disconnect from session;(開啟恢復)
--然後:備庫切換到主庫
alter database commit ot switchover to primary with session shutdown ;
alter database open;
alter database commit ot switchover to primary with session shutdown ;
alter database open;
--改密碼:
alter user product identified by XXXXX;
alter user product identified by XXXXX;
--最後檢查程式:
(主庫執行,啟用遠端歸檔)
alter system set log_archive_dest_state_2=ENABLE;
alter system switch logfile;
(主庫執行,啟用遠端歸檔)
alter system set log_archive_dest_state_2=ENABLE;
alter system switch logfile;
(備庫執行,檢查是否有MRP、RFS兩個程式)
select process, status from v$managed_standby;
select process, status from v$managed_standby;
(2) DG關閉
--查詢角色:
select database_role, switchover_status from v$database;
select database_role, switchover_status from v$database;
--先關主庫:
shutdown immediate;
lsnrclt stop ->重啟伺服器
shutdown immediate;
lsnrclt stop ->重啟伺服器
--再關備庫
alter database recover managed standby database cancel;
shutdown immediate;
lsnrclt stop ->重啟伺服器
alter database recover managed standby database cancel;
shutdown immediate;
lsnrclt stop ->重啟伺服器
(3) DG 開啟
--先開備庫:
lsnrctl start
startup mount
alter database recover managed standby database disconnect from session;(開啟恢復)
lsnrctl start
startup mount
alter database recover managed standby database disconnect from session;(開啟恢復)
--再開主庫:
lsnrctl start
startup
lsnrctl start
startup
--改密碼:
alter user product identified by XXXXX;
alter user product identified by XXXXX;
--最後檢查程式:
(主庫執行,啟用遠端歸檔)
alter system set log_archive_dest_state_2=ENABLE;
alter system switch logfile;
(主庫執行,啟用遠端歸檔)
alter system set log_archive_dest_state_2=ENABLE;
alter system switch logfile;
(備庫執行,檢查是否有MRP、RFS兩個程式)
select process, status from v$managed_standby;
select process, status from v$managed_standby;
---修改密碼:
alter user product identified by XXXXX;
alter user PRODUCT_B2B identified by XXXXX;
alter user product identified by XXXXX;
alter user PRODUCT_B2B identified by XXXXX;
(4)中央改密碼:
alter user product identified by XXXXX;
alter user PRODUCT_B2B identified by XXXXX;
一、【1.14】:
------------------------
CT_WAREHOU CENTER.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2012-12-17 21:03:49
SE
WAREHOUSE WXXRDB1_26.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2012-12-17 21:02:50
WAREHOUSE CENTER.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2012-09-17 22:43:46
----------------------------
WAREHOUSE CENTER.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2012-09-17 22:43:46
----------------------------
(1) CENTER.CENTER.WXXR.COM.CN
sqlplus CT_WAREHOU/ct_warehouse
drop database link CENTER.CENTER.WXXR.COM.CN;
create database link CENTER.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
select * from ;
drop database link CENTER.CENTER.WXXR.COM.CN;
create database link CENTER.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
select * from ;
(2) WXXRDB1_26.CENTER.WXXR.COM.CN
sqlplus WAREHOUSE/warehouse
drop database link WXXRDB1_26.CENTER.WXXR.COM.CN;
create database link WXXRDB1_26.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
select * from ;
drop database link WXXRDB1_26.CENTER.WXXR.COM.CN;
create database link WXXRDB1_26.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
select * from ;
(3) CENTER.CENTER.WXXR.COM.CN
sqlplus WAREHOUSE/warehouse
drop database link CENTER.CENTER.WXXR.COM.CN ;
create database link CENTER.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
select * from ;
drop database link CENTER.CENTER.WXXR.COM.CN ;
create database link CENTER.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
select * from ;
二、【1.18】
----------------------------------
WAREHOUSE WXXRDB.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2013-02-07 11:03:13
WAREHOUSE WXXRDB1_26.CENTER.WXXR.COM.CN PRODUCT CENTER-WXXRDB 2013-02-01 10:20:10
----------------------------------
(1) WXXRDB.CENTER.WXXR.COM.CN
sqlplus/ as sysdba
drop database link WXXRDB.CENTER.WXXR.COM.CN;
create database link WXXRDB.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
drop database link WXXRDB.CENTER.WXXR.COM.CN;
create database link WXXRDB.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
(2) WXXRDB1_26.CENTER.WXXR.COM.CN
sqlplus/ as sysdba
drop database link WXXRDB1_26.CENTER.WXXR.COM.CN;
create database link WXXRDB1_26.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
drop database link WXXRDB1_26.CENTER.WXXR.COM.CN;
create database link WXXRDB1_26.CENTER.WXXR.COM.CN connect to product identified by XXXXX using 'CENTER-WXXRDB';
三、【1.74】
------------------------------
STAGEAREA WXXRDB.CENTER.WXXR.COM.CN PRODUCT WXXRDB.CENTER.WXXR.COM.CN 2012-12-27 13:46:41
PUBLIC WXXRDB.CENTER.WXXR.COM.CN PRODUCT WXXRDB.CENTER.WXXR.COM.CN 2012-12-19 09:12:39
------------------------------
STAGEAREA WXXRDB.CENTER.WXXR.COM.CN PRODUCT WXXRDB.CENTER.WXXR.COM.CN 2012-12-27 13:46:41
PUBLIC WXXRDB.CENTER.WXXR.COM.CN PRODUCT WXXRDB.CENTER.WXXR.COM.CN 2012-12-19 09:12:39
--------------------------------------
(1) WXXRDB.CENTER.WXXR.COM.CN
sqlplus STAGEAREA/stagearea
drop database link WXXRDB.CENTER.WXXR.COM.CN;
create database link WXXRDB.CENTER.WXXR.COM.CN connect to PRODUCT identified by XXXXX using 'WXXRDB.CENTER.WXXR.COM.CN';
select * from ;
drop database link WXXRDB.CENTER.WXXR.COM.CN;
create database link WXXRDB.CENTER.WXXR.COM.CN connect to PRODUCT identified by XXXXX using 'WXXRDB.CENTER.WXXR.COM.CN';
select * from ;
(2) WXXRDB.CENTER.WXXR.COM.CN
sqlplus / as sysdba
drop public database link WXXRDB.CENTER.WXXR.COM.CN;
create public database link WXXRDB.CENTER.WXXR.COM.CN connect to PRODUCT identified by XXXXX using 'WXXRDB.CENTER.WXXR.COM.CN';
select * from ;
sqlplus / as sysdba
drop public database link WXXRDB.CENTER.WXXR.COM.CN;
create public database link WXXRDB.CENTER.WXXR.COM.CN connect to PRODUCT identified by XXXXX using 'WXXRDB.CENTER.WXXR.COM.CN';
select * from ;
四 、【1.24】
export ORACLE_SID=wxxrdbjx
sqlplus / as sysdba
alter user product identified by XXXXX;
sqlplus / as sysdba
alter user product identified by XXXXX;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-756480/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle DG資料庫切換步驟筆記Oracle資料庫筆記
- 【DG】Data Guard主備庫Switchover切換
- DG的切換操作
- 【DG】Data Guard主備庫Failove切換AI
- Oracle DG資料庫狀態轉換Oracle資料庫
- Django切換MySQL資料庫DjangoMySql資料庫
- dg切換操作文件
- oracle dg切換操作示例Oracle
- 【DG】三大模式切換模式
- oracle資料庫服務切換Oracle資料庫
- 使用Broker實現DG切換
- Oracle RAC DG手動切換Oracle
- DG_三大模式切換模式
- Oracle資料庫切換歸檔模式Oracle資料庫模式
- 【DATAGUARD】物理dg的switchover切換(五)
- 如何在MySQL資料庫中使用use來切換資料庫?MySql資料庫
- ORACLE資料庫切換和遷移方案Oracle資料庫
- RAC+單例項DG的切換單例
- oracle DG VCS切換異常問題Oracle
- 【DATAGUARD】物理dg的failover切換(六)AI
- Oracle資料庫歸檔模式的切換ELOracle資料庫模式
- VCS 切換後資料庫無法歸檔資料庫
- 5分鐘,徹底精通Oracle DG切換Oracle
- Oracle物理DG自動切換——Dataguard Broker配置Oracle
- 單節點DG的switchover切換介紹
- Oracle 11g dg switchover切換操作流程Oracle
- 資料庫訪問抽象類實現專案資料庫靈活切換資料庫抽象
- ORACLE資料庫Dataguard dg brokerOracle資料庫
- 資料庫redolog切換頻率統計分析資料庫
- 案例:資料庫windows切換至linux平臺資料庫WindowsLinux
- 單例項DG切換中的虛擬IP單例
- ORA-16139 Oracle DG無法正常切換Oracle
- 單節點DG的failover切換介紹AI
- oracle 10g dg切換步驟記錄Oracle 10g
- 資料庫使用者登入、切換以及解鎖資料庫
- standby 資料庫的切換步驟的官方版本資料庫
- Oracle DG管理資料庫屬性Oracle資料庫
- DG中備庫為SWITCHOVER PENDING時是否能進行主備切換