版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、将10g RAC库用rman的方式备份并恢复到异机-刚试验通过与大家分享主 RAC 库:2 个节点 采用 ASM+RAW备机 文件系统一。在rac库备份:rac1- crs_stat -tName Type Target State Host即 即 ora.b1.inst application ONLINE ONLINE raclora.b2.inst application ONLINE ONLINE rac2rac1-rac1- export ORACLE_SID=racdb1rac1- rma n target / no catalogRMAN run2 allocate CHANNE
2、L chOO type DISK CONNECT sys/oracleracdb1;3 allocate CHANNEL ch01 type DISK CONNECT sys/oracleracdb2;4 backup database format /rma nset/racdb_full_%d%t%s%p tag fullbackup; 5 BACKUP FORMAT /rma nset/%d_arch_%s_%p_%h ARCHIVELOG ALL;6 backup format /rma nset/cf_%d_%s_%p7 (curre nt con trolfile;8 RELEAS
3、E CHANNEL ch00;9 RELEASE CHANNEL ch01;10 allocated cha nn el: ch00cha nnel ch00: sid=148 in sta nce=racdb1 devtype=DISKallocated cha nn el: ch01cha nnel ch01: sid=148 in sta nce=racdb2 devtype=DISKStarti ng backup at 02-NOV-08cha nnel ch00: start ing full datafile backupsetcha nnel ch00: specify ing
4、 datafile(s in backupsetin put datafile fno=000041 at 02-NOV-08cha nnel ch01: start ing full datafile backupsetcha nnel ch01: specify ing datafile(s in backupsetinput datafile fno=000021 at 02-NOV-08cha nnel ch00: fin ished piece 1 at 02-NOV-08piece han dle=/rma nset/racdb_full_RACDB669769770931 tag
5、=FULLBACKUPcomme nt=NONEcha nnel ch00: backup set complete, elapsed time: 00:02:19cha nnel ch00: start ing full datafile backupsetcha nnel ch00: specify ing datafile(s in backupsetin clud ing curre nt con trol file in backupsetchannel chOO: starting piece 1 at 02-NOV-08channel ch01: finished piece 1
6、 at 02-NOV-08piece han dle=/rma nset/racdb_full_RACDB669769784941 tag=FULLBACKUP comme nt=NONEcha nnel ch01: backup set complete, elapsed time: 00:02:28cha nnel ch01: start ing full datafile backupsetcha nnel ch01: specify ing datafile(s in backupsetin clud ing curre nt SPFILE in backupsetchannel ch
7、01: starting piece 1 at 02-NOV-08cha nnel ch00: fin ished piece 1 at 02-NOV-08piece han dle=/rma nset/racdb_full_RACDB669769914951 tag=FULLBACKUP comme nt=NONEcha nnel ch00: backup set complete, elapsed time: 00:00:11channel ch01: finished piece 1 at 02-NOV-08piece han dle=/rma nset/racdb_full_RACDB
8、669769933961 tag=FULLBACKUP comme nt=NONEcha nnel ch01: backup set complete, elapsed time: 00:00:05Fin ished backup at 02-NOV-08Starti ng backup at 02-NOV-08curre nt log archivedcha nnel chOO: start ing archive log backupsetcha nnel chOO: specify ing archive log(s in backup setin put archive log thr
9、ead=1 seque nce=42 recid=141 stamp=669603048in put archive log thread=1 seque nce=44 recid=149 stamp=669640424in put archive log thread=1 seque nce=45 recid=151 stamp=669675778in put archive log thread=1 seque nce=46 recid=152 stamp=669679426in put archive log thread=1 seque nce=47 recid=156 stamp=6
10、69690456channel ch00: starting piece 1 at 02-NOV-08cha nnel ch01: start ing archive log backupsetcha nnel ch01: specify ing archive log(s in backup setin put archive log thread=1 seque nce=53 recid=170 stamp=669767346in put archive log thread=1 seque nce=54 recid=172 stamp=669769357in put archive lo
11、g thread=2 seque nce=44 recid=165 stamp=669764276in put archive log thread=2 seque nce=45 recid=167 stamp=669765472in put archive log thread=2 seque nce=46 recid=168 stamp=669765474in put archive log thread=2 seque nce=47 recid=169 stamp=669767345in put archive log thread=2 seque nce=48 recid=171 st
12、amp=669769352in put archive log thread=2 seque nce=49 recid=175 stamp=669769944channel chO1: starting piece 1 at 02-NOV-08cha nnel chO1: fin ished piece 1 at 02-NOV-08piece han dle=/rma nset/RACDB_arch_98_1_2 tag=TAG20081102T231211comme nt=NONE cha nnel ch01: backup set complete, elapsed time: 00:00
13、:04 cha nnel ch00: fin ished piece 1 at 02-NOV-08piece han dle=/rma nset/RACDB_arch_97_1_1 tag=TAG20081102T231211comme nt=NONE cha nnel ch00: backup set complete, elapsed time: 00:00:11cha nnel ch00: start ing archive log backupsetcha nnel ch00: specify ing archive log(s in backup setin put archive
14、log thread=1 seque nce=48 recid=158 stamp=669690550in put archive log thread=1 seque nce=49 recid=160 stamp=669691146in put archive log thread=1 seque nce=50 recid=162 stamp=669755973in put archive log thread=1 seque nce=51 recid=163 stamp=669757116input archive log thread=1 seque nce=52 recid=166 s
15、tamp=669764278in put archive log thread=1 seque nce=55 recid=173 stamp=669769375 input archive log thread=1 seque nce=56 recid=174 stamp=669769928 channel ch00: starting piece 1 at 02-NOV-08cha nnel ch00: fin ished piece 1 at 02-NOV-08piece han dle=/rma nset/RACDB_arch_99_1_1 tag=TAG20081102T231211c
16、omme nt=NONE cha nnel ch00: backup set complete, elapsed time: 00:00:08Fin ished backup at 02-NOV-08Starti ng backup at 02-NOV-08cha nnel ch00: start ing full datafile backupsetcha nnel ch00: specify ing datafile(s in backupsetin clud ing curre nt con trol file in backupsetchannel ch00: starting pie
17、ce 1 at 02-NOV-08cha nnel ch00: fin ished piece 1 at 02-NOV-08piece han dle=/rma nset/cf_RACDB_100_1 tag=TAG20081102T231235comme nt=NONEcha nnel ch00: backup set complete, elapsed time: 00:00:07Fin ished backup at 02-NOV-08released cha nn el: ch00released cha nn el: ch012. 在rac库上创建pfileSQL create pf
18、ile=/rma nset/i nitracdb.ora from spfile;将rac1,rac2上的备份出来的rman文件和pfile ftp至standby主机二:standby主机做恢复的过程:0.修改ftp过来的pfile ,主要是rac中一些参数去掉:#*cluster_database_i nsta nces=2.cluster database=false#racdb2.i nsta nce_nu mber=2#racdb1.i nsta nce_nu mber=1#racdb2.thread=2#racdb1.thread=1#racdb2.u ndo_tablespace
19、=UNDOTBS2#*.db_file_name_co nvert=+RACDATA/racdb/datafile/,/oradata/racdb/#*.fal_clie nt=RACDB#*.fal_server=STANDBY#*.log_archive_co nfig=DG_CONFIG=(racdb,sta ndby#racdb2.log archive dest 1=LOCATION=/racdb2 archVALID_FOR=(ALL_LOGFILES,ALL_ROLES DB_UNIQUE_NAME=racdb#*log_archive_dest_2=SERVICE=sta nd
20、by LGWR ASYNCVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLEDB_UNIQUE_NAME=sta ndby#*.log archive dest state 2=ENABLE#*.log_file_name_co nv ert=+RACDATA/racdb/o nli nelog/,/oradata/racdb/#*remote_liste ner=LISTENERS_RACDB #*.sta ndby_file_ma nageme nt=AUTO1. 数据库启动到nomount2. restore con trolfile3. restore ar
21、chivelog4. recover database5. 改变logfile的位置連新建redo6. drop 个 undo tablespace.7. add a temp tablespace8. 配 tnsn ames.ora和 liste ner .ora下为操作的过程:sta ndby- rma n target /- Production on Sun Nov 2 14:22:39 2008 Copyright (c 1982, 2005, Oracle. All rights reserved.conn ected to target database: racdb (not
22、moun ted-恢复 con trolfileRMAN restore con trolfile from /rma nset/cf_RACDB_100_1;Starti ng restore at 02-NOV-08using cha nnel ORA_DISK_1cha nnel ORA_DISK_1: restori ng control filecha nnel ORA_DISK_1: restore complete, elapsed time: 00:00:05output file name=/oradata/racdb/c on trolOl.ctlFi nished res
23、tore at 02-NOV-08-restore datafile and archive logRMAN sql alter database mou nt;sql stateme nt: alter database mountreleased channel: ORA_DISK_1RMAN run2 set un til seque nee 57 thread 1;3 set newn ame for datafile 1 to 7oradata/racdb/system01.dbf;4 set newn ame for datafile 2 to /oradata/racdb/un
24、dotbsOl.dbf;5 set newn ame for datafile 3 to 7oradata/racdb/sysaux01.dbf;6 set newn ame for datafile 4 to 7oradata/racdb/users01.dbf;7 set newn ame for datafile 5 to /oradata/racdb/un dotbs02.dbf;8 restore database;9 switch datafile all;10 executi ng comma nd: SET un til clauseexecuti ng comma nd: S
25、ET NEWNAMEexecuti ng comma nd: SET NEWNAMEexecuti ng comma nd: SET NEWNAMEexecuti ng comma nd: SET NEWNAMEexecuti ng comma nd: SET NEWNAMEStarti ng restore at 02-NOV-08allocated cha nn el: ORA_DISK_1cha nnel ORA_DISK_1: sid=155 devtype=DISKcha nnel ORA_DISK_1: starti ng datafile backupset restorecha
26、 nnel ORA_DISK_1: specify ing datafile(s to restore from backup setrestori ng datafile 00001 to /oradata/racdb/system01.dbfrestori ng datafile 00004 to /oradata/racdb/users01.dbfrestori ng datafile 00005 to /oradata/racdb/u ndotbs02.dbfcha nnel ORA_DISK_1: read ing from backup piece/rma nset/racdb_f
27、ull_RACDB669769770931cha nnel ORA_DISK_1: restored backup piece 1piece han dle=/rma nset/racdb_full_RACDB669769770931 tag=FULLBACKUPcha nnel ORA_DISK_1: restore complete, elapsed time: 00:00:36cha nnel ORA_DISK_1: starti ng datafile backupset restorecha nnel ORA_DISK_1: specify ing datafile(s to res
28、tore from backup setrestori ng datafile 00002 to /oradata/racdb/u ndotbs01.dbfrestori ng datafile 00003 to /oradata/racdb/sysaux01.dbfcha nnel ORA_DISK_1: read ing from backup piece/rma nset/racdb_full_RACDB669769784941cha nnel ORA_DISK_1: restored backup piece 1piece han dle=/rma nset/racdb_full_RA
29、CDB669769784941 tag=FULLBACKUPcha nnel ORA_DISK_1: restore complete, elapsed time: 00:00:35Fi nished restore at 02-NOV-08datafile 1 switched to datafile copyin put datafile copy recid=10 stamp=669738296file name=/oradata/racdb/system01.dbf datafile 2 switched to datafile copyin put datafile copy rec
30、id=11 stamp=669738296file name=/oradata/racdb/u ndotbs01.dbf datafile 3 switched to datafile copyin put datafile copy recid=12 stamp=669738296file name=/oradata/racdb/sysaux01.dbf datafile 4 switched to datafile copyin put datafile copy recid=13 stamp=669738297 file name=/oradata/racdb/users01.dbfda
31、tafile 5 switched to datafile copyin put datafile copy recid=14 stamp=669738297file name=/oradata/racdb/u ndotbs02.dbf RMAN-列出备份的archivelog:RMAN list backup of archivelog all;using target database con trol file in stead of recovery catalogList of Backup SetsBS Key Size Device Type Elapsed Time Compl
32、eti on Time89 2.44M DISK 00:00:03 02-NOV-08BP Key: 89 Status: AVAILABLE Compressed: NO Tag: TAG20081102T231211Piece Name: /rma nset/RACDB_arch_98_1_2List of Archived Logs in backup set 89Thrd Seq Low SCN Low Time Next SCN Next Time1 53 356353 02-NOV-08 396535 02-NOV-081 54 396535 02-NOV-08 398232 02
33、-NOV-082 44 350717 02-NOV-08 356350 02-NOV-082 45 356350 02-NOV-08 376487 02-NOV-082 46 376487 02-NOV-08 396536 02-NOV-082 47 396536 02-NOV-08 397820 02-NOV-082 48 397820 02-NOV-08 398228 02-NOV-082 49 398228 02-NOV-08 398963 02-NOV-08BS Key Size Device Type Elapsed Time Completi on Time90 17.42M DI
34、SK 00:00:07 02-NOV-08BP Key: 90 Status: AVAILABLE Compressed: NO Tag: TAG20081102T231211Piece Name: /rma nset/RACDB_arch_97_1_1List of Archived Logs in backup set 90Thrd Seq Low SCN Low Time Next SCN Next Time1 42 285767 01-NOV-08 285925 01-NOV-081 44 286441 01-NOV-08 286516 01-NOV-081 45 286516 01-
35、NOV-08 308174 01-NOV-081 46 308174 01-NOV-08 312441 01-NOV-081 47 312441 01-NOV-08 324657 02-NOV-08BS Key Size Device Type Elapsed Time Completi on Time91 9.69M DISK 00:00:04 02-NOV-08BP Key: 91 Status: AVAILABLE Compressed: NO Tag: TAG20081102T231211Piece Name: /rma nset/RACDB_arch_99_1_1List of Ar
36、chived Logs in backup set 91Thrd Seq Low SCN Low Time Next SCN Next Time1 48 324657 02-NOV-08 324727 02-NOV-081 49 324727 02-NOV-08 325613 02-NOV-081 50 325613 02-NOV-08 349040 02-NOV-081 51 349040 02-NOV-08 350714 02-NOV-081 52 350714 02-NOV-08 356353 02-NOV-081 55 398232 02-NOV-08 398433 02-NOV-08
37、1 56 398433 02-NOV-08 398960 02-NOV-08-restore archivelog and recover database.RMANRMAN run2 set archivelog destination to 7racdb_arch;3 restore archivelog from seque nee 49 thread 2;4executi ng comma nd: SET ARCHIVELOG DESTINATIONStarti ng restore at 02-NOV-08using cha nnel ORA_DISK_1cha nnel ORA_D
38、ISK_1: starti ng archive log restore to user-specified dest in ati onarchive log dest in ati on= /racdb_archcha nnel 0RA_DISK_1: restori ng archive logarchive log thread=2 seque nce=49cha nnel ORA_DISK_1: readi ng from backup piece /rma nset/RACDB_arch_98_1_2cha nnel ORA_DISK_1: restored backup piec
39、e 1piece han dle=/rma nset/RACDB_arch_98_1_2 tag=TAG20081102T231211cha nnel ORA_DISK_1: restore complete, elapsed time: 00:00:02Fi nished restore at 02-NOV-08RMANRMANRMAN run2 set archivelog destination to 7racdb_arch;3 restore archivelog from seque nee 44 thread 2;4 executi ng comma nd: SET ARCHIVE
40、LOG DESTINATIONStarti ng restore at 02-NOV-08using cha nnel ORA_DISK_1archive log thread 2 seque nee 49 is already on disk as file/racdb_arch/2_49_669487401.dbf channel ORA_DISK_1: starti ng archive log restore touser-specified dest in ati onarchive log dest in ati on= /racdb_archcha nnel ORA_DISK_1
41、: restori ng archive logarchive log thread=2 seque nce=44cha nnel ORA_DISK_1: restori ng archive logarchive log thread=2 seque nce=45cha nnel ORA_DISK_1: restori ng archive logarchive log thread=2 seque nce=46cha nnel ORA_DISK_1: restori ng archive logarchive log thread=2 seque nce=47cha nnel ORA_DI
42、SK_1: restori ng archive logarchive log thread=2 seque nce=48cha nnel ORA_DISK_1: readi ng from backup piece /rma nset/RACDB_arch_98_1_2cha nnel ORA_DISK_1: restored backup piece 1piece han dle=/rma nset/RACDB_arch_98_1_2 tag=TAG20081102T231211cha nnel ORA_DISK_1: restore complete, elapsed time: 00:
43、00:02Fi nished restore at 02-NOV-08RMAN run2 set un til seque nee 57 thread 1;3 recover database;4 executi ng comma nd: SET un til clauseStarti ng recover at 02-NOV-08using cha nnel ORA_DISK_1starti ng media recoveryarchive log thread 2 seque nee 49 is already on disk as file/racdb_arch/2_49_6694874
44、01.dbf channel ORA_DISK_1: starti ng archive log restore to default desti nati oncha nnel ORA_DISK_1: restori ng archive logarchive log thread=1 seque nce=56cha nnel ORA_DISK_1: readi ng from backup piece /rma nset/RACDB_arch_99_1_1cha nnel ORA_DISK_1: restored backup piece 1piece han dle=/rma nset/
45、RACDB_arch_99_1_1 tag=TAG20081102T231211cha nnel ORA_DISK_1: restore complete, elapsed time: 00:00:02archive log file name=/racdb_arch/1_56_669487401.dbf thread=1 seque nce=56archive log file name=/racdb_arch/2_49_669487401.dbf thread=2 seque nce=49 media recovery complete, elapsed time: 00:00:01Fin
46、 ished recover at 02-NOV-08-对redo作修改:SQL select member from v$logfile;MEMBERSQL alter database ren ame fileDatabase altered.7oradata/racdb/redo4;Database altered.SQLDatabase altered.SQLDatabase altered.SQL alter database ope n resetlogs;Database altered.SQLSQLSQLSQL select THREAD#, STATUS, ENABLED f
47、rom v$thread;THREAD# STATUS ENABLED1 OPEN PUBLIC2 CLOSED PUBLICSQLSQL select group# from v$log where THREAD#=2;GROUP#34SQL alter database disable thread 2;Database altered.SQL alter database drop logfile group 4;alter database drop logfile group 4*ERROR at line 1:ORA-00350: log 4 of in sta nee racdb2 (thread 2 needs to be archivedORA-00312: on li ne log 4 thread 2: 7oradata/racdb/redo4SQL alter database clear un archived logfile group 3;Database altered.SQL alter databa
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 银行保证合同
- 方出资方出力合同范本
- 2024年度吊车租赁及维护合同3篇
- 2024年度软件开发与维护合同标的2篇
- 协议的名词解释
- 洗煤销售合作协议书
- 2024年度融资租赁合同标的为汽车租赁2篇
- 基于2024年度市场的产品代理销售合同
- 年度广告投放合作伙伴协议(04版)
- 2024年度个体工商户供应链合作协议2篇
- 大学生创业英语智慧树知到期末考试答案章节答案2024年广西师范大学
- 输灰双套管安装说明
- 温暖人心的父爱——群文阅读优秀教案
- 最新办公楼物业交接表格资料
- 《危险驾驶罪》PPT课件.ppt
- 2022年2022年普通话语流音变训练
- 钳工教学中钻孔方法的改进探究
- 水轮机结构介绍(经典)
- 高处作业基本知识高处不胜寒安全不能忘
- 管道支架载荷计算
- 防火门安装施工方案
评论
0/150
提交评论