BBED SKIP ARCHIVE RECOVER
[i]1.1 [i]环境准备[size=10.0pt]SQL>select * from v$version;[size=10.0pt]BANNER[size=10.0pt]----------------------------------------------------------------[size=10.0pt]OracleDatabase 10g Enterprise Edition Release 10.2.0.5.0 - 64bi[size=10.0pt]PL/SQLRelease 10.2.0.5.0 - Production[size=10.0pt]CORE 10.2.0.5.0 Production[size=10.0pt]TNSfor Linux: Version 10.2.0.5.0 - Production[size=10.0pt]NLSRTLVersion 10.2.0.5.0 – Production[i][size=10.0pt]create tablespace willson datafile '/u01/oracle/oradata/orcl/willson1.dbf' size50m;[i][size=10.0pt]alter tablespace willson add datafile'/u01/oracle/oradata/orcl/willson2.dbf' size 50m;[i][size=10.0pt]alter tablespace willson add datafile'/u01/oracle/oradata/orcl/willson3.dbf' size 50m;[size=10.0pt]SQL> archive log list[size=10.0pt]Database log mode Archive Mode[size=10.0pt]Automatic archival Enabled[size=10.0pt]Archive destination /u01/oracle/archive[size=10.0pt]Oldest online log sequence 57[size=10.0pt]Next log sequence to archive 58[size=10.0pt]Current log sequence 58[size=10.0pt] [size=10.0pt]s[size=10.0pt]elect HXFIL File_num,substr(HXFNM,1,40) File_name, FHSCN SCN,FHSTA status ,FHRBA_SEQ Sequence from X$KCVFH;[size=10.0pt]FILE_NUMFILE_NAME SCN STATUS SEQUENCE[size=10.0pt]------------------------------------------------------- ---------------- --------------------[size=10.0pt] 1/u01/oracle/oradata/orcl/system01.dbf 948761 8196 57[size=10.0pt] 2/u01/oracle/oradata/orcl/undotbs01.dbf 948761 4 57[size=10.0pt] 3/u01/oracle/oradata/orcl/sysaux01.dbf 948761 4 57[size=10.0pt] 4/u01/oracle/oradata/orcl/users01.dbf 948761 4 57[size=10.0pt] 5/u01/oracle/oradata/orcl/willson1.dbf 949022 4 57[size=10.0pt] 6/u01/oracle/oradata/orcl/willson2.dbf 949052 4 57[size=10.0pt] 7/u01/oracle/oradata/orcl/willson3.dbf 949078 4 57[size=10.0pt] y file[size=10.0pt] FHCCC NUMBER Control fileCheckpoint Count at read before write[size=10.0pt] FHBHZ NUMBER 7.3 file size when begin hot backup[size=10.0pt] FHBCP_SCN VARCHAR2(16) SCN allocated for backup checkpoint[size=10.0pt] FHBCP_TIM VARCHAR2(20) TIMe when SCN allocated[size=10.0pt] FHBCP_THR NUMBER THRead whichallocated SCN[size=10.0pt]Backup CheckPoint RBA whereSCN was allocated:[size=10.0pt] FHBCP_RBA_SEQ NUMBER log seq #[size=10.0pt] FHBCP_RBA_BNO NUMBER block # in logfile[size=10.0pt] FHBCP_RBA_BOF NUMBER byte offset inblock[size=10.0pt] FHBCP_ETB RAW(8) EnabledThreads Bitvec[size=10.0pt] FHBHZ NUMBER 8.x file size when begin hot backup[size=10.0pt] FHXCD RAW(16) 8.x external cache id[size=10.0pt] FHTSN NUMBER 8.x tablespace number[size=10.0pt] FHTNM VARCHAR2(30) 8.x tablespace name[size=10.0pt] FHRFN NUMBER 8.x relative file number[size=10.0pt] FHAFS VARCHAR2(16) 8.x Absolute Fuzzy SCN[size=10.0pt] FHRFS VARCHAR2(16) 8.x media Recovery Fuzzy SCN[size=10.0pt] FHRFT VARCHAR2(20) 8.x media Recovery Fuzzy Timestamp[size=10.0pt] HXIFZ NUMBER 8.x is fuzzy flag[size=10.0pt] HXNRCV NUMBER 8.x need recovery flag[size=10.0pt] HXFNM VARCHAR2(513) 8.x datafile name[size=10.0pt] FHPOFB NUMBER 8.x previous version SDBAOFBITS (File #1 only)[size=10.0pt] FHPNFB NUMBER 8.x previous version SDBANFBITS (File #1 only)[size=10.0pt]SQL>create user willson identified by willson default tablespace willson;[size=10.0pt]Usercreated.[size=10.0pt]SQL>grant dba to willson;[size=10.0pt]Grantsucceeded.[size=10.0pt]我这里是使用willson 用户创建了一张test 表并且插入500条数据。[size=10.0pt]SQL>create table test (id number,name varchar2(50));[size=10.0pt]Tablecreated.[size=10.0pt]SQL>begin[size=10.0pt] for i in 1 .. 500 loop[size=10.0pt] insert into testvalues(i,'willson');[size=10.0pt] commit;[size=10.0pt] end loop;[size=10.0pt] end; 2 3 4 5 6 [size=10.0pt] 7 /[size=10.0pt]PL/SQLprocedure successfully completed.[size=10.0pt]SQL>[size=10.0pt]SQL>select count(*) from test;[size=10.0pt] COUNT(*)[size=10.0pt]----------[size=10.0pt] 500[size=10.0pt]
[size=10.0pt]做了几次logfile 切换。[size=10.0pt]SQL>alter system switch logfile;[size=10.0pt]Systemaltered.[size=10.0pt]SQL>/[size=10.0pt]Systemaltered.[size=10.0pt]SQL>/[size=10.0pt]Systemaltered.[size=10.0pt]SQL>/[size=10.0pt]Systemaltered.[size=10.0pt]SQL>/[size=10.0pt]Systemaltered.[size=10.0pt]SQL>/[size=10.0pt]Systemaltered.[size=10.0pt][oracle@db1archive]$ ls -l[size=10.0pt]total2420[size=10.0pt]-rw-r-----1 oracle oinstall 2041344 Feb 5 17:051_57_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 1024 Feb 5 17:05 1_58_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 4096 Feb 5 17:05 1_59_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 4096 Feb 5 17:05 1_60_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 1536 Feb 5 17:05 1_61_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 1024 Feb 5 17:05 1_62_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 384000 Feb 5 17:09 1_63_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 1024 Feb 5 17:09 1_64_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 2560 Feb 5 17:09 1_65_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 1024 Feb 5 17:09 1_66_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 1024 Feb 5 17:09 1_67_769085431.dbf[size=10.0pt]-rw-r-----1 oracle oinstall 1024 Feb 5 17:09 1_68_769085431.dbf [i]1.2 [i]BBED [i]安装[size=10.0pt][oracle@db1lib]$ cd /u01/oracle/product/10.2.0/db_1/rdbms/lib[i][size=10.0pt][oracle@db1 lib]$ make -fins_rdbms.mk $ORACLE_HOME/rdbms/lib/bbed[size=10.0pt]LinkingBBED utility (bbed)
[i]1.3 [i]测试过程[size=10.0pt]对[size=10.0pt] datafile 5[size=10.0pt]进行[size=10.0pt]offline[size=10.0pt]操作[size=10.0pt]SQL>alter database datafile 5 offline;[size=10.0pt]SQL>alter system switch logfile;[size=10.0pt] [size=10.0pt]多做几次redo switch[size=10.0pt]Systemaltered.[size=10.0pt]SQL>select HXFIL File_num,substr(HXFNM,1,40) File_name, FHSCN SCN, FHSTA status,FHRBA_SEQ Sequence from X$KCVFH;[size=10.0pt] FILE_NUM FILE_NAME SCN STATUS SEQUENCE[size=10.0pt]------------------------------------------------------- ---------------- ---------- [size=10.0pt] 1/u01/oracle/oradata/orcl/system01.dbf 950660 8196 71[size=10.0pt] 2/u01/oracle/oradata/orcl/undotbs01.dbf 950660 4 71[size=10.0pt] 3/u01/oracle/oradata/orcl/sysaux01.dbf 950660 4 71[size=10.0pt] 4/u01/oracle/oradata/orcl/users01.dbf 950660 4 71[size=10.0pt] 5 /u01/oracle/oradata/orcl/willson1.dbf 950658 4 70[size=10.0pt] 6/u01/oracle/oradata/orcl/willson2.dbf 950660 4 71[size=10.0pt] 7/u01/oracle/oradata/orcl/willson3.dbf 950660 4 71[size=10.0pt]SQL>archive log list[size=10.0pt]Databaselog mode Archive Mode[size=10.0pt]Automaticarchival Enabled[size=10.0pt]Archivedestination /u01/oracle/archive[size=10.0pt]Oldest online log sequence 71[size=10.0pt]Nextlog sequence to archive 73[size=10.0pt]Currentlog sequence 73[size=10.0pt]SQL>select file#,ONLINE_STATUS,ERROR,CHANGE# from V$RECOVER_FILE order by 1;[size=10.0pt] FILE# ONLINE_ ERROR CHANGE#[size=10.0pt]----------------- ----------------------------------------------------------------- [size=10.0pt] 5 OFFLINE 950658[size=10.0pt]SQL>select name, checkpoint_change# from v$datafile;[size=10.0pt]NAME CHECKPOINT_CHANGE#[size=10.0pt]---------------------------------------------------------------[size=10.0pt]/u01/oracle/oradata/orcl/system01.dbf 950660[size=10.0pt]/u01/oracle/oradata/orcl/undotbs01.dbf 950660[size=10.0pt]/u01/oracle/oradata/orcl/sysaux01.dbf 950660[size=10.0pt]/u01/oracle/oradata/orcl/users01.dbf 950660[size=10.0pt]/u01/oracle/oradata/orcl/willson1.dbf 950658[size=10.0pt]/u01/oracle/oradata/orcl/willson2.dbf 950660[size=10.0pt]/u01/oracle/oradata/orcl/willson3.dbf 950660[size=10.0pt]现在已经把datafile 5offline 了可以通过SCN 和SEQ观察。[size=10.0pt]下面我们通过BBED观察下正常的datafile 的情况[size=10.0pt][oracle@db1oracle]$ bbed parfile=bbed.txt [size=10.0pt]Password:[size=10.0pt]BBED:Release 2.0.0.0.0 - Limited Production on Sun Feb 5 17:21:22 2012[size=10.0pt]Copyright(c) 1982, 2007, Oracle. All rightsreserved.[size=10.0pt]*************!!! For Oracle Internal Use only !!! ***************[size=10.0pt]BBED>set file 6[size=10.0pt] FILE# 6[size=10.0pt]BBED>map /v[size=10.0pt] File: /u01/oracle/oradata/orcl/willson2.dbf(6)[size=10.0pt] Block: 1 Dba:0x01800001[size=10.0pt]------------------------------------------------------------[size=10.0pt] Data File Header[size=10.0pt] struct kcvfh, 676 bytes [size=10.0pt] @0 [size=10.0pt] struct kcvfhbfh, 20 bytes @0 [size=10.0pt] struct kcvfhhdr, 76 bytes @20 [size=10.0pt] ub4 kcvfhrdb @96 [size=10.0pt] struct kcvfhcrs, 8 bytes @100 [size=10.0pt] ub4 kcvfhcrt @108 [size=10.0pt] ub4 kcvfhrlc @112 [size=10.0pt] struct kcvfhrls, 8 bytes @116 [size=10.0pt] ub4 kcvfhbti @124 [size=10.0pt] struct kcvfhbsc, 8 bytes @128 [size=10.0pt] ub2 kcvfhbth @136 [size=10.0pt] ub2 kcvfhsta @138 [size=10.0pt] struct kcvfhckp, 36 bytes @484 [size=10.0pt] ub4 kcvfhcpc @140 [size=10.0pt] ub4 kcvfhrts @144 [size=10.0pt] ub4 kcvfhccc @148 [size=10.0pt] struct kcvfhbcp, 36 bytes @152 [size=10.0pt] ub4 kcvfhbhz @312 [size=10.0pt] s[size=10.0pt] [size=10.0pt]BBED> p kcvfh[size=10.0pt]structkcvfh, 676 bytes @0 [size=10.0pt] struct kcvfhbfh, 20 bytes @0 [size=10.0pt] ub1 type_kcbh @0 0x0b[size=10.0pt] ub1 frmt_kcbh @1 0xa2[size=10.0pt] ub1 spare1_kcbh @2 0x00[size=10.0pt] ub1 spare2_kcbh @3 0x00[size=10.0pt] ub4 rdba_kcbh @4 0x01800001[size=10.0pt] ub4 bas_kcbh @8 0x00000000[size=10.0pt] ub2 wrp_kcbh @12 0x0000[size=10.0pt] ub1 seq_kcbh @14 0x01[size=10.0pt] ub1 flg_kcbh @15 0x04 (KCBHFCKV)[size=10.0pt] ub2 chkval_kcbh @16 0xf4b7[size=10.0pt] ub2 spare3_kcbh @18 0x0000[size=10.0pt] struct kcvfhhdr, 76 bytes @20 [size=10.0pt] ub4 kccfhswv @20 0x00000000[size=10.0pt] ub4 kccfhcvn @24 0x0a200100[size=10.0pt] ub4 kccfhdbi @28 0x4d4c9b77[size=10.0pt] text kccfhdbn[0] @32 O[size=10.0pt] text kccfhdbn[1] @33 R[size=10.0pt] text kccfhdbn[2] @34 C[size=10.0pt] text kccfhdbn[3] @35 L[size=10.0pt] text kccfhdbn[4] @36 [size=10.0pt] text kccfhdbn[5] @37 [size=10.0pt] text kccfhdbn[6] @38 [size=10.0pt] text kccfhdbn[7] @39 [size=10.0pt] ub4 kccfhcsq @40 0x00000217[size=10.0pt] ub4 kccfhfsz @44 0x00001900[size=10.0pt] s_blkz kccfhbsz @48 0x00[size=10.0pt] ub2 kccfhfno @52 0x0006[size=10.0pt] ub2 kccfhtyp @54 0x0003[size=10.0pt] ub4 kccfhacid @56 0x00000000[size=10.0pt] ub4 kccfhcks @60 0x00000000[size=10.0pt] text kccfhtag[0] @64 [size=10.0pt] text kccfhtag[1] @65 [size=10.0pt] text kccfhtag[2] @66 [size=10.0pt] text kccfhtag[3] @67 [size=10.0pt] text kccfhtag[4] @68 [size=10.0pt] text kccfhtag[5] @69 [size=10.0pt] text kccfhtag[6] @70 [size=10.0pt] text kccfhtag[7] @71 [size=10.0pt] text kccfhtag[8] @72 [size=10.0pt] text kccfhtag[9] @73 [size=10.0pt] text kccfhtag[10] @74 [size=10.0pt] text kccfhtag[11] @75 [size=10.0pt] text kccfhtag[12] @76 [size=10.0pt] text kccfhtag[13] @77 [size=10.0pt] text kccfhtag[14] @78 [size=10.0pt] text kccfhtag[15] @79 [size=10.0pt] text kccfhtag[16] @80 [size=10.0pt] text kccfhtag[17] @81 [size=10.0pt] text kccfhtag[18] @82 [size=10.0pt] text kccfhtag[19] @83 [size=10.0pt] text kccfhtag[20] @84 [size=10.0pt] text kccfhtag[21] @85 [size=10.0pt] text kccfhtag[22] @86 [size=10.0pt] text kccfhtag[23] @87 [size=10.0pt] text kccfhtag[24] @88 [size=10.0pt] text kccfhtag[25] @89 [size=10.0pt] text kccfhtag[26] @90 [size=10.0pt] text kccfhtag[27] @91 [size=10.0pt] text kccfhtag[28] @92 [size=10.0pt] text kccfhtag[29] @93 [size=10.0pt] text kccfhtag[30] @94 [size=10.0pt] text kccfhtag[31] @95 [size=10.0pt] ub4 kcvfhrdb @96 0x00000000[size=10.0pt] struct kcvfhcrs, 8 bytes @100 [size=10.0pt] ub4 kscnbas @100 0x000e7b39[size=10.0pt] ub2 kscnwrp @104 0x0000[size=10.0pt] ub4 kcvfhcrt @108 0x2e296417[size=10.0pt] ub4 kcvfhrlc @112 0x2dd74ff7[size=10.0pt] struct kcvfhrls, 8 bytes @116 [size=10.0pt] ub4 kscnbas @116 0x00000001[size=10.0pt] ub2 kscnwrp @120 0x0000[size=10.0pt] ub4 kcvfhbti @124 0x00000000[size=10.0pt] struct kcvfhbsc, 8 bytes @128 [size=10.0pt] ub4 kscnbas @128 0x00000000[size=10.0pt] ub2 kscnwrp @132 0x0000[size=10.0pt] ub2 kcvfhbth @136 0x0000[size=10.0pt] ub2 kcvfhsta @138 0x0004 (KCVFHOFZ)[size=10.0pt] struct kcvfhckp, 36 bytes @484 [size=10.0pt] struct kcvcpscn, 8bytes @484 [size=10.0pt] ub4 kscnbas @484 0x000e81bb[size=10.0pt] ub2 kscnwrp @488 0x0000[size=10.0pt] ub4 kcvcptim @492 0x2e29673f[size=10.0pt] ub2 kcvcpthr @496 0x0001[size=10.0pt] union u, 12 bytes @500 [size=10.0pt] struct kcvcprba,12 bytes @500 [size=10.0pt] ub4 kcrbaseq @500 0x00000048[size=10.0pt] ub4 kcrbabno @504 0x00000002[size=10.0pt] ub2 kcrbabof @508 0x0010[size=10.0pt] ub1 kcvcpetb[0] @512 0x02[size=10.0pt] ub1 kcvcpetb[1] @513 0x00[size=10.0pt] ub1 kcvcpetb[2] @514 0x00[size=10.0pt] ub1 kcvcpetb[3] @515 0x00[size=10.0pt] ub1 kcvcpetb[4] @516 0x00[size=10.0pt] ub1 kcvcpetb[5] @517 0x00[size=10.0pt] ub1 kcvcpetb[6] @518 0x00[size=10.0pt] ub1 kcvcpetb[7] @519 0x00[size=10.0pt] ub4 kcvfhcpc @140 0x0000000e[size=10.0pt] ub4 kcvfhrts @144 0x00000000[size=10.0pt] ub4 kcvfhccc @148 0x0000000d[size=10.0pt] struct kcvfhbcp, 36 bytes @152 [size=10.0pt] struct kcvcpscn, 8 bytes @152 [size=10.0pt] ub4 kscnbas @152 0x00000000[size=10.0pt] ub2 kscnwrp @156 0x0000[size=10.0pt] ub4 kcvcptim @160 0x00000000[size=10.0pt] ub2 kcvcpthr @164 0x0000[size=10.0pt] union u, 12 bytes @168 [size=10.0pt] struct kcvcprba, 12 bytes @168 [size=10.0pt] ub4 kcrbaseq @168 0x00000000[size=10.0pt] ub4 kcrbabno @172 0x00000000[size=10.0pt] ub2 kcrbabof @176 0x0000[size=10.0pt] ub1 kcvcpetb[0] @180 0x00[size=10.0pt] ub1 kcvcpetb[1] @181 0x00[size=10.0pt] ub1 kcvcpetb[2] @182 0x00[size=10.0pt] ub1 kcvcpetb[3] @183 0x00[size=10.0pt] ub1 kcvcpetb[4] @184 0x00[size=10.0pt] ub1 kcvcpetb[5] @185 0x00[size=10.0pt] ub1 kcvcpetb[6] @186 0x00[size=10.0pt] ub1 kcvcpetb[7] @187 0x00[size=10.0pt] ub4 kcvfhbhz @312 0x00000000[size=10.0pt] struct kcvfhxcd, 16 bytes @316 [size=10.0pt] ub4 space_kcvmxcd[0] @316 0x00000000[size=10.0pt] ub4 space_kcvmxcd[1] @320 0x00000000[size=10.0pt] ub4 space_kcvmxcd[2] @324 0x00000000[size=10.0pt] ub4 space_kcvmxcd[3] @328 0x00000000[size=10.0pt] word kcvfhtsn @332 5[size=10.0pt] ub2 kcvfhtln @336 0x0007[size=10.0pt] text kcvfhtnm[0] @338 W[size=10.0pt] [size=10.0pt] struct kcvfhprs, 8 bytes @420 [size=10.0pt] ub4 kscnbas @420 0x00000000[size=10.0pt] ub2 kscnwrp @424 0x0000[size=10.0pt] struct kcvfhprfs, 8 bytes @428 [size=10.0pt] ub4 kscnbas @428 0x00000000[size=10.0pt] ub2 kscnwrp @432 0x0000[size=10.0pt] ub4 kcvfhtrt @444 0x00000000[size=10.0pt]BBED> p kcvfhckp[size=10.0pt]structkcvfhckp, 36 bytes @484 [size=10.0pt] struct kcvcpscn, 8bytes @484 [size=10.0pt] ub4 kscnbas @484 0x000e81bb[size=10.0pt] ub2 kscnwrp @488 0x0000[size=10.0pt] ub4 kcvcptim @492 0x2e29673f[size=10.0pt] ub2 kcvcpthr @496 0x0001[size=10.0pt] union u, 12 bytes @500 [size=10.0pt] struct kcvcprba, 12 bytes @500 [size=10.0pt] ub4kcrbaseq @500 0x00000048[size=10.0pt] ub4kcrbabno @504 0x00000002[size=10.0pt] ub2 kcrbabof @508 0x0010[size=10.0pt] ub1 kcvcpetb[0] @512 0x02[size=10.0pt] ub1 kcvcpetb[1] @513 0x00[size=10.0pt] ub1 kcvcpetb[2] @514 0x00[size=10.0pt] ub1 kcvcpetb[3] @515 0x00[size=10.0pt] ub1 kcvcpetb[4] @516 0x00[size=10.0pt] ub1 kcvcpetb[5] @517 0x00[size=10.0pt] ub1 kcvcpetb[6] @518 0x00[size=10.0pt] ub1 kcvcpetb[7] @519 0x00[size=10.0pt]红色的内容我们可以关联下X$KCVFH 内部表可以进行对比。[size=10.0pt]BBED>set file 5[size=10.0pt] FILE# 5[size=10.0pt]BBED> p kcvfhckp[size=10.0pt]structkcvfhckp, 36 bytes @484 [size=10.0pt] struct kcvcpscn, 8 bytes @484 [size=10.0pt] ub4 kscnbas @484 0x000e8182[size=10.0pt] ub2 kscnwrp @488 0x0000[size=10.0pt] ub4 kcvcptim @492 0x2e296738[size=10.0pt] ub2 kcvcpthr @496 0x0001[size=10.0pt] union u, 12 bytes @500 [size=10.0pt] struct kcvcprba, 12 bytes @500 [size=10.0pt] ub4 kcrbaseq @500 0x00000046[size=10.0pt] ub4 kcrbabno @504 0x00000002[size=10.0pt] ub2 kcrbabof @508 0x0010[size=10.0pt] ub1 kcvcpetb[0] @512 0x02[size=10.0pt] ub1 kcvcpetb[1] @513 0x00[size=10.0pt] ub1 kcvcpetb[2] @514 0x00BBED> set file 1[size=10.0pt] FILE# 1[size=10.0pt]BBED> p kcvfhckp[size=10.0pt]structkcvfhckp, 36 bytes @484 [size=10.0pt] struct kcvcpscn, 8 bytes @484 [size=10.0pt] ub4 kscnbas @484 0x000e81ea[size=10.0pt] ub2 kscnwrp @488 0x0000[size=10.0pt] ub4 kcvcptim @492 0x2e2967a6[size=10.0pt] ub2 kcvcpthr @496 0x0001[size=10.0pt] union u, 12 bytes @500 [size=10.0pt] struct kcvcprba, 12 bytes @500 [size=10.0pt] ub4 kcrbaseq @500 0x00000049[size=10.0pt] ub4 kcrbabno @504 0x00000002[size=10.0pt] ub2 kcrbabof @508 0x0010[size=10.0pt] ub1 kcvcpetb[0] @512 0x02[size=10.0pt] ub1 kcvcpetb[1] @513 0x00[size=10.0pt] ub1kcvcpetb[2] @514 0x00[size=10.0pt] ub1 kcvcpetb[3] @515 0x00[size=10.0pt] ub1 kcvcpetb[4] @516 0x00[size=10.0pt] ub1 kcvcpetb[5] @517 0x00[size=10.0pt] ub1 kcvcpetb[6] @518 0x00[size=10.0pt] ub1 kcvcpetb[7] @519 0x00[size=10.0pt]我们可以根据BBED看到的内而得出当前SCN与SEQ[size=10.0pt]SQL>select to_number('4[size=10.0pt]9[size=10.0pt]','xxxxx') from dual;[size=10.0pt]TO_NUMBER('48','XXXXX')[size=10.0pt]-----------------------[size=10.0pt] 7[size=10.0pt]3[size=10.0pt]SQL>select to_number('46','xxxxx') from dual;[size=10.0pt]TO_NUMBER('46','XXXXX')[size=10.0pt]-----------------------[size=10.0pt] 70[size=10.0pt]SQL> select to_char(71,'xxxxxx') from dual;[size=10.0pt]TO_CHAR[size=10.0pt]-------[size=10.0pt] 47[size=10.0pt]SQL>select to_number('e8182','xxxxx') from dual;[size=10.0pt]TO_NUMBER('E8182','XXXXX')[size=10.0pt]--------------------------[size=10.0pt] 950658[size=10.0pt]SQL>select to_number('e81ea','xxxxx') from dual;[size=10.0pt] [size=10.0pt]TO_NUMBER('E81EA','XXXXX')[size=10.0pt]--------------------------[size=10.0pt] 950762[size=10.0pt]SQL>select HXFIL File_num,substr(HXFNM,1,40) File_name, FHSCN SCN, FHSTA status,FHRBA_SEQ Sequence from X$KCVFH;[size=10.0pt] FILE_NUM FILE_NAME SCN STATUS SEQUENCE[size=10.0pt]------------------------------------------------------- ---------------- ---------- 1 /u01/oracle/oradata/orcl/system01.dbf 950762 8196 73[size=10.0pt] 2/u01/oracle/oradata/orcl/undotbs01.dbf 950762 4 73[size=10.0pt] 3/u01/oracle/oradata/orcl/sysaux01.dbf 950762 4 73[size=10.0pt] 4/u01/oracle/oradata/orcl/users01.dbf 950762 4 73[size=10.0pt] 5/u01/oracle/oradata/orcl/willson1.dbf 950658 4 70[size=10.0pt] 6/u01/oracle/oradata/orcl/willson2.dbf 950762 4 73[size=10.0pt] 7/u01/oracle/oradata/orcl/willson3.dbf 950762 4 73[size=10.0pt]接下来模拟下中间的一个归档缺少[size=10.0pt][oracle@db1oracle]$ cd archive/[size=10.0pt][oracle@db1archive]$ ls[size=10.0pt]1_57_769085431.dbf 1_60_769085431.dbf 1_63_769085431.dbf 1_66_769085431.dbf 1_69_769085431.dbf 1_72_769085431.dbf[size=10.0pt]1_58_769085431.dbf 1_61_769085431.dbf 1_64_769085431.dbf 1_67_769085431.dbf 1_70_769085431.dbf[size=10.0pt]1_59_769085431.dbf 1_62_769085431.dbf 1_65_769085431.dbf 1_68_769085431.dbf 1_71_769085431.dbf[size=10.0pt][oracle@db1 archive]$ mv 1_70_769085431.dbf ../[size=10.0pt][oracle@db1archive]$ ls[size=10.0pt]1_57_769085431.dbf 1_60_769085431.dbf 1_63_769085431.dbf 1_66_769085431.dbf 1_69_769085431.dbf[size=10.0pt]1_58_769085431.dbf 1_61_769085431.dbf 1_64_769085431.dbf 1_67_769085431.dbf 1_72_769085431.dbf[size=10.0pt]1_59_769085431.dbf 1_62_769085431.dbf 1_65_769085431.dbf 1_68_769085431.dbf[size=10.0pt]1_71_769085431.dbf[size=10.0pt]我已经把seq 70的归档给移走了,那么如果要online datafile 5的时候需要recover seq 70的归档是找不到的就会报错。[size=10.0pt]SQL>alter database datafile 5 online;[size=10.0pt]alterdatabase datafile 5 online[size=10.0pt]ERRORat line 1:[size=10.0pt]ORA-01113:file 5 needs media recovery if it was restored from backup, or END BACKUP if itwas not[size=10.0pt]ORA-01110: data file 5: '/u01/oracle/oradata/orcl/willson1.dbf'[size=10.0pt]SQL>recover datafile 5;[size=10.0pt]ORA-00279:change 950658 generated at 02/05/2012 17:15:36 needed for thread 1[size=10.0pt]ORA-00289: suggestion : /u01/oracle/archive/1_70_769085431.dbf[size=10.0pt]ORA-00280:change 950658 for thread 1 is in sequence #70[size=10.0pt]Specifylog: {