

下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、江西中磊支付科技有限公司 密級(jí):內(nèi)部中磊第三方支付平臺(tái)系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程文檔編號(hào):V1.0項(xiàng)目名稱:江西中叢支付平臺(tái)編寫: 王志尖編寫日期:2014-4-7審核: 李駿審核日期:2014-6-13批準(zhǔn): 朱志龍批準(zhǔn)日期:2014-6-17江西中磊支付科技有限公司2014年7月修訂記錄日期版本版本說(shuō)費(fèi)作者作者2014-4-7草稿草稿2014-6-17VI. 0正式簽發(fā)文檔第一章引言第一章引言.11.1編寫目的.11.2預(yù)期讀者.11.3編寫背景.11.3. 1使用者.11.4文檔結(jié)構(gòu).2第二章數(shù)據(jù)備份功能要求詳述第二章數(shù)據(jù)備份功能要求詳述.32. 1備份環(huán)境.32. 1. 1備份環(huán)境.32.
2、 1.2存儲(chǔ)網(wǎng)絡(luò)環(huán)境.42. 1.3備份方式及備份空間.42.2備份需求.52. 2. 1系統(tǒng)級(jí)備份.52.2.2應(yīng)用級(jí)備份.52. 2.3文件級(jí)備份.52.2.4數(shù)據(jù)庫(kù)備份.52.3備份策略.52. 3. 1備份策略定義.52.3.2系統(tǒng)級(jí)備份策略.62.3.3應(yīng)用級(jí)備份策略.62. 3.4文件級(jí)備份策略.62. 3.5數(shù)據(jù)庫(kù)備份策略.7第三章故障與恢復(fù)策略第三章故障與恢復(fù)策略.83. 1故障與恢復(fù)介紹.83.2設(shè)計(jì)原則.93.3故障與恢復(fù)策略.9第四章備份與恢復(fù)步驟第四章備份與恢復(fù)步驟.104. 1備份步驟.104. 1. 1系統(tǒng)級(jí)備份步驟.104. 1.2應(yīng)用軟件備份步驟.104. 1.
3、3脫機(jī)應(yīng)用文件備份步驟.114.1.4數(shù)據(jù)庫(kù)備份步驟.134.2恢復(fù)步驟.164.2. 1系統(tǒng)級(jí)故障恢復(fù)步驟.164.2.2應(yīng)用軟件故障恢復(fù)步驟.164.2.3脫機(jī)應(yīng)用文件故障恢復(fù)步驟.174.2.4數(shù)據(jù)庫(kù)故障恢復(fù)步驟.18江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程I第一章引言1.1 編寫目的本文檔主要描述江西中磊支付平臺(tái)的數(shù)據(jù)備份與恢復(fù)的需求、策 略要求以及相應(yīng)的步驟,為后期實(shí)施和維護(hù)管理過(guò)程中提供數(shù)據(jù)庫(kù)備 份與恢復(fù)的規(guī)范。1-2 預(yù)期讀者江西中磊支付平臺(tái)項(xiàng)目組項(xiàng)目經(jīng)理、集成經(jīng)理、開(kāi)發(fā)經(jīng)理、系統(tǒng) 管理員。1.3 編寫背景在江西中磊支付平臺(tái)的軟件實(shí)施過(guò)程中,數(shù)據(jù)的安全至關(guān)重要, 一方面數(shù)據(jù)的丟
4、失或者數(shù)據(jù)庫(kù)系統(tǒng)無(wú)法正常運(yùn)行影響江西中磊支付 平臺(tái)業(yè)務(wù)應(yīng)用系統(tǒng)的正常運(yùn)作,另一方面如果系統(tǒng)在崩潰后不能夠按 照預(yù)期的要求恢復(fù)到指定狀態(tài)也將影響到江西中磊支付平臺(tái)業(yè)務(wù)應(yīng) 用系統(tǒng)的正常運(yùn)作,例如數(shù)據(jù)沖突或者狀態(tài)不一致。特地編寫此文檔 將對(duì)實(shí)施過(guò)程中的數(shù)據(jù)備份與恢復(fù)提供指導(dǎo)。1.3.1 使用者本文檔適用于參與江西中磊支付平臺(tái)項(xiàng)目實(shí)施的工程師、江西中 磊支付平臺(tái)的系統(tǒng)管理員以及項(xiàng)目經(jīng)理、開(kāi)發(fā)經(jīng)理、系統(tǒng)管理員。江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程71.4 文檔結(jié)構(gòu)數(shù)據(jù)備份與恢復(fù)解決方案共分四章:第一章、引言第二章、數(shù)據(jù)備份功能要求詳述第三章、故障與恢復(fù)策略第四章、備份與恢復(fù)步驟江西中磊股份有限公司
5、系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程2.1 備份環(huán)境2.1.1 備份環(huán)境第二章數(shù)據(jù)備份功能要求詳述虛擬帶庫(kù)磁盤空間小型機(jī)其他業(yè)務(wù)、前置交換數(shù)據(jù)江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程42.1.2 存儲(chǔ)網(wǎng)絡(luò)環(huán)境2.1.3 備份方式及備份空間根據(jù)現(xiàn)有環(huán)境及規(guī)劃,本次備份空間主要江西中磊支付平臺(tái)。江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程52.2備份需求2.2.1系統(tǒng)級(jí)備份2.2.1.1操作系統(tǒng)備份2.2.1.2應(yīng)用環(huán)境備份2.2.2應(yīng)用級(jí)備份2.2.3文件級(jí)備份描述:業(yè)務(wù)系統(tǒng)運(yùn)行中產(chǎn)生的業(yè)務(wù)數(shù)據(jù)文件(非數(shù)據(jù)庫(kù)相關(guān)文件)。 具體內(nèi)容:脫機(jī)文件、制卡文件,社保導(dǎo)入文件、黑名單文件。2.2.4數(shù)據(jù)庫(kù)備份2.3備份策
6、略2.3.1備份策略定義定義好備份資源后,我們必須根據(jù)實(shí)際需要配置備份策略。定義 備份策略,涉及到以下內(nèi)容:在什么時(shí)間(備份時(shí)間,如晚上),將 什么數(shù)據(jù)(備份內(nèi)容,如數(shù)據(jù)庫(kù)數(shù)據(jù)),以什么方式(全備份,還是 增量備份)。在我們對(duì)要備份的數(shù)據(jù)根據(jù)需要定義好備份策略后,需 要書寫腳本,讓系統(tǒng)按照指定的時(shí)間、方式將需要備份的數(shù)據(jù)備份到 指定的本地磁盤上。江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程62.3.2系統(tǒng)級(jí)備份策略2.3.2.1操作系統(tǒng)備份策略:在操作系統(tǒng)安裝完成后,對(duì)整個(gè)操作系統(tǒng)進(jìn)行全備份一次即可。2.322應(yīng)用環(huán)境備份策略:在業(yè)務(wù)應(yīng)用系統(tǒng)所需相關(guān)基礎(chǔ)軟件安裝后,再對(duì)整個(gè)操作系統(tǒng) 進(jìn)行全備份一
7、次即可。2.3.3應(yīng)用級(jí)備份策略策略:江西中磊支付平臺(tái)應(yīng)用軟件安裝結(jié)束后,每三個(gè)月對(duì)整個(gè)江西 中磊支付平臺(tái)應(yīng)用軟件全備份一次;江西中磊支付平臺(tái)應(yīng)用軟件版本 升級(jí)一次全備份一次;保留一份備份。2.3.4文件級(jí)備份策略策略: 江西中磊支付平臺(tái)應(yīng)用系統(tǒng)運(yùn)行時(shí)所產(chǎn)生脫機(jī)文件等文件的備 份,按備份策略劃分為全備和增量備份。每個(gè)月二十五號(hào)江西中磊支 付平臺(tái)進(jìn)行全量備份;每周五江西中磊支付平臺(tái)進(jìn)行一次增量備份, 保留一份備份。2.3.5 數(shù)據(jù)庫(kù)備份策略2.3.5.1全庫(kù)備份江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程7全庫(kù)備份策略:按備份策略劃分為全備和增量備份。江西中磊支付平 臺(tái)數(shù)據(jù)庫(kù)運(yùn)行在歸檔模式下,每周
8、五進(jìn)行全量備份;每天晩上進(jìn)行一 次增量備份,保留一份備份。2.3.5.2用戶備份用戶級(jí)備份策略:用戶級(jí)備份時(shí)間在全庫(kù)備份之后,做為對(duì)全庫(kù)備份 的補(bǔ)充,采用每周做一次用戶級(jí)備份,每天備份在晚上進(jìn)行,用戶級(jí) 備份只包括所有數(shù)據(jù)庫(kù)用戶的導(dǎo)出江西中磊支付平臺(tái)文件,用戶級(jí)備 份的江西中磊支付平臺(tái)文件需要保留一份備份。江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程8第三章故障與恢復(fù)策略3.1 故障與恢復(fù)介紹備份系統(tǒng)應(yīng)以不影響業(yè)務(wù)的正常運(yùn)行(online狀態(tài))為前提, 在業(yè)務(wù)系統(tǒng)遭到非法入侵、介質(zhì)損壞、人為誤操作造成系統(tǒng)崩潰、軟 件癱瘓或運(yùn)行過(guò)慢、數(shù)據(jù)不正確或丟失后,備份系統(tǒng)應(yīng)能提供快速的 恢復(fù)手段,并能夠不影
9、響其它相關(guān)系統(tǒng)的正常運(yùn)行,例如數(shù)據(jù)交換系 統(tǒng)。考慮到業(yè)務(wù)應(yīng)用系統(tǒng)在運(yùn)行過(guò)程中不同的故障,應(yīng)用不同的備份 恢復(fù)目標(biāo),下面做一簡(jiǎn)要描述,并對(duì)各種情況下的目標(biāo)做了詳細(xì)的介 紹。系統(tǒng)級(jí)故障是業(yè)務(wù)應(yīng)用系統(tǒng)運(yùn)行過(guò)程中,發(fā)生操作系統(tǒng)崩潰、或 無(wú)法啟動(dòng)故障。應(yīng)用軟件故障是支撐業(yè)務(wù)應(yīng)用系統(tǒng)的相關(guān)軟件故障。脫機(jī)數(shù)據(jù)文件丟失故障是前置文件數(shù)據(jù)、制卡數(shù)據(jù)等非存儲(chǔ)與數(shù) 據(jù)庫(kù)內(nèi)的數(shù)據(jù)文件丟失類故障。數(shù)據(jù)庫(kù)故障是oracle內(nèi)實(shí)例、進(jìn)程、介質(zhì)等故障造成數(shù)據(jù)庫(kù)無(wú) 法啟動(dòng)、癱瘓、數(shù)據(jù)丟失等故障。3.2 設(shè)計(jì)原則探盡量透明性原則,即江西中磊支付平臺(tái)客戶最小程度干預(yù)備份與江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程9恢復(fù)過(guò)程。嚴(yán)格性
10、,即備份與恢復(fù)的每一個(gè)步驟都有嚴(yán)格的校驗(yàn)。3.3 故障與恢復(fù)策略序號(hào)故障內(nèi)容恢復(fù)策略1操作系統(tǒng)無(wú)法啟動(dòng)根據(jù)軟件需求,使用最近的操作系統(tǒng)備 份或應(yīng)用環(huán)境備份進(jìn)行恢復(fù),后使用支 撐業(yè)系統(tǒng)軟件備份、數(shù)據(jù)庫(kù)備份恢復(fù)系 統(tǒng)可用性2支撐業(yè)務(wù)系統(tǒng)的應(yīng)用軟件故障使用最新版本的業(yè)務(wù)應(yīng)用軟件備份進(jìn)行 恢復(fù)3脫機(jī)數(shù)據(jù)文件(制卡文件等非 數(shù)據(jù)庫(kù)內(nèi)存儲(chǔ)文件)丟失使用最近的脫機(jī)數(shù)據(jù)文件備份進(jìn)行恢復(fù)4數(shù)據(jù)庫(kù)故障使用最近數(shù)據(jù)庫(kù)備份內(nèi)容對(duì)數(shù)據(jù)庫(kù)進(jìn)行 恢復(fù),并依據(jù)歸檔日志,將數(shù)據(jù)庫(kù)恢復(fù) 至數(shù)據(jù)庫(kù)故障點(diǎn)前一刻狀態(tài)。江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程10第四章備份與恢復(fù)步驟4.1 備份步驟4.1.1 系統(tǒng)級(jí)備份步驟tctl
11、-f /dev/rmtO rewindsmit mksysb4.1.2 應(yīng)用軟件備份步驟4.1.2.1 Tomcat備份步驟rq=date +%Y%m%dfname=rr/appback/shebao_$rq. tar tar - zcvf $fname /shebao/bea/fname=r7appback/tuoji_$rq. tartar - zcvf $fr)ame /tuoji/bea/fname=r7appback/heimindan_$rq. tartar - zcvf $fname /heimindan/fname=/appback/zhika_$rq. tartar - zc
12、vf $fname /zhika/bea江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程ii4/1.2.2應(yīng)用發(fā)布包備份步驟rq=date +%Y%m%dfname=r7appback/app_shebao_$rq. tar tar - zcvf $fname/shebao/bea/mydomain fname=tr/appback/app_tuoji_$rq. tar,ftar - zcvf$fname /tuoji/bea/mydomain fname=r7appback/app_heimindan_$rq. tarKtar- zcvf $fname /heimindan/bea/mydomai
13、n fname=rr/appback/app_zhika_$rq.tar,rtar - zcvf $fname /zhika/bea4.1.3脫機(jī)應(yīng)用文件備份步驟全備:rq=date +%Y%m%dfname=r7appdata/zhika/full_appdata_$rq. tarr,tar - zcvf $fr)ame /zhika/data增量:rq=date +%Y%m%dfname=rr/appdata/zhika/inc_appdata_$rq tarKfname 1=,F/appdata/zhika/1file_$rq. txt,rfind /shebao/data - mtim
14、e 1 - print $fnamel江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程12tar - zcvf $fname - T $fnamel4.1.3.1黑名單文件備份步驟全備:rq=date +%Y%m%dfn ame=rr/appdata/he im in dan/ful l_appdata_$r q. lar tar - zcvf$fname /heimindan/data增量:rq=date +%Y%m%dfname=r7appdata/heimindan/inc_appdata_$rq. tarvfname1=,F/appdata/heimindan/tfile_$rq. txtr
15、rfind /shebao/data - mtime 1 -print $fnamel tar -zcvf $fname - T Sfnamel4.1.3.2脫機(jī)文件備份步驟全備:rq=date +%Y%m%dfname=rr/appdata/tuoji/full_appdata_$rq. tarn江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程13tar - zcvf $fname / tuoji /data增量:rq=date +%Y%m%dfname=r7appdata/ tuoji /inc_appdata_$rq. tar,rfname 1=11/appdata/tuoji /tfile_
16、$rq. txtr,find /shebao/data - mtime 1 - print $fnamel tar-zcvf $fname - T $fnamel4.1.4數(shù)據(jù)庫(kù)備份步驟4.1.4.1數(shù)據(jù)庫(kù)全庫(kù)備份步驟Rman全庫(kù)備份腳本run/rmback/backdata/full%u_%p_%c database ;sql alter system archivelog current? ;backup filesperset 3 archivelog all delete input;releasechannel devl; release channel dev2; release
17、channel dev3;定時(shí)執(zhí)行語(yǔ)句0102*0(/rmback/scripts/rmback_levelO. shallocatechannelrdevl* typedisk maxpiecesize8g;allocatecharmelrdev2ftypedisk maxpiecesize8g;allocatechannelrdev3ftypedisk maxpiecesize8g;backupfulltagrdbfulTformat江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程14/rmback/1og/orac1e 2&1)4/142數(shù)據(jù)庫(kù)增量備份步驟1級(jí)run allocate
18、charmelrdevl1typediskmaxpiecesize8g;allocate channelde2 typediskmaxpiecesize8g;allocate channelde3 typediskmaxpiecesize8g;backup incrementallevel 1 tag * dbLl1format*/rmback/backdata/basic%u_%p_%cFdatabase skip readonly; sql altersystem archive log current/ ;backup filesperset 3 archivelog all delet
19、e input;release channel devl;release channel dev2;release channel dev3;2級(jí)run allocate channelrdevl1type disk maxpiecesize 8g;allocate charrnelrdev2*type disk maxpiecesize 8g;allocate channeldev3 type disk maxpiecesize 8g;backup incremental level2tagrdbL2*江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程15format1/rmback/backdat
20、a/basic%u_%p_%crdatabase skip readonly;sql1alter system archive log current;backup filesperset 3 archivelog all delete input;release charmel devl;release channel dev2;release charmel dev3;4.1.4.3數(shù)據(jù)庫(kù)用戶備份步驟表空間備份腳本(以u(píng)sers表空間為例)run allocate charmelrdevl1type disk maxpiecesize 8g;allocate channelrdev21ty
21、pe disk maxpiecesize 8g;allocate charrnelrdev3*type disk maxpiecesize 8g;backup tagrtsusers1formatr/rmback/backdata/basic%u_%p_%c *tablespace users;sqlfalter system archive log current;backup filesperset 3 archivelog all delete input;release charmel devl;release channel dev2;release charmel dev3;江西中
22、磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程164.2恢復(fù)步驟4.2.1系統(tǒng)級(jí)故障恢復(fù)步驟4.2.1.1故障恢復(fù)步驟A、用光盤啟動(dòng),進(jìn)入維護(hù)模式,用磁帶機(jī)恢復(fù),選擇shrink thefilesystem=yeso Use maps = noo指定hdiskO,恢復(fù)到hdiskO上。B、此時(shí),hdiskl應(yīng)該顯示為noneQC、然后把hdiskl加入rootvgoD、然后做鏡像。4.2.2應(yīng)用軟件故障恢復(fù)步驟4.2.2.1 Tomcat故障恢復(fù)步驟tar - zxvf /appback/shebao_20100812. tar /shebao/bea/江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程4.2.
23、22應(yīng)用發(fā)布包故障恢復(fù)步驟tar-zxvf/appback/app_shebao_20100812. tar/shebao/bea/mydomain4.2.3脫機(jī)應(yīng)用文件故障恢復(fù)步驟4.2.3.1黑名單文件故障恢復(fù)步驟全恢復(fù):tar - zxvf /appdata/heimindan/full_3ppdata_20100812 tar/shebao/data增量恢復(fù):tar - zxvf/appdata/heimindan/inc_appdata_20100812 tar/shebao/data4.2.3.2脫機(jī)文件故障恢復(fù)步驟全恢復(fù):tar - zxvf/appdata/tuoji/full
24、_appdata_20100812.tar/shebao/data增量恢復(fù):江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程tarzxvf/appdata/tuoji/inc_appdata_20100812 tar江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程18/shebao/data4.2.4數(shù)據(jù)庫(kù)故障恢復(fù)步驟4.2.4.1參數(shù)文件損壞的恢復(fù)這里主要是指spfile文件損壞。4.2.4.1.1從spfile或pf訂e文件備份中恢復(fù)當(dāng)存在spfile文件的備份時(shí),將備份的文件重新拷貝到$0RACLE_H0ME/dbs下,然后啟動(dòng)數(shù)據(jù)庫(kù)$ cp bak/bakspfileorcl. ora $()RA
25、CLE_HOME/dbs/spf i1eorc1. ora當(dāng)存在pfile文件的備份時(shí),可以用以下步驟恢復(fù)spfileSQL startup pfi1e=r$ORACLE_HOME/dbs/initore1. orarSQL create spfile from pfile4.2.4.1.2從RMAN備份中恢復(fù)命令:rman target / catalog rman/rmanorcl160startup nomount restore spfile;江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程19shutdown immediate;startup具體操作:$ rman target /Rec
26、overy Manager: Release 10 2. 0. 1. 0一Production on星期一5月14 15:27:18 2007Copyright (c) 1982, 2005, Oracle All rights reserved cormected to target database (not started)RMAN corm eel catalog rma n/rin8n()rcll60cormected to recovery catalog databaseRMAN startup nomountstartup failed: ORA-01078: failure
27、in processing system parametersLRM-00109: could not open parameter file江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程201/opt/orac1e/orac1e/product/10. 2. 0/db_l/dbs/initorc1 ora startingOracle instanee without parameter file for retrival of spfileOracle instanee started6369280 bytesRMAN restore spfile from autobackup;Starti
28、ng restore at 2007-05-14 15:28:52 allocated channel:()R.A_DISK_1channel ()RA_DISK_1: sid二36 devtype=DISKallocated channel: ORA_DISK_2channel ()RA_DISK_2: sid二35 devtype=DISKallocated channel: ()R.A_DISK_3channel ORA_DISK_3: sid=34 devtype二DISK channel ORA_DISK_1: lookingTotal System Global Area15938
29、3552 bytesFixed Size2019224 bytesVariable Size67108968 bytesDatabase Buffers83886080 bytesRedo Buffers江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程21for autobackup on day: 20070514 channel ()RA_DISK_2: looking forautobackup on day: 20070514 channel ORA_DISK_2: skipped, autobackupalready found channel ()RA_DISK_3: looking f
30、or autobackup on day:20070514 channel ()RA_DISK_3: skipped, autobackup already foundchannelORA_DISK_1:autobackupfound:C-1135325536-20070514-05channel ORA_DISK_1: SPFILE restore from autobackup complete Finishedrestore at 2007-05-14 15:29:04RMAX shutdown immediate;Oracle instance shut downRMAX startu
31、pcormected to target database (not started)Oracle instance starteddatabase mounteddatabase openedTotal System Global Area285212672 bytesFixed Size2020192 bytes江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程22Variable Size155192480 bytesDatabase Buffers121634816 bytesRedo Buffers6365184 bytes4.2.42口令文件損壞的恢復(fù)如果是口令文件損壞,那么刪除原口令文件
32、,并且新建一個(gè)口令 文件。$ rm $ORACLE_HOME/dbs/PWDorcl. ora$ orapwd f i1e=$ORACLE_HOME/dbs/PWDorcl. ora password=oracleentries=54.243歸檔日志文件損壞的恢復(fù)如果是歸檔日志文件損壞,那么在損壞的歸檔日志文件之前的備份將不能進(jìn)行完全恢復(fù),所以應(yīng)當(dāng)做如下操作:1.刪除損壞的歸檔日志文件及之前的歸檔日志文件檢查歸檔日志文件RMAN CROSSCHECK ARCHIVELOG ALL;江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程23在RMAN中刪除不需要的歸檔日志RMAX DELETE NOPROM
33、PT ARCHIVELOG UNTIL SEQUENCE = 797;2.刪除RMAN中已經(jīng)無(wú)用的歸檔日志備份查詢RMAN中已經(jīng)無(wú)用的歸檔日志備份RMAN list backup of archivelog all;RMAN list backup of archivelog all summary;刪除RMAN中已經(jīng)無(wú)用的歸檔日志備份,重點(diǎn)在查詢Seq值BS Key SizeDevice Type Elapsed Time Completion Time14:49:06BP Key: 12308 Status: AVAILABLE Compressed: YESTag: TAG2007051
34、4T144904PieceName:/opt/oracle/backup/arch0RCL_a0ihn5vl_320_lList of Archived Logs in backup set 12306Thrd Seq Low SCN Low TimeNext SCN Next123062.00KDISK00:00:012007-05-14江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程24Time19271679503432007-05-14 14:49:01 1679503542007-05-14 14:49:03RMAN delete backup tag TAG20070514T144904
35、;3.重新制作全備份和增量備份4.2.4.4控制文件損壞的恢復(fù)4.2.4.4.1單個(gè)控制文件損壞損壞單個(gè)控制文件是比較容易恢復(fù)的,因?yàn)橐话愕臄?shù)據(jù)庫(kù)系統(tǒng), 控制文件都不是一個(gè),而且所有的控制文件都互為鏡相,只要拷貝一 個(gè)好的控制文件替換壞的控制文件就可以了。1、控制文件損壞,最典型的就是啟動(dòng)數(shù)據(jù)庫(kù)出錯(cuò),不能mount數(shù)據(jù) 庫(kù)SQL startupORA-00205: error in identifying control file, check alert log for moreinfo查看報(bào)警日志文件alert_orcl. log,有如下信息ALTER DATABASE MOUNT江西中磊
36、股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程25Mon May 14 16:10:15 2007ORA-00202:controlf訂e:/opt/orac1e/orac1e/oradata/orcl/control01 ctl*ORA-27037: unable to obtain file statusLinux-x86_64 Error: 2: No such file or directoryAdditional inforination: 32、停止數(shù)據(jù)庫(kù)SQL shutdown inimediate3、拷貝一個(gè)好的控制文件替換壞的控制文件或修改init.ora中的控制文件參數(shù),取消這個(gè)壞的控
37、制文件。4、重新啟動(dòng)數(shù)據(jù)SQL startup說(shuō)明:1、損失單個(gè)控制文件是比較簡(jiǎn)單的,因?yàn)閿?shù)據(jù)庫(kù)中所有的控制文件都是鏡相的,只需要簡(jiǎn)單的拷貝一個(gè)好的就可以了2、建議鏡相控制文件在不同的磁盤上3、建議多做控制文件的備份,長(zhǎng)期保留一份由alter databasebackup control file to trace產(chǎn)生的控制文件的文本備份江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程264.2.4.4.2全部控制文件損壞命令:rman target / catalog rman/rmanorcl160startup nomountrestore controlfile;recover databa
38、se;sql1alter database open resetlogs;具體操作:SQL startupORA-00205: error in identifying control file, check formore info啟動(dòng)數(shù)據(jù)庫(kù),出現(xiàn)錯(cuò)誤,并不能啟動(dòng)到mount下查看報(bào)警日志文件alert_orcl. log,有如下信息ALTER DATABASE MOUNTMon May 14 16:29:11 2007ORA-00202:control/opt/orac1e/orac1e/oradata/orc1/contro101 ctl*ORA-27037: unable to obt
39、ain file statusLinux-x86_64 Error: 2: No such file or directoryalert logfile:江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程27Additiona1 information: 3$ rman target / catalog rman/rm3norcll60Recovery Manager: Release 10. 2. 0. 1. 0一Production on星期一5月14 16:31:22 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.cormec
40、ted to target database: orcl (not mounted)cormected to recovery catalog databaseRMAN restore controlfile;Starting restore at 2007-05-14 16:32:14allocated channel: ORA_DISK_1channel ORA_DISK_1: sid二155 devtype=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: sid二154 devtype二DISKallocated channel:
41、 ORA_DISK_3channel ()RA_DISK_3: sid二153 devtype二DISKchannel ()RA_DISK_1: starting datafile backupset restore江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程28channel ORA_DISK_1: restoring control filechannelORA_DISK_1:reading from backup piece/opt/orac1e/orac1e/product/10. 2. O/db_l/dbs/c-l135325536-20070514-05channel ()RA_DI
42、SK_1: restored backup piece 1piecehandle=/opt/oracle/oracle/product/10. 2. O/db_l/dbs/c-l135325536-20070514-05 tag二TAG20070514T144908channel ()RA_DISK_1: restore complete, elapsed time:00:00:04 outputfilenameVopt/orac 1 e/orac 1 e/oradata/orc 1 /contro 101. ctloutputfilename=/opt/orac1e/orac1e/orada
43、ta/orc1/contro102. ctl outputfilenameVopt/orac1e/orac1e/oradata/orc1/contro103 c11Finished restore at 2007-05-14 16:32:19RMAX shutdown immediate;Oracle instanee shut downRMAX startup;cormected to target database (not started)Oracle instanee started江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程29database mountedRMAX-00571:RM
44、AN-00569:= ERROR MESSAGE STACK FOLLOWSRMAX-00571:RMAX-03002: failure of startup command at 05/14/2007 16:34:49ORA-01589: must use RESETLOGS or NORESETLOGS option for database openRMAN recover database;Starting recover at 2007-05-14 16:39:50allocated channel: ORA_DISK_1channel ()RA_DISK_1: sid二157 de
45、vtype=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: sid=155 devtype二DISKallocated channel: ORA_DISK_3channel ()RA_DISK_3: sid二154 devtype=DISKstarting media recovery江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程30archive log thread 1 sequence 928 is already on disk as file/opt/orac1e/orac1e/oradata/orc1/redo03 logarc
46、hivelogfilen8ine=/opt/oracle/orjicle/%ddta/orcl/redo03 logthread=l sequence二928media recovery complete, elapsed time: 00:00:02Finished recover at 2007-05-14 16:39:58RMAN sqlfalter database open resetlogs;sql statement: alter database open resetlogsnew incarnation of database registered in recovery c
47、atalog startingfull resync of recovery catalogfull resync complete424.5數(shù)據(jù)文件損壞的恢復(fù)4.2.4.5.1單個(gè)數(shù)據(jù)表空間文件損壞命令:alter database datafile 4 offline drop;alter database open;rman target / catalog rman/rmanorcl160run江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程31allocate channel cl type disk;restore datafile 4;recover datafile 4;sql1al
48、ter database datafile 4 online1;release channel cl;alter database open;具體操作:測(cè)試丟失users表空間數(shù)據(jù)文件的恢復(fù)$ sqlplus / as sysdbar,SQL corm scott/tigerSQL create table test (a int) tablespace users;SQL insert into test values (1);SQL commit;SQL select * from test;江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程32SQL insert into test value
49、s(2);SQL commit;SQL select * from test;12SQL corm / as sysdbaSQL alter system switch logfile;SQL alter system switch logfile;SQL shutdown immediate;$ rm /opt/oracle/oracle/oradata/orcl/usersO1. dbfSQL startupORACLE instance started.Total System Global Area285212672 bytes江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程33Fixed
50、Size2020192 bytesVariable Size155192480 bytesDatabase Buffers121634816 bytesRedo Buffers6365184 bytesDatabase mounted.ORA-01157: cannot identify/lock data file 4 - see DBWR trace fileORA-OlllO:datafile4:/opt/orac1e/orac1e/oradata/orc1/usersO1 dbfSQL alter database datafile 4 offline drop;SQL alter d
51、atabase open;RMA恢復(fù)腳本可以是恢復(fù)單個(gè)數(shù)據(jù)文件runallocate charmel cl type disk;restore datafile 4;recover datafile 4;sqlfalter database datafile 4 onliner;release channel cl;也可以是,恢復(fù)表空間江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程34runallocate charmel cl type disk;restore tablespace users; recover tablespace users;alter database datafile
52、4 onliner; release channel cl;RMAN run2 allocate charmel cl type disk;3 restore datafile 4;4 recover datafile 4;5 sql alter database datafile 4 online;6 release channel cl;7 allocated channe1: clcharrnel cl: sid二153 devtype二DISKStarting restore at 2007-05-09 15:21:33charrnel cl: starting datafile ba
53、ckupset restoresql江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程35charrnel cl: specifying datafile(s) to restore from backup setrestoringdatafile00004to/opt/orac1e/orac1e/oradata/orc1/usersO1 dbfchannelcl: reading from backup piece/opt/orac1e/backup/db00RCL_6iih9tsp_210_lchannel cl: restored backup piece 1piecehand1e=/opt/o
54、rac1e/backup/db00RCL_6iih9tsp_210_ltag=DB0channel cl: restore complete, elapsed time: 00:01:46Finished restore at 2007-05-09 15:23:19Starting recover at 2007-05-09 15:23:20channel cl: starting incremental datafile backupset restorecharmel cl: specifying datafile(s) to restore from backup setdestinat
55、ion for restore of datafile 00004:/opt/orac1e/orac1e/oradata/orc1/usersO1 dbfchannelcl: reading from backup piece/opt/orac1e/backup/db1 ()RCL_6q ihal63_218_1charmel cl: restored backup piece 1piecehand1e=/opt/orac1e/backup/db1ORCL_6qihal63_218_1tsDBlchannel cl: restore complete, elapsed time: 00:00:
56、02江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程36starting media recoverymedia recovery complete, elapsed time: 00:00:04Finished recover at 2007-05-09 15:23:26sql statement: alter database datafile 4 online released charmel: clSQL alter database open;SQL select * from scott. test;A124.2.4.S.2數(shù)據(jù)表空間文件損壞并移動(dòng)位置命令:startupselect f
57、rom v$recover_file;江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程37alter database datafile 4 offline;alter database open;rman target / catalog rman/rmanorcl160runallocate channel cl type disk;setnewnamefordatafile4to1/opt/oracle/oracle/oradata/orcl/users02. dbf1;restore datafile 4;switch datafile all;recover datafile 4;sql
58、alter database datafile 4 online1;release channel cl;具體操作:關(guān)閉數(shù)據(jù)庫(kù),模擬丟失數(shù)據(jù)文件SQL shutdown innnediateDatabase closed Database dismounted ORACLE instanee shut down.$ mv usersOl. dbf usersO1. bak江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程38啟動(dòng)數(shù)據(jù)庫(kù),檢查錯(cuò)誤SQL startupORACLE instanee started.Total System Global Area285212672 bytesFixed
59、Size2020192 bytesVariable Size138415264 bytesDatabase Buffers138412032 bytesRedo Buffers6365184 bytesDatabase mounted ORA-01157: cannot identify/lock data file 4 - see DBWR trace fileORA-OlllO:datafile4:/opt/orac1e/orac1e/oradata/orcl/usersO1 dbf查詢v$recover_fileSQL select * from v$recover_file;FILE#
60、 ONLINEONLINE_STATUS ERROR CHANGE# TIME江西中磊股份有限公司系統(tǒng)數(shù)據(jù)備份與恢復(fù)規(guī)程39可以知道有一個(gè)數(shù)據(jù)文件需要恢復(fù),該數(shù)據(jù)文件需要移動(dòng)位置將數(shù)據(jù)文件脫機(jī),并打開(kāi)數(shù)據(jù)庫(kù)SQL alter database datafile 4 offline;SQL alter database open;利用RMAN進(jìn)行恢復(fù)$ rman target / catalog rman/rmanorcll60Recovery Manager: Release 10. 2. 0. 1. 0一Production on星期二5月15 09:54:55 2007Copyright (c)
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年體育場(chǎng)館運(yùn)營(yíng)社會(huì)穩(wěn)定性評(píng)估與風(fēng)險(xiǎn)防范報(bào)告
- 2025年商業(yè)地產(chǎn)數(shù)字化運(yùn)營(yíng)與客戶體驗(yàn)提升解決方案匯編報(bào)告
- 藥品研發(fā)階段管理制度
- 藥品銷售藥店管理制度
- 藥店投訴舉報(bào)管理制度
- 薪酬福利保密管理制度
- 設(shè)備制作日常管理制度
- 設(shè)備工具安全管理制度
- 設(shè)備材料存放管理制度
- 設(shè)備網(wǎng)絡(luò)維護(hù)管理制度
- MOOC 創(chuàng)新管理-浙江大學(xué) 中國(guó)大學(xué)慕課答案
- 梨的貯藏特性及保鮮技術(shù)
- 2024年人參相關(guān)項(xiàng)目實(shí)施方案
- 2024年安徽淮河能源控股集團(tuán)有限責(zé)任公司招聘筆試參考題庫(kù)含答案解析
- 混合痔術(shù)后護(hù)理查房
- 建筑材料采購(gòu)?fù)稑?biāo)方案(技術(shù)標(biāo))
- 挪用資金案諒解書
- 機(jī)械連接預(yù)應(yīng)力混凝土異型樁L19ZG403
- 港口碼頭考核管理制度
- 飛機(jī)儀電與飛控系統(tǒng)原理智慧樹(shù)知到課后章節(jié)答案2023年下中國(guó)人民解放軍海軍航空大學(xué)
- 中醫(yī)刮痧課件
評(píng)論
0/150
提交評(píng)論