DGbroker故障切換示例

1.主庫故障

SQL> startup
ORACLE instance started.Total System Global Area 1068937216 bytes
Fixed Size            2260088 bytes
Variable Size          910164872 bytes
Database Buffers      150994944 bytes
Redo Buffers            5517312 bytes
ORA-00205: error in identifying control file, check alert log for more info

2.dgmgrl故障提示

DGMGRL> show configuration;Configuration - dgcProtection Mode: MaxPerformanceDatabases:atest1 - Primary databaseatest2 - Physical standby databaseFast-Start Failover: DISABLEDConfiguration Status:
ORA-16525: the Data Guard broker is not yet available
ORA-16625: cannot reach database "atest1"
DGM-17017: unable to determine configuration status

3.執行故障切換

DGMGRL> failover to atest2;
Performing failover NOW, please wait...
Failover succeeded, new primary is "atest2"
DGMGRL> show configuration;Configuration - dgcProtection Mode: MaxPerformanceDatabases:atest2 - Primary databaseatest1 - Physical standby database (disabled)ORA-16661: the standby database needs to be reinstatedFast-Start Failover: DISABLEDConfiguration Status:
SUCCESS

查看狀態如上,提示已切換成功,atest2已成為主庫,而atest1處于故障中。

4.處理故障數據庫(采用rman復制的方式)

  a.故障庫需要啟動到nomount

  b.登錄rman

rlwrap rman target sys/123456@atest2 auxiliary sys/123456@atest1

  c.執行數據庫克隆

RMAN> duplicate target database for standby nofilenamecheck from active database;Starting Duplicate Db at 29-DEC-15
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=1147 device type=DISKcontents of Memory Script:
{backup as copy reusetargetfile  '/u01/app/oracle/product/11.2.0/db1/dbs/orapwatest' auxiliary format '/u01/app/oracle/product/11.2.0/db1/dbs/orapwatest'   ;
}
executing Memory ScriptStarting backup at 29-DEC-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
Finished backup at 29-DEC-15contents of Memory Script:
{sql clone "alter system set  control_files = ''/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl'', ''/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl'' comment=''Set by RMAN'' scope=spfile";backup as copy current controlfile for standby auxiliary format  '/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl';restore clone controlfile to  '/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl' from '/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl';sql clone "alter system set  control_files = ''/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl'', ''/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl'' comment=''Set by RMAN'' scope=spfile";
   shutdown clone immediate;startup clone nomount;
}
executing Memory Scriptsql statement: alter system set  control_files =   ''/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl'', ''/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl'' comment= ''Set by RMAN'' scope=spfileStarting backup at 29-DEC-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/db1/dbs/snapcf_atest.f tag=TAG20151229T212657 RECID=10 STAMP=899760418
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 29-DEC-15Starting restore at 29-DEC-15
using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 29-DEC-15sql statement: alter system set  control_files =   ''/u01/app/oracle/oradata/ATEST/controlfile/o1_mf_c5fr9b0h_.ctl'', ''/u01/app/oracle/fast_recovery_area/ATEST/controlfile/o1_mf_c5fr9b6n_.ctl'' comment= ''Set by RMAN'' scope=spfileOracle instance shut downconnected to auxiliary database (not started)
Oracle instance startedTotal System Global Area    1068937216 bytesFixed Size                     2260088 bytes
Variable Size                910164872 bytes
Database Buffers             150994944 bytes
Redo Buffers                   5517312 bytescontents of Memory Script:
{sql clone 'alter database mount standby database';
}
executing Memory Scriptsql statement: alter database mount standby databasecontents of Memory Script:
{set newname for clone tempfile  1 to new;switch clone tempfile all;set newname for clone datafile  1 to new;set newname for clone datafile  2 to new;set newname for clone datafile  3 to new;set newname for clone datafile  4 to new;set newname for clone datafile  5 to new;set newname for clone datafile  6 to new;backup as copy reusedatafile  1 auxiliary format newdatafile  2 auxiliary format newdatafile  3 auxiliary format newdatafile  4 auxiliary format newdatafile  5 auxiliary format newdatafile  6 auxiliary format new;sql 'alter system archive log current';
}
executing Memory Scriptexecuting command: SET NEWNAMErenamed tempfile 1 to /u01/app/oracle/oradata/ATEST1/datafile/o1_mf_temp_%u_.tmp in control fileexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting backup at 29-DEC-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_system_c7sxhqz0_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_15qq2g9s_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_system_c7sxv77x_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_16qq2gcr_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_system_06qovlhs_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_17qq2gdu_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_sysaux_07qovlkt_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_sysaux_18qq2gf1_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_undotbs1_08qovlnu_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_undotbs1_19qq2gg5_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/ATEST2/datafile/o1_mf_users_09qovlod_.dbf
output file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_users_1aqq2ggc_.dbf tag=TAG20151229T212723
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 29-DEC-15sql statement: alter system archive log currentcontents of Memory Script:
{switch clone datafile all;
}
executing Memory Scriptdatafile 1 switched to datafile copy
input datafile copy RECID=10 STAMP=899760656 file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_17qq2gdu_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=11 STAMP=899760656 file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_sysaux_18qq2gf1_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=12 STAMP=899760656 file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_undotbs1_19qq2gg5_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=13 STAMP=899760656 file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_users_1aqq2ggc_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=14 STAMP=899760656 file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_15qq2g9s_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=15 STAMP=899760656 file name=/u01/app/oracle/oradata/ATEST1/datafile/o1_mf_system_16qq2gcr_.dbf
Finished Duplicate Db at 29-DEC-15

  d.刪除和重新添加備庫

