Oracle數(shù)據(jù)庫11gActiveDataGuard構(gòu)建標準規(guī)范-V0_第1頁
Oracle數(shù)據(jù)庫11gActiveDataGuard構(gòu)建標準規(guī)范-V0_第2頁
Oracle數(shù)據(jù)庫11gActiveDataGuard構(gòu)建標準規(guī)范-V0_第3頁
Oracle數(shù)據(jù)庫11gActiveDataGuard構(gòu)建標準規(guī)范-V0_第4頁
Oracle數(shù)據(jù)庫11gActiveDataGuard構(gòu)建標準規(guī)范-V0_第5頁
已閱讀5頁,還剩39頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領

文檔簡介

1、 PAGE 44Oraclle數(shù)據(jù)庫庫11GActivve DaataGuuard構(gòu)構(gòu)建標準規(guī)規(guī)范部 門:信息息技術(shù)部SSA/DBBA組版 本 號號: V1.0發(fā)布日期:2015-05-13目 錄TOC o 1-3 h z u HYPERLINK l _Toc405996450 一、Acttive DataaGuarrd實施規(guī)規(guī)范 PAGEREF _Toc405996450 h 4 HYPERLINK l _Toc405996451 1.1AActivve DaataGuuard實實施前提條條件 PAGEREF _Toc405996451 h 4 HYPERLINK l _Toc4059964

2、52 1.1.11主備數(shù)據(jù)據(jù)庫環(huán)境介介紹 PAGEREF _Toc405996452 h 4 HYPERLINK l _Toc405996453 1.1.22Actiive DDataGGuardd實施條件件 PAGEREF _Toc405996453 h 7 HYPERLINK l _Toc4059964554 1.1.3Actiive DDataGGuardd實施準備備工作(創(chuàng)創(chuàng)建LISSTENEER和相應應TNS) PAGEREF _Toc405996454 h 9 HYPERLINK l _Toc405996455 1.2備備數(shù)據(jù)庫初初始化 PAGEREF _Toc405996455

3、h 16 HYPERLINK l _Toc405996456 1.2.11通過dupplicaate aactivve daatabaase初始始化備數(shù)據(jù)據(jù)庫(主數(shù)據(jù)庫庫備份無需需存在) PAGEREF _Toc405996456 h 16 HYPERLINK l _Toc405996457 1.2.22通過帶庫庫備份恢復復初始化備備數(shù)據(jù)庫(主數(shù)據(jù)庫庫備份必須須存在) PAGEREF _Toc405996457 h 22 HYPERLINK l _Toc405996458 1.3追追加歸檔日日志文件 PAGEREF _Toc405996458 h 33 HYPERLINK l _Toc4059

4、96459 1.4啟啟動Acttive DataaGuarrd PAGEREF _Toc405996459 h 34 HYPERLINK l _Toc405996460 1.5將將備節(jié)點的的數(shù)據(jù)庫加加入到CRRS中進行行管理 PAGEREF _Toc405996460 h 34 HYPERLINK l _Toc405996461 1.6備備數(shù)據(jù)庫歸歸檔日志文文件刪除 PAGEREF _Toc405996461 h 35 HYPERLINK l _Toc405996462 1.7應應用訪問備備數(shù)據(jù)庫TTNS配置置 PAGEREF _Toc405996462 h 37 HYPERLINK l _T

5、oc405996463 1.8主主數(shù)據(jù)庫和和備數(shù)據(jù)庫庫SwittchOvver和Failloverr切換 PAGEREF _Toc405996463 h 37 HYPERLINK l _Toc405996464 1.8.11SwittchOvver測試試 PAGEREF _Toc405996464 h 37 HYPERLINK l _Toc440599964655 1.8.2FaillOverr測試 PAGEREF _Toc405996465 h 39 HYPERLINK l _Toc405996466 1.9日日常維護 PAGEREF _Toc405996466 h 39 HYPERLINK

6、 l _Toc405996467 1.9.11DataaGuarrd運行狀狀態(tài)檢查 PAGEREF _Toc405996467 h 39 HYPERLINK l _Toc4059964668 1.9.2主數(shù)據(jù)庫庫和備數(shù)據(jù)據(jù)庫起停順順序 PAGEREF _Toc405996468 h 39 HYPERLINK l _Toc405996469 1.9.33主數(shù)據(jù)庫庫維護操作作 PAGEREF _Toc405996469 h 40一、Acttive DataaGuarrd實施規(guī)規(guī)范Activve DaataGuuard實實施前提條條件數(shù)據(jù)冗余保保護和磁盤盤組劃分數(shù)據(jù)冗余:存儲以共共享的方式式連接數(shù)據(jù)

