




下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、完整的 oracle rman 備份恢復(fù)的例子作者: zhumy1、 建 rman 庫作為 repository$more createrman_db1.shset echo onspool makedb1.logcreate database rmandatafile /export/home/oracle/oradata/rman_data/system.dbf size 50m autoextendon next 640Klogfile /export/home/oracle/oradata/rman_data/redo0101.log SIZE 10M,/export/home/ora
2、cle/oradata/rman_data/redo0201.log SIZE 10Mmaxdatafiles 30maxinstances 8maxlogfiles 64character set US7ASCIInational character set US7ASCII;disconnectspool offexit/export/home/oracle/8.1.6/rdbms/admin/catalog.sql;REM * ALTER SYSTEM TABLESPACE *ALTER TABLESPACE SYSTEMDEFAULT STORAGE ( INITIAL 64K NEX
3、T 64K MINEXTENTS 1 MAXEXTENTS UNLIMITEDPCTINCREASE 50);ALTER TABLESPACE SYSTEMMINIMUM EXTENT 64K;REM * TABLESPACE FOR ROLLBACK *CREATE TABLESPACE RBS DATAFILE /export/home/oracle/oradata/rman_data/rbs.dbf size 50mAUTOEXTEND ON NEXT 512KMINIMUM EXTENT 512KDEFAULT STORAGE ( INITIAL 512K NEXT 512K MINE
4、XTENTS 10 MAXEXTENTS UNLIMITED PC TINCREASE 0 );REM * TABLESPACE FOR TEMPORARY *CREATE TABLESPACE TEMP DATAFILE /export/home/oracle/oradata/rman_data/temp.dbf size 50mAUTOEXTEND ON NEXT 64KMINIMUM EXTENT 64KDEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITEDPCTINCREASE 0) TEMPOR
5、ARY;REM * Creating four rollback segments *CREATE PUBLIC ROLLBACK SEGMENT RBS_0 TABLESPACE RBSSTORAGE ( OPTIMAL 64000K );ALTER ROLLBACK SEGMENT RBS_0 ONLINE;REM*SYS and SYSTEM users*alter user sys temporary tablespace TEMP;alter user system temporary tablespace TEMP;disconnect spool offexit$more cre
6、aterman_db3.shspool crdb3.log/export/home/oracle/8.1.6/rdbms/admin/catproc.sql/export/home/oracle/8.1.6/rdbms/admin/caths.sql/export/home/oracle/8.1.6/rdbms/admin/otrcsvr.sqlconnect system/manager/export/home/oracle/8.1.6/sqlplus/admin/pupbld.sqldisconnectspool offexit2 、建 repository 存放的表空間和rman 用戶$
7、more createrman_db4.shconnect internalcreate tablespace rman_tsdatafile /export/home/oracle/oradata/rman_data/rman_ts.dbfsize 20M default storage (initial 100K next 100K pctincrease 0);create user rman_hainan identified by rman_hainantemporary tablespace TEMPdefault tablespace rman_ts quota unlimite
8、d onrman_ts;grant recovery_catalog_owner to rman_hainan;grant connect ,resource to rman_hainan;3 、建 catalog ,注冊目標(biāo)數(shù)據(jù)庫$more createrman_db5.shrman catalog rman_hainan/rman_hainanrman msglog=rman.logcreate catalog ;exit;rman target sys/oracledb1connect catalog rman_hainan/rman_hainanrmanregister databas
9、e;exit;4、可以開始做備份了。5、做全備$more rmanshell. /export/home/oracle/.profilerman rcvcat rman_hainan/rman_hainanrman target / cmdfile /export/home/oracle/backup_level0.rcv log /export/home/oracle/backup.log$more backup_level0.rcvresync catalog;run allocate channel t1 type disk;backupincremental level 0skip i
10、naccessibletag hot_db_bk_level0filesperset 3format /export/home/oracle/bk_%s_%p_%t.bk(database);sql alter system archive log current;backup filesperset 10format /export/home/oracle/a1_%s_%p_%t.ac(archivelog all delete input);backupformat /export/home/oracle/df_t%t_s%s_p%p.ctcurrent controlfile ;6、做增
11、備$more rmanshell1rman rcvcat rman_hainan/rman_hainanrman target / cmdfile backup_level1.rcv log backup.log$more backup_level1.rcvresync catalog;run allocate channel t1 type disk;backupincremental level 1skip inaccessibletag hot_db_bk_level1filesperset 3format bk_%s_%p_%t.bk1(database);sql alter syst
12、em archive log current;backupfilesperset 10format a1_%s_%p_%t.ac1(archivelog all delete input);backup current controlfile;1、 刪除舊的全備$rman rcvcat rman_hainan/rman_hainanrman target /Recovery Manager: Release .0 - ProductionRMAN-06005: connected to target database: TEST (DBID=1692992254)RMAN-060
13、08: connected to recovery catalog databaseRMAN list backupset;RMAN-03022: compiling command: listList of Backup SetsKey Recid Stamp LV Set Stamp Set Count Completion Time38 145 399987408 0 399987406 153 11-JUN-00根據(jù) key 來刪除舊的備份。RMAN allocate channel for maintenance type disk;RMAN change backupset 169
14、 delete; THIS IS THE COMMAND TO REMOVE THE ENTRY& OS FILE做完后可以看到 list backupset 和操作系統(tǒng)的文件都沒有了。2 、 恢復(fù)( 1) 將數(shù)據(jù)庫啟動到 nomount 狀態(tài):$svrmgrlOracle Server Manager Release .0 - ProductionCopyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.Oracle8i Enterprise Edition Release .0 - 64b
15、it ProductionWith the Partitioning optionJServer Release .0 - ProductionSVRMGR connect internalConnected.SVRMGR startup nomount;ORACLE instance started.Total System Global Area 339275684 bytesFixed Size 94116 bytesVariable Size 318685184 bytesDatabase Buffers 16384000 bytesRedo Buffers 411238
16、4 bytesSVRMGR exitServer Manager complete.( 2 ) 恢復(fù)控制文件:$rman rcvcat rman_hainan/rman_hainanrman target /Recovery Manager: Release .0 - ProductionRMAN-06006: connected to target database: test (not mounted)RMAN-06008: connected to recovery catalog databaseRMAN run 2 allocate channel d1 type di
17、sk;3 restore controlfile;4 release channel d1;5 ( 3 ) 恢復(fù)數(shù)據(jù)文件RMAN run 2 allocate channel d1 type disk;3 sql alter database mount;4 restore datafile 1;5 restore datafile 2;6 restore datafile 3;7 restore datafile 4;8 release channel d1;9 ( 4 ) 恢復(fù)日志文件RMAN run 2 set archivelog destination to /export/home
18、/oracle/admin/test/arch;3 allocate channel d1 type disk;4 restore archivelog all;5 release channel d1;6 會把所有的日志文件恢復(fù)。( 5 ) 根據(jù)日志做recover$svrmgrlOracle Server Manager Release .0 - ProductionCopyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.Oracle8i Enterprise Edition Release 8.1.
19、6.0.0 - 64bit ProductionWith the Partitioning optionJServer Release .0 - ProductionSVRMGR connect internalConnected.SVRMGR recover database using backup controlfile until cancel;ORA-00279: change 51054 generated at 06/11/2000 11:38:37 needed for thread 1ORA-00289: suggestion : /export/home/or
20、acle/admin/test/arch/arch_1_3.arcORA-00280: change 51054 for thread 1 is in sequence #3Specify log: =suggested | filename | AUTO | CANCELLog applied.ORA-00279: change 51058 generated at 06/11/2000 11:38:44 needed for thread 1ORA-00289: suggestion : /export/home/oracle/admin/test/arch/arch_1_4.arcORA
21、-00280: change 51058 for thread 1 is in sequence #4ORA-00278: log file /export/home/oracle/admin/test/arch/arch_1_3.arc no longerneeded for this recoverySpecify log: =suggested | filename | AUTO | CANCELLog applied.ORA-00279: change 51074 generated at 06/11/2000 11:40:20 needed for thread 1ORA-00289
22、: suggestion : /export/home/oracle/admin/test/arch/arch_1_5.arcORA-00280: change 51074 for thread 1 is in sequence #5ORA-00278: log file /export/home/oracle/admin/test/arch/arch_1_4.arc no longerneeded for this recoverySpecify log: =suggested | filename | AUTO | CANCELcancelMedia recovery cancelled.SVRMGR alter database open resetlogs;Statement processed
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- T/CECS 10306-2023智能城鎮(zhèn)燃?xì)庹{(diào)壓裝置
- T/CECS 10224-2022預(yù)拌透水混凝土
- T/CCS 063-2023井工煤礦智能化供排水系統(tǒng)運(yùn)維管理規(guī)范
- T/CCMA 0170-2023挖掘裝載機(jī)燃油消耗量試驗(yàn)方法
- T/CCMA 0015-2023高處作業(yè)吊籃和擦窗機(jī)檢查、維護(hù)保養(yǎng)和安全操作規(guī)則
- T/CC 5-2020商貿(mào)流通企業(yè)誠信管理體系
- T/CAS 840-2024電動汽車公共充電站運(yùn)營管理服務(wù)導(dǎo)則
- T/CAQI 34-2017新風(fēng)凈化機(jī)顆粒物凈化性能分級
- java分組面試題及答案
- 中教美育java面試題及答案
- 沈陽師范大學(xué)教學(xué)實(shí)驗(yàn)平臺建設(shè)規(guī)劃
- 巴西詳細(xì)教案
- 乙型肝炎病毒表面抗原膠體金法說明書
- 基于PLC控制的物料分揀系統(tǒng)設(shè)計(jì)
- 人教部編版七年級歷史下冊教材插圖匯總
- 濟(jì)南市城鄉(xiāng)建設(shè)用地增減掛鉤試點(diǎn)項(xiàng)目管理辦法
- 建筑工程竣工驗(yàn)收報(bào)告山西
- 啟閉機(jī)房腳手架工程施工專項(xiàng)方案
- 變更監(jiān)事模板
- 標(biāo)準(zhǔn)工程量清單細(xì)目編號公路工程
- 管道安裝工藝質(zhì)量培訓(xùn)(共39頁).ppt
評論
0/150
提交評論