DGMGRL> remove database atest1;
Removed database "atest1" from the configuration
DGMGRL> add database atest1;
Database "atest1" added
DGMGRL> disable configuration;
Disabled.
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;Configuration - dgcProtection Mode: MaxPerformanceDatabases:atest2 - Primary databaseatest1 - Physical standby databaseFast-Start Failover: DISABLEDConfiguration Status:
SUCCESS

  e.把故障庫啟動到open狀態

SQL> alter database open;Database altered.

5.如果需要,可以把主備庫切換切回來

DGMGRL> switchover to atest1;
Performing switchover NOW, please wait...
Operation requires a connection to instance "atest" on database "atest1"
Connecting to instance "atest"...
Connected.
New primary database "atest1" is opening...
Operation requires startup of instance "atest" on database "atest2"
Starting instance "atest"...
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "atest1"
DGMGRL> show configuration;Configuration - dgcProtection Mode: MaxPerformanceDatabases:atest1 - Primary databaseatest2 - Physical standby databaseFast-Start Failover: DISABLEDConfiguration Status:
SUCCESS

?

轉載于:https://www.cnblogs.com/vijayfly/p/5086456.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/257891.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/257891.shtml
英文地址,請注明出處:http://en.pswp.cn/news/257891.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

html 自動觸發 事件,js自動觸發事件自定義事件

在有些情況下,我們需要程序邏輯自動觸發元素的事件,例如js提供了click(), form提供了reset(),submit()等方法!在jquery中提供了trigger()方法幫助我們自動觸發事件,原理是什么呢?接下來讓我們一探究竟&…

Storm編程入門API系列之Storm的可靠性的ACK消息確認機制