7、據(jù)庫節(jié)點主主機,在數(shù)數(shù)據(jù)冗余上上建議存儲儲層通過傳傳統(tǒng)raiid機制建建立數(shù)據(jù)保保護機制,AASM磁盤盤組可以不不要設置數(shù)數(shù)據(jù)冗余保保護,即用用來存儲DDB的ASSM磁盤組組冗余方式式為Extternaal.DataGGuardd三種保護護模式:最最大化保護護、最大有效效性、最大大性能。為為了降低對對主數(shù)據(jù)庫庫的影響,以以下采用最最大性能模模式進行DDataGGuardd配置。DataGGuardd配置中備備數(shù)據(jù)庫類類型主要有有三種:邏邏輯備數(shù)據(jù)據(jù)庫、物理理備數(shù)據(jù)庫庫和基于快快照的備數(shù)數(shù)據(jù)庫,以以下采用物物理備數(shù)據(jù)據(jù)庫方式進進行DattaGuaard配置置。DataGGuardd配置中的的主數(shù)

8、據(jù)庫庫和備數(shù)據(jù)據(jù)庫之間數(shù)數(shù)據(jù)同步是是通過TCCP/IPP網(wǎng)絡通信信實現(xiàn)的,為為了盡可能能降低網(wǎng)絡絡帶寬的競競爭和對現(xiàn)現(xiàn)有應用程程序性能問問題,建議議在主數(shù)據(jù)據(jù)庫主機和和備數(shù)據(jù)庫庫主機之間間構(gòu)建專屬屬于DattaGuaard的網(wǎng)網(wǎng)絡,即需需要添加新新的網(wǎng)卡等等硬件資源源搭建專屬于于DataaGuarrd的網(wǎng)絡絡。另外,可以以在主數(shù)據(jù)據(jù)庫和備數(shù)數(shù)據(jù)庫上創(chuàng)創(chuàng)建專屬于于DataaGuarrd的數(shù)據(jù)據(jù)庫監(jiān)聽器器,如LIISTENNER_AADG,監(jiān)監(jiān)聽端口為為15255,如果主主數(shù)據(jù)庫和和備數(shù)據(jù)庫庫在不同網(wǎng)網(wǎng)段上且存存在防火墻墻,需要在在防火墻上上開通15525端口口。不過為為了便于管管理,本規(guī)規(guī)范使用

9、默默認的LIISTENNER監(jiān)聽聽,端口為為15211。需要注意,主主數(shù)據(jù)庫如如果和sttandbby數(shù)據(jù)庫庫設置了相相同的DBB_UNIIQUE_NAMEE,則在做做swittchovver時,備備庫會報“ORA-011002 caannott mouunt ddatabbase in EEXCLUUSIVEE modde”??赡苓€還存在其他他問題。所所以需要設設置PRIIMARYY以及STTANDBBY的數(shù)據(jù)據(jù)庫的DBB_UNIIQUE_NAMEE為不同的的值。主備數(shù)據(jù)庫庫環(huán)境介紹紹以下以ORRSS環(huán)境境介紹主數(shù)數(shù)據(jù)庫環(huán)境境和備數(shù)據(jù)據(jù)庫環(huán)境:主備環(huán)境主機名IP地址描述p3orsssetll

10、1、 p3oorsseetl2主數(shù)據(jù)庫環(huán)環(huán)境p3orsssetll1-viip21.1225.444.81公網(wǎng)IP地地址VIPP21.1225.444.81DG專署IIP地址,由由于專署與與DG的網(wǎng)網(wǎng)絡不存在在,因此DDG專署IIP地址采采用公網(wǎng)IIP地址p3orsssetll2-viip21.1225.444.84公網(wǎng)IP地地址VIPP21.1225.444.84DG專署IIP地址,由由于專署與與DG的網(wǎng)網(wǎng)絡不存在在,因此DDG專署IIP地址采采用公網(wǎng)IIP地址p3orsssadgg1、p3orrssaddg2備數(shù)據(jù)庫環(huán)環(huán)境p3orsssadgg1-viip21.1225.444.97公網(wǎng)I

11、P地地址VIPP21.1225.444.97DG專署IIP地址,由由于專署與與DG的網(wǎng)網(wǎng)絡不存在在,因此DDG專署IIP地址采采用公網(wǎng)IIP地址p3orsssadgg2-viip21.1225.444.1000公網(wǎng)IP地地址VIPP21.1225.444.1000DG專署IIP地址,由由于專署與與DG的網(wǎng)網(wǎng)絡不存在在,因此DDG專署IIP地址采采用公網(wǎng)IIP地址以下主數(shù)據(jù)據(jù)庫主機名名為:p33orsssetl11和p3orrssettl2,備數(shù)據(jù)庫主主機名為:p3orrssaddg1和p3orrssaddg2主數(shù)據(jù)庫ooraORRSS基本本信息如下下:數(shù)據(jù)庫syys用戶密密碼主數(shù)據(jù)庫和和備數(shù)據(jù)

