十年網(wǎng)站開發(fā)經(jīng)驗 + 多家企業(yè)客戶 + 靠譜的建站團隊
量身定制 + 運營維護+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
這篇文章主要介紹“oracle11g dataguard如何切換”,在日常操作中,相信很多人在oracle11g dataguard如何切換問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”oracle11g dataguard如何切換”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!
建網(wǎng)站原本是網(wǎng)站策劃師、網(wǎng)絡(luò)程序員、網(wǎng)頁設(shè)計師等,應(yīng)用各種網(wǎng)絡(luò)程序開發(fā)技術(shù)和網(wǎng)頁設(shè)計技術(shù)配合操作的協(xié)同工作。成都創(chuàng)新互聯(lián)專業(yè)提供網(wǎng)站建設(shè)、網(wǎng)站設(shè)計,網(wǎng)頁設(shè)計,網(wǎng)站制作(企業(yè)站、響應(yīng)式網(wǎng)站建設(shè)、電商門戶網(wǎng)站)等服務(wù),從網(wǎng)站深度策劃、搜索引擎友好度優(yōu)化到用戶體驗的提升,我們力求做到極致!
1.查看主庫是否滿足切換條件
SQL> select switchover_status from v$database; SWITCHOVER_STATUS ---------------------------------------- TO STANDBY
有時候會顯示 SESSION ACTIVE,這表示當(dāng)前還有活動的會話連接。
2.執(zhí)行下面的命令切換
SQL> alter database commit to switchover to physical standby; Database altered.
如果第一步切換條件查看顯示 SESSION ACTIVE,那么在這里使用下面命令
SQL> alter database commit to switchover to physical standby WITH SESSION SHUTDOWN;
3.關(guān)閉數(shù)據(jù)庫重啟到 mount
SQL> shutdown immediate; ORA-01012: not logged on SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options [oracle@oraclerac2 ~]$ sqlplus "/ as sysdba" SQL*Plus: Release 11.2.0.4.0 Production on Wed Aug 1 17:45:33 2018 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount; ORACLE instance started. Total System Global Area 2.1379E+10 bytes Fixed Size 2262656 bytes Variable Size 2885683584 bytes Database Buffers 1.8455E+10 bytes Redo Buffers 36073472 bytes Database mounted.
4.用 Read Only 模式打開
SQL> alter database open read only; Database altered.
5.啟動 Redo 應(yīng)用模式
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION; Database altered.
6.切換后查看角色
SQL> select database_role,switchover_status from v$database; DATABASE_ROLE SWITCHOVER_STATUS -------------------------------- ---------------------------------------- PHYSICAL STANDBY TO PRIMARY
7.以上操作都是原來的主庫完成的,下面的操作在原來的備庫完成
8.查看 Standby Database 是否滿足切換條件
SQL> select database_role,switchover_status from v$database; DATABASE_ROLE SWITCHOVER_STATUS -------------------------------- ---------------------------------------- PHYSICAL STANDBY TO PRIMARY
9.執(zhí)行下面命令進行切換
SQL> alter database commit to switchover to primary; Database altered.
10.打開數(shù)據(jù)庫
SQL> alter database open; Database altered.
11.切換后查看角色
SQL> select database_role,switchover_status from v$database; DATABASE_ROLE SWITCHOVER_STATUS -------------------------------- ---------------------------------------- PRIMARY TO STANDBY
到此,關(guān)于“oracle11g dataguard如何切換”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
當(dāng)前名稱:oracle11gdataguard如何切換
網(wǎng)站網(wǎng)址:http://www.jiaotiyi.com/article/gsgeji.html