概念,見博客 Storm概念學習系列之storm的可靠性 什么業務場景需要storm可靠性的ACK確認機制? 答:想要保住數據不丟,或者保住數據總是被處理。即若沒被處理的,得讓我們知道。 public void nextTuple() {num;System.out.…

關于 php mysql pdo cannot find driver 解決方案

1、下載 文件 或者 進入 在PHP源碼包中進入ext/pdo_mysql http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz 2、解壓文件tar zxvf PDO_MYSQL-1.0.2.tgz 3、配置和編譯文件cd PDO_MYSQL-1.0.2/usr/local/php/bin/phpize./configure –with-php-config/usr/local/php/bin/php-config…

iOS網絡編程開發-數據加密

iOS網絡編程開發-數據加密 一、簡單說明 1.說明 在開發應用的時候,數據的安全性至關重要,而僅僅用POST請求提交用戶的隱私數據,還是不能完全解決安全問題。 如:可以利用軟件(比如Charles)設置代理服務器&am…

Codeforces 821C - Okabe and Boxes

821C - Okabe and Boxes 思路&#xff1a;模擬。因為只需要比較棧頂和當前要刪除的值就可以了&#xff0c;所以如果棧頂和當前要刪除的值不同時&#xff0c;棧就可以清空了(因為下一次的棧頂不可能出現在前面那些值中)。 代碼&#xff1a; #include<bits/stdc.h> using n…

Java中forEach, 用來遍歷數組

這里的for是Java中forEach, 用來遍歷數組的。for(int i : d) 就是遍歷int型數組d的 每一次訪問數組d的時候讀取的數據放入int型的i中。和for(int i0;i<d.length();i)是一樣的&#xff0c;但是forEach的可用場合較多。public class e1 {public static void main(String[] …

HDU -2546飯卡(01背包+貪心)

這道題有個小小的坎&#xff0c;就是低于5塊不能選&#xff0c;大于5塊&#xff0c;可以任意選&#xff0c;所以就在初始條件判斷一下剩余錢數&#xff0c;然后如果大于5的話&#xff0c;這時候就要用到貪心的思想&#xff0c;只要大于等于5&#xff0c;先找最大的那個&#xf…

圖片向上滾動字幕代碼html,如何通過制作滾動字幕的軟件實現這種片尾的向上滾動字幕效果...

如何制作滾動字幕 特殊滾動類字幕制作 向上向下向左向右滾動字幕制作效果 含拖動和消失全程 真是酷B了爽呆了&#xff0c;趕快學習吧&#xff01;電影、連續劇等影視作品片尾&#xff0c;都會在播放片尾曲時&#xff0c;出現向上滾動的字幕&#xff0c;顯示演員表、導演、編劇等…

【圖片服務器】搭建Nginx圖片服務器

一、安裝Nginx 二、安裝vsftpd 三、開始搭建Nginx圖片服務器 1、效果 例如&#xff1a;圖片通過ftp服務上傳到/home/ftpuser/www/images目錄下&#xff0c;我想通過訪問Nginx服務器來訪問ftp目錄下的圖片文件&#xff0c;該url為http://192.168.128.128/images/xxx.jpg。即使用…

JavaScript數組去重

1、數組去重&#xff1b; Array類型并沒有提供去重復的方法&#xff0c;如果要把數組的重復元素干掉&#xff0c;那得自己想辦法&#xff1a; 方法一&#xff1a;利用indexOf方法&#xff1b; var aa[1,3,5,4,3,3,1,4] function arr(arr) {var result[]for(var i0; i<arr.le…

html怎么讓方塊自動旋轉,如何使用純CSS實現一個圓環旋轉錯覺的動畫效果(附源碼)...

本篇文章給大家帶來的內容是關于如何使用純CSS實現一個圓環旋轉錯覺的動畫效果&#xff0c;有一定的參考價值&#xff0c;有需要的朋友可以參考一下&#xff0c;希望對你有所幫助。效果預覽源代碼下載https://github.com/comehope/front-end-daily-challenges代碼解讀定義 dom&…

同志亦凡人第五季/全集BQueer As Folk 5迅雷下載

同志亦凡人 第五季 Queer as Folk Season 5 (2005) 本季看點&#xff1a;這是一群生活在匹茲堡男人和男人&#xff0c;女人和女人的故事。在他們的王國里有各色人物。王國的國王Brian&#xff08;葛爾?哈羅德 Gale Harold 飾&#xff09;&#xff0c;只追求性不問愛&#xff1…

2016,請不要在公司混日子!

1、無論為誰打工&#xff0c;要為自己學東西&#xff0c;客觀上為公司創造價值。 我自己當年&#xff0c;無論我在方正給國內企業工作&#xff0c;還是我在雅虎給外國人工作&#xff0c;我都跟別人最大的不一樣&#xff0c;我從來不覺得我在給他們打工&#xff0c;我真的可能是…

數據庫作業[定時執行任務]的創建

--每月執行的作業 exec p_createjob jobnamemm,sqlselect * from syscolumns,freqtypemonth --每周執行的作業 exec p_createjob jobnameww,sqlselect * from syscolumns,freqtypeweek --每日執行的作業 exec p_createjob jobnamea,sqlselect * from syscolumns --每日執行的作…

《算法之道》精華 經典算法部分

《算法之道》精華 經典算法部分 本書作者鄒恒明&#xff0c;作者另有一本書《數據結構之弦》&#xff0c;以及《操作系統之哲學原理》都是非常好的書這本書能夠算得上是深入淺出&#xff0c;文筆非常好。作者加入了非常多自己的思考本文包含經典算法部分第十章 排序與次序 插入…

學生社團網站html,學生社團活動平臺的設計與實現.docx

PAGE 67學生社團活動平臺的設計與實現摘 要本系統立足于實現社團活動申請與審批、資源申請與審批等工作&#xff0c;面向高校中所有的社團&#xff0c;建立一個使用便捷、可靠的社團活動平臺&#xff0c;從而更方便地進行社團活動的申請、社團資源的申請及相應審批&#xff0c;…

tornado 學習筆記17 HTTPServerRequest分析

代表Http請求。 所有的屬性都是字符串型。 17.1 屬性 (1) method:請求方法類型&#xff0c;比如”GET”、”POST” (2) uri: 請求的uri (3) path:請求路徑&#xff0c;作為uri的一部分。 (4) query&#xff1a;查詢字符串&#xff1a;作為uri的一部分。 (5) version&#xff1a…

Android 動畫效果及Interpolator和AnimationListener的使用

轉載http://www.itzhai.com/android-animation-used-to-achieve-control-of-animation-effects-and-use-of-interpolator-and-animationlistener.htmlandroid:interpolator可能有很多人不理解它的用法&#xff0c;文檔里說的也不太清楚&#xff0c;其實很簡單&#xff0c;看下面…

html怎么使圖片無法另存為,如何禁止圖片另存為?禁止網頁另存為到本地的方法...

在很多企事業單位&#xff0c;處于商業機密保護的需要&#xff0c;常常需要禁止一些文件格式的“另存為”功能&#xff0c;防止通過“另存為”將文件另行保存&#xff0c;據為己有的目的&#xff1b;尤其是在局域網中訪問服務器共享文件的時候&#xff0c;常常需要禁止將共享文…

正益工場為京西創客工場輸送雙創“軟”實力

12月30日&#xff0c;中關村門頭溝科技園“京西創客工場”正式揭牌&#xff0c;這里將成為京西“生態科創”的聚集地。正益工場作為唯一入駐的“移動互聯網”雙創生態平臺&#xff0c;將為雙創輸送“移動技術移動模式”等軟實力。北京市副市長隋振江、市政協、中關村管委會等領…