12、庫庫密碼必須須一致,假假設為orraclee123Grid和和數(shù)據(jù)庫版版本11G的基基線版本ORACLLE_SIID環(huán)境變變量oraORRSS1和和oraOORSS22GRID 軟件ORRACLEE_BASSE目錄/oraccle/aapp/ooraclleGRID 軟件ORRACLEE_HOMME目錄grid用用戶的$OORACLLE_HOOME變量量DB軟件OORACLLE_BAASE目錄錄/oraccle/aapp/ooraclleDB軟件OORACLLE_HOOME目錄錄oraclle用戶的的$ORAACLE_HOMEE變量DG專署監(jiān)監(jiān)聽器(為便于管管理維護,本本規(guī)范未使使用LISST

13、ENEER_ADDG專用監(jiān)監(jiān)聽)LISTEENERDG專署監(jiān)監(jiān)聽器端口口(為便于管管理維護,本本規(guī)范未使使用15225專用監(jiān)監(jiān)聽)1521初始化參數(shù)數(shù) DB_NAAME=ooraORRSSDB_UNNIQUEE_NAMME= ooraORRSSCOMPAATIBLLE主數(shù)據(jù)據(jù)庫和備數(shù)數(shù)據(jù)庫必須須一致物理容量歸檔模式歸檔模式歸檔目錄/archh 共享GPFFS文件系系統(tǒng)每天產(chǎn)生的的歸檔日志志(月初歸歸檔日志量量非常大,需需要重點關(guān)關(guān)注DG同同步性能)注意:在業(yè)業(yè)務高峰時時,如果主主數(shù)據(jù)庫產(chǎn)產(chǎn)生大量歸歸檔日志文文件會導致致備數(shù)據(jù)庫庫與主數(shù)據(jù)據(jù)庫同步產(chǎn)產(chǎn)生數(shù)據(jù)延延遲現(xiàn)象。備數(shù)據(jù)庫aadgORRSSB

14、基本信息息如下:數(shù)據(jù)庫syys用戶密密碼主數(shù)據(jù)庫和和備數(shù)據(jù)庫庫密碼必須須一致,假假設為oraclle1233Grid和和數(shù)據(jù)庫版版本11G的基基線版本,與與主庫保持持一致ORACLLE_SIID環(huán)境變變量adgORRSSB1和adggORSSSB2注意:備數(shù)數(shù)據(jù)庫 OORACLLE_SIID 環(huán)境境變量與備備數(shù)據(jù)庫的的DB_UUNIQUUE_NAAME保持持一致GRID 軟件ORRACLEE_BASSE目錄/oraccle/aapp/ooraclleGRID 軟件ORRACLEE_HOMME目錄grid用用戶的$OORACLLE_HOOME變量量DB軟件OORACLLE_BAASE目錄錄/or

15、accle/aapp/ooraclleDB軟件OORACLLE_HOOME目錄錄oraclle用戶的的$ORAACLE_HOMEE變量DG專署監(jiān)監(jiān)聽器(為便于管管理維護,本本規(guī)范未使使用LISSTENEER_ADDG專用監(jiān)監(jiān)聽)LISTEENERDG專署監(jiān)監(jiān)聽器端口口(為便于管管理維護,本本規(guī)范未使使用15225專用監(jiān)監(jiān)聽)1521初始化參數(shù)數(shù) DB_NAAME=ooraORRSSDB_UNNIQUEE_NAMME= aadgORRSSBCOMPAATIBLLE主數(shù)據(jù)據(jù)庫和備數(shù)數(shù)據(jù)庫必須須一致注意: 備備數(shù)據(jù)庫DDB_NAAME值與與主數(shù)據(jù)庫庫設置必須須一致備數(shù)據(jù)庫DDB_UNNIQUEE_N

16、AMME與主數(shù)數(shù)據(jù)庫設置置不一致另外需要注注意,備庫庫監(jiān)聽服務務以及數(shù)據(jù)據(jù)文件路徑徑與DB_UUNIQUUE_NAAME值相相關(guān)物理容量歸檔模式歸檔模式歸檔目錄/archh 共享GPFFS文件系系統(tǒng)每天產(chǎn)生的的歸檔日志志(月初歸歸檔日志量量非常大,需需要重點關(guān)關(guān)注DG同同步性能)Activve DaataGuuard實實施條件實施Acttive DataaGuarrd的前提提條件如下下:主數(shù)據(jù)庫主主機和備數(shù)數(shù)據(jù)庫主機機硬件平臺一一致,如都都為IBMM主機主數(shù)據(jù)庫和和備數(shù)據(jù)庫庫Oraccle軟件件安裝成功功,且數(shù)據(jù)據(jù)庫版本一一致且都為為3備數(shù)據(jù)庫存存儲空間剩剩余大小不不小于主數(shù)數(shù)據(jù)庫存儲儲空間大

17、小小用戶griid登錄主主數(shù)據(jù)庫節(jié)點點p3orrssettl1$ asmmcmdASMCMMD llsdg輸出部分見見Totaal_MBB列用戶griid登錄備備數(shù)據(jù)庫節(jié)點點p3orrssaddg1$ asmmcmdASMCMMD llsdg輸出部分見見Usabble_ffile_MB列對比主數(shù)據(jù)據(jù)庫ASMM磁盤組(假設磁盤盤組類型為為Exteernall)的Totaal_MBB列值和備備數(shù)據(jù)庫AASM磁盤盤組的Ussablee_fille_MBB列值,確確保備數(shù)據(jù)據(jù)庫ASMM磁盤組的的Usabble_ffile_MB列值值不小于主主數(shù)據(jù)庫AASM磁盤盤組的Tootal_MB列值值。主數(shù)據(jù)庫數(shù)

