這篇文章主要介紹“oracle11g dataguard如何切換”,在日常操作中,相信很多人在oracle11g dataguard如何切換問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”oracle11g dataguard如何切換”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!
1.查看主庫是否滿足切換條件
SQL> select switchover_status from v$database; SWITCHOVER_STATUS ---------------------------------------- TO STANDBY
有時(shí)候會顯示 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í)行下面命令進(jìn)行切換
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é)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!
分享文章:oracle11gdataguard如何切換-創(chuàng)新互聯(lián)
本文鏈接:http://chinadenli.net/article6/jjeog.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供商城網(wǎng)站、做網(wǎng)站、品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、搜索引擎優(yōu)化、移動網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容