DataGuard 日常維護命令整理
1.停止Standby
select process, status from v$managed_standby; --檢視備庫是否在應用日誌進行恢復
alter database recover managed standby database cancel;
shutdown immediate;
shutdown immediate;
2.切換到只讀模式
-----由shutdown模式切換到只讀模式-------
startup nomount;
alter database mount standby database;
alter database open read only;
alter database mount standby database;
alter database open read only;
-----由應用日誌模式切換到只讀模式-------
alter database recover managed standby database cancel; -- 取消日誌應用alter database open read only;
3.切換回管理恢復模式
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session; -- 啟動日誌應用
alter database mount standby database;
alter database recover managed standby database disconnect from session; -- 啟動日誌應用
alter database recover managed standby database using current logfile disconnect from session;
4.主庫和備庫之間角色切換
4.1 主庫切換為備庫
alter database commit to switchover to physical standby;
alter database commit to switchover to physical standby;
alter database commit to switchover to physical standby with session shutdown;-- 主庫有會話連線的時候
shutdown immediate
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;
shutdown immediate
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;
4.2 從庫切換為主庫
alter database commit to switchover to primary;
shutdown immediate;
startup;
alter system switch logfile;
shutdown immediate;
startup;
alter system switch logfile;
5.備庫自動使用主庫傳過來的日誌進行恢復
alter database recover automatic standby database;
6.更改保護模式
alter database set standby database to maximize protection;
alter database set standby database to maximize availability;
alter database set standby database to maximize performancen;
alter database set standby database to maximize availability;
alter database set standby database to maximize performancen;
7.取消自動恢復模式
alter database recover managed standby database cancel;
alter database recover managed standby database finish;
alter database recover managed standby database finish force;
alter database recover managed standby database finish;
alter database recover managed standby database finish force;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15592508/viewspace-735626/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DBA日常維護SQL整理SQL
- Dataguard日常維護及故障解決
- RAC日常維護命令
- 【MHA】mha日常維護命令
- rac叢集日常維護命令
- IBM AIX日常維護命令IBMAI
- 【轉】ORACLE CRS日常維護命令Oracle
- Oracle RAC日常基本維護命令Oracle
- nginx日常維護常用命令Nginx
- 【轉】Oracle RAC日常基本維護命令Oracle
- 收集oracle日常維護的工作命令Oracle
- linux中oracle的日常維護命令LinuxOracle
- Oracle DataGuard 常用維護命令參考手冊Oracle
- Oracle RAC 日常維護Oracle
- PG日常維護(一)
- Oracle OGG日常維護Oracle
- Gerrit日常維護記錄
- 針對oracle日常維護Oracle
- ORACLE DG 日常維護常用SQLOracleSQL
- DBA日常維護SQL指令碼SQL指令碼
- 物理standby database的日常維護Database
- OGG goldengate 日常維護Go
- Oracle資料庫日常維護Oracle資料庫
- Oracle DBA 日常維護手冊Oracle
- VMware日常維護工作內容
- Oracle DataGuard 常用維護命令參考手冊 [轉載記錄]Oracle
- ogg日常運維命令運維
- 伺服器的日常維護方式伺服器
- EBS DBA日常維護使用的sqlSQL
- OCR維護命令
- RAC維護命令
- Linux日常運維管理命令Linux運維
- 膝上型電腦日常維護的六個常識,筆記本日常維護小竅門筆記
- DataGuard 日常操作-02
- dataguard環境中的密碼維護密碼
- Dataguard 維護操作-01-- MRP process
- 電腦日常保養維護指南(轉)
- VotingDisk維護命令