18、數(shù)據(jù)庫運行行正常且工工作在arrchivvelogg模式下Oraclle用戶登登錄主數(shù)據(jù)據(jù)庫節(jié)點pp3orsssetll1主機查查詢數(shù)據(jù)庫庫是否置于于archhivellog模式式$ sqllpluss / aas syysdbaaSQL seleect llog_mmode fromm v$ddatabbase; 返回結(jié)果為為ARCHHIVELLOG或者者NOARRCHIVVELOGG如果返回值值為NOARCCHIVEELOG,則則需要執(zhí)行行以下步驟驟步驟1:創(chuàng)創(chuàng)建歸檔日日志文建對對應的文件件系統(tǒng)如果該文件件系統(tǒng)為本本地文件系系統(tǒng),則舊舊主機每個個節(jié)點需要要創(chuàng)建并mmountt至/arrch

19、下,如如果為GPPFS文件件系統(tǒng),則則舊主機每每個節(jié)點需需要mouunt至/archh下,并且且oraccle操作作系統(tǒng)用戶戶對其具有有讀寫權(quán)限限步驟2:修修改初始化化參數(shù)loog_arrchivve_deest_11SQL alteer syystemm sett logg_arcchivee_desst_1=locaationn=/arrch scoope=bboth sid=*;SQL show paraameteer loog_arrchivve_deest_11步驟3:確確認初始化化參數(shù)loog_arrchivve_foormatt參數(shù)值為為%t_%s_%rr.dbffSQLssho

20、w paraameteer loog_arrchivve_foormatt 返回結(jié)果果為%t_%s_%r.dbbf步驟4:登登陸每個主主數(shù)據(jù)庫節(jié)節(jié)點主機環(huán)環(huán)境上關(guān)閉閉數(shù)據(jù)庫$sqlpplus / ass syssdbaSQLsshutddown immeediatte;步驟5:登登陸主數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorsseetl1啟啟動數(shù)據(jù)庫庫至mouuntedd狀態(tài)后設設置數(shù)據(jù)庫庫為arcchiveelog模模式$sqlpplus / ass syssdba SQLsstarttup mmountt;SQLaalterr dattabasse ARRCHIVVELOGG;SQLaalterr d

21、attabasse oppen;步驟6:登登陸主數(shù)據(jù)據(jù)庫其他節(jié)節(jié)點主機pp3orsssetll2啟動數(shù)數(shù)據(jù)庫$sqlpplus / ass syssdba SQLsstarttup 步驟7:驗驗證歸檔日日志文件是是否能正常常生成$sqlpplus / ass syssdba SQLaalterr sysstem archhive log currrent;SQLaalterr sysstem archhive log currrent;$ls l /aarch每個節(jié)點主主機下/aarch目目錄下會有有新文建生生成主數(shù)據(jù)庫數(shù)數(shù)據(jù)庫歸檔檔日志文件件目錄不能能通過loog_arrchivve_dee

22、st初始始化參數(shù)設設置,必須須通過loog_arrchivve_deest_nn初始化參參數(shù)設置Oraclle用戶登登錄主數(shù)據(jù)據(jù)庫所有節(jié)節(jié)點主機查查詢數(shù)據(jù)庫庫是否置于于archhivellog模式式$ sqllpluss / aas syysdbaaSQL showw parrametter llog_aarchiive_ddest_1主數(shù)據(jù)庫數(shù)數(shù)據(jù)庫需要要啟動foorce loggging功功能Oraclle用戶登登錄主數(shù)據(jù)據(jù)庫節(jié)點pp3orsssetll1主機設設置forrce lloggiing$ sqllpluss / aas syysdbaa SQL seleect FFORCEE_

23、LOGGGINGG froom v$dataabasee;FORNO 如果返回值值為:NOO,則需要要執(zhí)行以下下操作;如如果返回值值為YESS不需要執(zhí)執(zhí)行以下操操作SQL alteer daatabaase fforcee logggingg;Databbase alteered.SQL seleect FFORCEE_LOGGGINGG froom v$dataabasee;FORYES確認返返回結(jié)果為為YES主數(shù)據(jù)庫和和備數(shù)據(jù)庫庫sys用用戶的密碼碼一樣,并并且密碼文文件必須存存在且主數(shù)數(shù)據(jù)庫初始始化參數(shù)rremotte_loogin_passsworddfilee必須設置置為EXCCLU

24、SIIVEOraclle用戶登登錄主數(shù)據(jù)據(jù)庫所有節(jié)節(jié)點主機$ sqllpluss / aas syysdbaaSQL showw parrametter rremotte_loogin_passsworddfileeActivve DaataGuuard實實施準備工工作(創(chuàng)建建LISTTENERR和相應TTNS)用戶griid登錄主主節(jié)點p33orsssetl11創(chuàng)建LISSTENEER監(jiān)聽器器(紅色部部分為liistenner名字字以及端口口,根據(jù)需需要進行修修改,一般般主庫默認認已有監(jiān)聽聽,此步一一般不需要要執(zhí)行)srvcttl addd liistenner -l lissteneer

