您好,登錄后才能下訂單哦!
本篇內容介紹了“standby database有哪些日常維護”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
1.停止Standby
select process, status from v$managed_standby; --查看備庫是否在應用日志進行恢復
alter database recover managed standby database cancel;
shutdown immediate;
2.切換到只讀模式
-----由shutdown模式切換到只讀模式-------
startup nomount;
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 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 with session shutdown;-- 主庫有會話連接的時候
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;
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;
7.取消自動恢復模式
alter database recover managed standby database cancel;
alter database recover managed standby database finish;
alter database recover managed standby database finish force;
“standby database有哪些日常維護”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。