dataguard 手動切換,檢查指令碼
select username,count(*) from v$session group by username;
--check status
select INST_ID,switchover_status,open_mode,database_role from gv$database;
--check gap
select status,gap_status from v$archive_dest_status where rownum<5;
set linesize 1000
---check log
select status,gap_status,APPLIED_THREAD#,ERROR from v$archive_dest_status where rownum<5;
--check and switch to stand db
select database_role,switchover_status from v$database;
alter database commit to switchover to physical standby with session shutdown ;
--check
select database_role,switchover_status from v$database;
--open read only
shutdown immediate
startup mount
select switchover_status,open_mode,database_role from v$database;
alter database open read only;
alter database recover managed standby database using current logfile disconnect from session;
---check
select switchover_status,open_mode,database_role from v$database;
==============
==============
alter system set log_archive_dest_state_2=enable;
===================
===================
--shutdown stand db
shutdown immediate
Startup mount
---switch to pri
alter database commit to switchover to primary;
alter database open;
---check status
select switchover_status,open_mode,database_role from v$database;
select switchover_status,open_mode,database_role from v$database;
--check gap
select status,gap_status from v$archive_dest_status where rownum<5;
---switch logfile
ALTER SYSTEM ARCHIVE LOG CURRENT ;
==========
主:
/u01/app/11.2.0/grid/bin/srvctl
備:
/u01/app/11.2.0/grid/bin/srvctl
==========
主庫:
wlsqm.jxjg.corp.haier.com/10.138.16.113
備庫:
wl.jxjg.corp.com/10.138.16.118
--stop
/u01/app/11.2.0/grid/bin/srvctl stop scan_listener
/u01/app/11.2.0/grid/bin/srvctl stop scan
/u01/app/11.2.0/grid/bin/srvctl modify scan -n wlsqm.jxjg.corp.haier.com
/u01/app/11.2.0/grid/bin/srvctl modify scan_listener -u
srvctl config scan
srvctl status scan
srvctl status scan_listener
alter system set remote_listener='wlsqm.jxjg.corp.haier.com:1521' scope=both sid='*';
/u01/app/11.2.0/grid/bin/srvctl start scan_listener
srvctl status scan
srvctl status scan_listener
lsnrctl status LISTENER_SCAN1
lsnrctl status LISTENER_SCAN2
lsnrctl status LISTENER_SCAN3
==================
--stop
/u01/app/11.2.0/grid/bin/srvctl stop scan_listener
/u01/app/11.2.0/grid/bin/srvctl stop scan
/u01/app/11.2.0/grid/bin/srvctl modify scan -n wl.jxjg.corp.com
/u01/app/11.2.0/grid/bin/srvctl modify scan_listener -u
srvctl config scan
srvctl status scan
srvctl status scan_listener
alter system set remote_listener='wl.jxjg.corp.com:1521' scope=both sid='*';
/u01/app/11.2.0/grid/bin/srvctl start scan_listener
srvctl status scan
srvctl status scan_listener
lsnrctl status LISTENER_SCAN1
lsnrctl status LISTENER_SCAN2
lsnrctl status LISTENER_SCAN3
lsnrctl service LISTENER_SCAN1
--check status
select INST_ID,switchover_status,open_mode,database_role from gv$database;
--check gap
select status,gap_status from v$archive_dest_status where rownum<5;
set linesize 1000
---check log
select status,gap_status,APPLIED_THREAD#,ERROR from v$archive_dest_status where rownum<5;
--check and switch to stand db
select database_role,switchover_status from v$database;
alter database commit to switchover to physical standby with session shutdown ;
--check
select database_role,switchover_status from v$database;
--open read only
shutdown immediate
startup mount
select switchover_status,open_mode,database_role from v$database;
alter database open read only;
alter database recover managed standby database using current logfile disconnect from session;
---check
select switchover_status,open_mode,database_role from v$database;
==============
==============
alter system set log_archive_dest_state_2=enable;
===================
===================
--shutdown stand db
shutdown immediate
Startup mount
---switch to pri
alter database commit to switchover to primary;
alter database open;
---check status
select switchover_status,open_mode,database_role from v$database;
select switchover_status,open_mode,database_role from v$database;
--check gap
select status,gap_status from v$archive_dest_status where rownum<5;
---switch logfile
ALTER SYSTEM ARCHIVE LOG CURRENT ;
==========
主:
/u01/app/11.2.0/grid/bin/srvctl
備:
/u01/app/11.2.0/grid/bin/srvctl
==========
主庫:
wlsqm.jxjg.corp.haier.com/10.138.16.113
備庫:
wl.jxjg.corp.com/10.138.16.118
--stop
/u01/app/11.2.0/grid/bin/srvctl stop scan_listener
/u01/app/11.2.0/grid/bin/srvctl stop scan
/u01/app/11.2.0/grid/bin/srvctl modify scan -n wlsqm.jxjg.corp.haier.com
/u01/app/11.2.0/grid/bin/srvctl modify scan_listener -u
srvctl config scan
srvctl status scan
srvctl status scan_listener
alter system set remote_listener='wlsqm.jxjg.corp.haier.com:1521' scope=both sid='*';
/u01/app/11.2.0/grid/bin/srvctl start scan_listener
srvctl status scan
srvctl status scan_listener
lsnrctl status LISTENER_SCAN1
lsnrctl status LISTENER_SCAN2
lsnrctl status LISTENER_SCAN3
==================
--stop
/u01/app/11.2.0/grid/bin/srvctl stop scan_listener
/u01/app/11.2.0/grid/bin/srvctl stop scan
/u01/app/11.2.0/grid/bin/srvctl modify scan -n wl.jxjg.corp.com
/u01/app/11.2.0/grid/bin/srvctl modify scan_listener -u
srvctl config scan
srvctl status scan
srvctl status scan_listener
alter system set remote_listener='wl.jxjg.corp.com:1521' scope=both sid='*';
/u01/app/11.2.0/grid/bin/srvctl start scan_listener
srvctl status scan
srvctl status scan_listener
lsnrctl status LISTENER_SCAN1
lsnrctl status LISTENER_SCAN2
lsnrctl status LISTENER_SCAN3
lsnrctl service LISTENER_SCAN1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20747382/viewspace-2130432/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 測試庫採用DataGuard同步,狀態自動切換指令碼指令碼
- oracle dataguard 切換Oracle
- dataguard手動switchover切換步驟及注意的問題 轉
- ssh自動輸入密碼指令碼 切換目錄指令碼密碼指令碼
- Oracle ADG 自動切換指令碼分享Oracle指令碼
- 5.6 MySql主從自動切換指令碼MySql指令碼
- Oracle檢視每小時日誌切換量指令碼Oracle指令碼
- Oracle物理DG自動切換——Dataguard Broker配置Oracle
- Oracle DataGuard切換步驟Oracle
- DataGuard切換保護模式模式
- oracle 之dataguard standby 切換Oracle
- RAC指令碼檢查指令碼
- 【DataGuard】Oracle DataGuard 資料保護模式切換Oracle模式
- 切換代理IP時如何檢查IP?
- Oracle RAC DG手動切換Oracle
- scan ip的手動切換
- ostgreSQL主從切換-手動SQL
- oracle11g dataguard切換Oracle
- Dataguard failover切換實驗AI
- 實戰dataguard主從切換
- postgresql10主從+keepalived高可用自動切換(切換關鍵在指令碼)SQL指令碼
- Oracle 11.2.0.4 physical dataguard和snapshot dataguard切換Oracle
- vue 構建環境切換指令碼Vue指令碼
- dataguard 切換後更換IP,service_name
- Mysql MHA部署-06手動切換MySql
- Oracle DataGuard switchover切換一例Oracle
- DataGuard主備庫切換步驟
- dataguard之物理standby 日誌切換
- 【DATAGUARD】物理dg的switchover切換(五)
- 記憶體檢查指令碼記憶體指令碼
- 自動檢查RAID 資訊的一個指令碼AI指令碼
- 可自動切換 learnku 夜間 / 白天模式的 python 指令碼模式Python指令碼
- dataguard switchover的自動化指令碼實現指令碼
- WPF手動實現切換頁面
- dataguard之物理standby庫failover 切換AI
- 【DATAGUARD】物理dg的failover切換(六)AI
- 【SCN】Oracle檢查scn值指令碼Oracle指令碼
- Linux系統檢查指令碼Linux指令碼