25、-p 15211srvcttl sttart listtenerr -l listtenerr檢查LISSTENEER狀態(tài),狀狀態(tài)為ONNLINEEp3orrssettl1:ggrid:/hoome/ggridcrscctl sstat res -tNAME TAARGETT STTATE SSERVEER STATTE_DEETAILLS Locall Ressourccesora.LLISTEENER.lsnrr ONNLINEE ONNLINEE pp3orsssetll1 ONNLINEE ONNLINEE pp3orsssetll2 ora.PP3ORSSSDATT1DG.dg ON

26、NLINEE ONNLINEE pp3orsssetll1 ONNLINEE ONNLINEE pp3orsssetll2 ora.SSYSTEEMDG.dg ONNLINEE ONNLINEE pp3orsssetll1 ONNLINEE ONNLINEE pp3orsssetll2 ora.aasm ONNLINEE ONNLINEE pp3orsssetll1 Starrted ONNLINEE ONNLINEE pp3orsssetll2 Starrted ora.ggsd OFFFLINNE OFFFLINNE pp3orsssetll1 OFFFLINNE OFFFLINNE pp

27、3orsssetll2 wwork ONNLINEE ONNLINEE pp3orsssetll1 ONNLINEE ONNLINEE pp3orsssetll2 ora.oons ONNLINEE ONNLINEE pp3orsssetll1 ONNLINEE ONNLINEE pp3orsssetll2 ora.rregisstry.acfss ONNLINEE ONNLINEE pp3orsssetll1 ONNLINEE ONNLINEE pp3orsssetll2 Clustter RResouurcessora.LLISTEENER_SCANN1.lssnr 1 ONNLINEE

28、ONNLINEE pp3orsssetll2 ora.ccvu 1 ONNLINEE ONNLINEE pp3orsssetll2 ora.ooc4j 1 OFFFLINNE OFFFLINNE ora.ooraorrss.ddb 1 ONNLINEE ONNLINEE pp3orsssetll1 Openn 2 ONNLINEE ONNLINEE pp3orsssetll2 Openn ora.pp3orsssetll1.viip 1 ONNLINEE ONNLINEE pp3orsssetll1 ora.pp3orsssetll2.viip 1 ONNLINEE ONNLINEE pp3o

29、rsssetll2 ora.sscan11.vipp 1 ONNLINEE ONNLINEE pp3orsssetll2 p3orrssettl1:ggrid:/hoome/ggrid用戶griid登錄備備節(jié)點p33orsssadg11創(chuàng)建LISSTENEER_TMMP監(jiān)聽器器注意:此步步的LISSTENEER_TMMP只臨時時給DUPPLICAAT方式復復制數(shù)據(jù)庫庫使用,備備庫初始化化完成后需需要將此步步修改進行行回退$cd $ORACCLE_HHOME/netwwork/admiin$ vi listtenerr.oraa # 添加以下下內(nèi)容LISTEENER_TMP = (DEESCRI

30、IPTIOON_LIIST = (DESCCRIPTTION = (ADDDRESSS = (PROOTOCOOL = TCP)(HOSST = 21.1125.444.977)(POORT = 15221) ) )SID_LLIST_LISTTENERR_TMPP =(SID_LISTT = (SID_DESCC = (GLOOBAL_DBNAAME = adggORSSSB) (ORAACLE_HOMEE = /oraccle/aapp/ooraclle/prroducct/111.2.00.3/ddbhomme_1) (SIDD_NAMME = adgORRSSB1) ) )其中紅色部部

31、分:LIISTENNER_TTMP為監(jiān)監(jiān)聽器名稱稱,21.1125.444.977為節(jié)點p33orsssadg11節(jié)點VIP地址址, adggORSSSB為db_uniqque_nname初初始化參數(shù)數(shù)值,adgORRSSB1為實例名名,與主庫庫保持一致致。配置完畢后后進行啟動動:su - griddlsnrcctl sstartt LISSTENEER_TMMPDUPLIICAT方方式初始化化備庫完成成后將此步步操作回退退:su - griddlsnrcctl sstop LISTTENERR_TMPP$cd $ORACCLE_HHOME/netwwork/admiin$ vi listte

32、nerr.oraa # 刪除如上上添加的內(nèi)內(nèi)容用戶griid登錄備備節(jié)點p33orsssadg11創(chuàng)建LISSTENEER監(jiān)聽器器su - griddsrvcttl addd liistenner -l lissteneer -p 15211 -s其中紅色部部分:LIISTENNER為監(jiān)監(jiān)聽器名稱稱,15221為監(jiān)聽聽端口用戶griid登錄備節(jié)點p3oorssaadg1啟動 LISTTENERR監(jiān)聽器注意:如果果使用DUUPLICCAT方式式初始化備備庫,則在在上面第33步LISSTENEER_TMMP完成前前不啟動監(jiān)監(jiān)聽,否則則會有端口口沖突無法法啟動srvcttl sttart listt

33、enerr -ll lissteneer 用戶oraacle登登錄主節(jié)點點p3orrssettl1和p3orrssettl2添加加訪問主數(shù)數(shù)據(jù)庫和備備數(shù)據(jù)庫的的TNS別別名su - oracclecd $OORACLLE_HOOME/nnetwoork/aadminn/vi tnnsnammes.oora #添加如如下內(nèi)容,紅紅色部分請請根據(jù)環(huán)境境進行修改改ORAORRSS = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssetl11-vipp)(POORT = 15221) (ADDRRESS = (PPR

34、OTOOCOL = TCCP)(HHOST = p33orsssetl22-vipp)(POORT = 15221) (LOADD_BALLANCEE = yyes) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = oraaORSSS) ) ) ORAORRSS1 = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssetl11-vipp)(POORT = 15221) (CONNNECT_DATAA = (SEERVERR = DDE

35、DICCATEDD) (SEERVICCE_NAAME = oraaORSSS) (INNSTANNCE_NNAME = orraORSSS1) ) ) ORAORRSS2 = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssetl22-vipp)(POORT = 15221) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = oraaORSSS) (INNSTANNCE_NNAME = orraORSSS2) ) )LISTEENER

36、SS_ORAAORSSS = (ADDDRESSS_LIIST = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssetl11-vipp)(POORT = 15221) (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssetl22-vipp)(POORT = 15221)ORSSSSTANDDBY = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = 211.1255.44.97)(PORTT = 11521) (ADDRRESS =

37、(PPROTOOCOL = TCCP)(HHOST = 211.1255.44.100)(PORRT = 15211) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = adggORSSSB) ) )ORSSPPRIMAARY = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssetl11-vipp)(POORT = 15221) (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssetl22

38、-vipp)(POORT = 15221) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = oraaORSSS) ) ) ADGORRSSBTMP = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = 211.1255.44.97)(PORTT = 11521) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = adggORSSSB) ) )用戶oraacle登登錄備節(jié)點p3o

39、orssaadg1和和p3orrssaddg2添加加訪問主數(shù)數(shù)據(jù)庫和備備數(shù)據(jù)庫的的TNS別別名su - oracclecd $OORACLLE_HOOME/nnetwoork/aadminn/vi tnnsnammes.oora #添加如如下內(nèi)容,紅紅色部分請請根據(jù)環(huán)境境進行修改改ORSSPPRIMAARY = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = 211.1255.44.81)(PORTT = 11521) (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = 211.1255.44.84

40、)(PORTT = 11521) (CONNNECT_DATAA = (SEERVICCE_NAAME = oraaORSSS) ) )ORSSSSTANDDBY = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssadg11-vipp)(POORT = 15221) (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssadg22-vipp)(POORT = 15221) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEE

41、RVICCE_NAAME = adggORSSSB) ) )ADGORRSSB2 = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssadg22-vipp)(POORT = 15221) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = adggORSSSB) (INNSTANNCE_NNAME = addgORSSSB2) ) )ADGORRSSB1 = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCO

42、L = TCCP)(HHOST = p33orsssadg11-vipp)(POORT = 15221) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = adggORSSSB) (INNSTANNCE_NNAME = addgORSSSB1) ) )ADGORRSSB = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssadg11-vipp)(POORT = 15221) (ADDRRESS = (PPROTOOCOL = TCCP)

43、(HHOST = p33orsssadg22-vipp)(POORT = 15221) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = adgORRSSB) ) )LISTEENERSS_ADGGORSSSB = (ADDDRESSS_LIIST = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssadg11-vipp)(POORT = 15221) (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = p33orsssadg22-vipp)(

44、POORT = 15221) )ADGORRSSBTMP = (DEESCRIIPTIOON = (ADDRRESS = (PPROTOOCOL = TCCP)(HHOST = 211.1255.44.97)(PORTT = 11521) (CONNNECT_DATAA = (SEERVERR = DDEDICCATEDD) (SEERVICCE_NAAME = adggORSSSB) ) )在主節(jié)點pp3orsssetll1上生成成數(shù)據(jù)庫密密碼文件oorapwworaOORSS11,命令如如下(其中中紅色部分分的oraacle1123為密密碼,orrapwooraORRSS1為為密碼文件件)

45、:su - oracclecd $OORACLLE_HOOME/ddbsorapwwd fiile=oorapwworaOORSS11 passsworrd=orraclee123sqlpllus /as sysddbaalterr useer syys iddentiifiedd by oraccle1223;將節(jié)點p33orsssetl11數(shù)據(jù)庫密密碼文件oorapwworaOORSS11拷貝到pp3orsssetll2、p3orrssaddg1和p3orrssaddg2節(jié)點點后執(zhí)行以以下命令p3orsssetll1節(jié)點主主機數(shù)據(jù)庫庫密碼文件件為/orraclee/appp/oraacle

46、/prodduct/3/dbhhome_1/dbbs/orrapwooraORRSS1$cd $ORACCLE_HHOME/dbs$mv oorapwworaOORSS11 oraapworraORSSS2 #在主節(jié)點p3oorsseetl2操操作$chowwn orraclee:oinnstalll orrapwooraORRSS2 #在主節(jié)點p3oorsseetl2操操作$mv oorapwworaOORSS11 oraapwaddgORSSSB1 #在備備節(jié)點p3oorssaadg1操操作$chowwn orraclee:oinnstalll orrapwaadgORRSSB1 #在備備

47、節(jié)點p3oorssaadg1操操作$mv oorapwworaOORSS11 oraapwaddgORSSSB2 #在備備節(jié)點p3oorssaadg2操操作$chowwn orraclee:oinnstalll orrapwaadgORRSSB2 #在備備節(jié)點p3oorssaadg2操操作其中紅色部部分:orraORSSS2、adgORRSSB1、adggORSSSB2為實例名名,需要和和每個主機機實例名相相符 另外外如果需要要修改syys用戶的的密碼,則則在節(jié)點pp3orsssetll1執(zhí)行以以下命令后后再將數(shù)據(jù)據(jù)庫密碼文文件拷貝到其他他p3orrssettl2、p3orrssaddg1和p

48、3orrssaddg2節(jié)點點上用戶oraacle登登陸主數(shù)據(jù)庫節(jié)節(jié)點主機p3oorsseetl1SQLaalterr useer syys iddentiifiedd by oraccle1223;在備數(shù)據(jù)庫庫主機上創(chuàng)創(chuàng)建aduump目錄錄用戶oraacle登登陸p3oorssaadg1和p3orrssaddg2節(jié)點點mkdirr p /orraclee/appp/oraacle/admiin/addgORSSSB/aduump用戶oraacle登登陸主數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorsseetl1和和p3orrssettl2執(zhí)行行tnspping TNS別別名ORSSSPRIIMARYY和ORS

49、SSSTANNDBYsu - oraccletnspiing OORSSPPRIMAARYtnspiing OORSSSSTANDDBY用戶oraacle登登陸主數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorsseetl1和和p3orrssettl2用ssys用戶戶登陸備數(shù)數(shù)據(jù)庫和主主數(shù)據(jù)庫$sqlpplus sys/oraccle1223ORRSSPRRIMARRY ass syssdba$sqlpplus sys/oraccle1223ORRSSSTTANDBBY ass syssdba用戶oraacle登登陸備數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorssaadg1和和p3orrssaddg2執(zhí)行行tnspping T

50、NS別別名ORSSSPRIIMARYY和ORSSSSTANNDBY$tnspping ORSSSPRIMMARY$tnspping ORSSSSTANDDBY用戶oraacle登登陸備數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorssaadg1和和p3orrssaddg2用ssys用戶戶登陸主數(shù)數(shù)據(jù)庫和備數(shù)據(jù)庫庫$sqlpplus syss/oraacle1123OORSSPPRIMAARY aas syysdbaa$sqlpplus syss/oraacle1123OORSSSSTANDDBY aas syysdbaa備數(shù)據(jù)庫初初始化備數(shù)據(jù)庫初初始化意味味著需要將將主數(shù)據(jù)庫庫的控制文文件、數(shù)據(jù)據(jù)文件等全全部復

51、制到到備數(shù)據(jù)庫庫環(huán)境上,即即主數(shù)據(jù)庫庫和備數(shù)據(jù)據(jù)庫進行一一次全庫復復制??梢砸圆捎靡韵孪路绞街械牡娜魏我环N種對備數(shù)據(jù)據(jù)庫進行初初始化:通過dupplicaate aactivve daatabaase初始始化備數(shù)據(jù)據(jù)庫(主數(shù)數(shù)據(jù)庫備份份無需存在在)注意:此種種方式為RRMAN從從網(wǎng)絡恢復復數(shù)據(jù)庫,會會占用大量量的網(wǎng)絡帶帶寬,建議議已經(jīng)投產(chǎn)產(chǎn)的系統(tǒng)使使用下面的的從NBUU帶庫恢復復的方式進進行。用戶oraacle登登錄備節(jié)點點p3orrssaddg1創(chuàng)建建dg_wwork工工作目錄Oraclle用戶登登錄備數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorssaadg1$ mkddir ddg_woork用戶grii

52、d登錄備節(jié)點點p3orrssaddg1啟動動LISTTENERR_TMPP監(jiān)聽grid用用戶登錄備備數(shù)據(jù)庫節(jié)節(jié)點主機pp3orsssadgg1su - griddlsnrcctl sstartt LISSTENEER_TMMP用戶oraacle登登錄備節(jié)點點p3orsssadgg1創(chuàng)建staandbyy_iniit.orra文件和和creaate_sstanddby.ssh腳本文文件Oraclle用戶登登錄備數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorssaadg1$ cd /homme/orraclee/dg_workk$ vi stanndby_initt.oraa #該文件件內(nèi)容如下下:DB_NAAME

53、=oraORRSS #數(shù)據(jù)庫庫名稱DB_UNNIQUEE_NAMME=adgORRSSB #備數(shù)數(shù)據(jù)庫DBB_UNIIQUE_NAMEEDB_BLLOCK_SIZEE=81992SGA_TTARGEET=3222122254722db_crreatee_fille_deest= #備備數(shù)據(jù)庫取取消OMFF功能contrrol_ffiless=+P3ORRSADGGDAT11DG/adgORRSSB/conntrollfilee/conntroll01.cctl,+P33ORSAADGDAAT1DGG/adggORSSSB/conntrollfilee/conntroll02.cctl,+P33

54、ORSAADGDAAT1DGG/adggORSSSB/conntrollfilee/conntroll03.ctll #備數(shù)據(jù)據(jù)庫控制文文件路徑其中主數(shù)據(jù)據(jù)庫和備數(shù)數(shù)據(jù)庫在DDB_NAAME和DB_BBLOCKK_SIZZE必須一一致$ vi creaate_sstanddby.ssh #該文文件內(nèi)容如如下:sqlpllus / ass syssdba EOFstarttup nnomouunt ppfilee=/hhome/oraccle/ddg_woork/sstanddby_iinit.oraconneect ssys/ooraclle1233ORSSSSTANNDBY AS SSYSD

55、BBA #ooraclle1233為syss用戶密碼碼,ORSSSSTAANDBYY備數(shù)據(jù)庫庫TNS別別名conneect ssys/ooraclle1233ORSSSPRIMMARY AS SSYSDBBA #oraccle1223為syys用戶密密碼,ORRSSPRRIMARRY為主數(shù)數(shù)據(jù)庫TNNS別名EOFexporrt NLLS_DAATE_FFORMAAT=YYYYYMMMDD HH244:MI:SSrman targget ssys/ooraclle1233ORSSSPRIIMARYY auxxiliaary ssys/ooraclle1233ADGGORSSSBTMPP crea

56、ate ppfilee=/tmpp/iniit.orra froom sppfilee;SQLsshutddown immeediatte;SQLsstarttup ppfilee=/tmpp/iniit.orra nommountt;SQL creaate sspfille=+P3ORRSADGGDAT11DG/aadgorrssb/spffile.ora froom pffile=/tmpp/iniit.orra;SQLsshutddown immeediatte;$cd $ORACCLE_HHOME/dbs$rm sspfilleadggORSSSB1.orra$ vi inittadg

57、OORSSBB1.orra文件內(nèi)容如如下:spfille=+P3ORRSADGGDAT11DG/aadgorrssb/spffile.ora用戶oraacle節(jié)節(jié)點p3orsssadgg2創(chuàng)建備備數(shù)據(jù)庫初初始化參數(shù)數(shù)文件innitaddgORSSSB2.orra用戶oraacle登登陸備數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorssaadg2$ cd $ORAACLE_HOMEE/dbss$ vi inittadgORRSSB2.oraa文件內(nèi)容如如下:spfille=+P3ORRSADGGDAT11DG/aadgorrssb/spffile.ora啟動備數(shù)據(jù)據(jù)庫實例aadgORRSSB1用戶oraacle

58、登登陸備數(shù)據(jù)據(jù)庫節(jié)點主主機p3oorssaadg1$sqlpplus / ass syssdbaSQL starrtup mounnt;用戶griid登錄備節(jié)點點p3orrssaddg1停止止LISTTENERR_TMPP監(jiān)聽grid用用戶登錄備備數(shù)據(jù)庫節(jié)節(jié)點主機pp3orsssadgg1su - griddlsnrcctl sstop LISTTENERR_TMPP通過帶庫備備份恢復初初始化備數(shù)數(shù)據(jù)庫(主主數(shù)據(jù)庫備備份必須存存在)在主節(jié)點pp3orsssetll1獲取參數(shù)文文件Oraclle用戶登登錄主節(jié)點點p3orrssettl1數(shù)據(jù)據(jù)庫主機$sqlpplus / ass syssdbaS

59、QL creaate ppfilee=/tmpp/orssspfiile.ttmp froom sppfilee;例如主節(jié)點點p3orrssettl1數(shù)據(jù)據(jù)庫的參數(shù)數(shù)配置如下下:$ catt /tmmp/orrsspffile.tmp*._gcc_deffer_ttime=3*._gcc_pollicy_timee=0*._opptimiizer_adapptivee_currsor_sharring=FALSSE*._opptimiizer_exteendedd_currsor_sharring_rel=NONNE*._paartittion_largge_exxtentts=FFALSEE

60、*._unndo_aautottune=FALSSE*._usse_addaptiive_llog_ffile_syncc=FAALSE*._trrace_filees_puublicc=truue*._opptimiizer_use_feeddbackk=fallse*.auddit_ffile_destt=/ooraclle/appp/orraclee/admmin/ooraORRSS/aadumpp*.auddit_ssys_ooperaationns=TRRUE*.auddit_ttraill=dbb*.cluusterr_dattabasse=trrue*.commpatiible=

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論