学习oracle技术,每天学一点,每天进步一点

9I R2控制文件没有单独备份时,恢复时会找不到备份集

上一篇 / 下一篇  2008-06-10 15:41:44 / 个人分类:rman备份与恢复

C:\Documents and Settings\Paul Yi>rman target /

Recovery Manager: Release 9.2.0.8.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database: PUBTEST (DBID=799229701)

RMAN> backup database include current controlfile;

Starting backup at 10-JUN-08
3mza sC'NG0using target database controlfile instead of recovery catalog
*oy L:Y1^%{~0allocated channel: ORA_DISK_1
EI+F#EZPAL0channel ORA_DISK_1: sid=9 devtype=DISK
H7TIz3Bd$q k m0channel ORA_DISK_1: starting full datafile backupset
)N }W~I0channel ORA_DISK_1: specifying datafile(s) in backupset
K4sV-qt"i/X0including current SPFILE in backupsetITPUB个人空间%Zz9F%FQK3{.Q
including current controlfile in backupset
ITPUB个人空间]V+|E*g&w
input datafile fno=00001 name=D:\ORACLE\ORADATA\PUBTEST\SYSTEM01.DBFITPUB个人空间H tk0miQ{q8j
input datafile fno=00002 name=D:\ORACLE\ORADATA\PUBTEST\UNDOTBS01.DBF
5{(Rd:P7r0input datafile fno=00004 name=D:\ORACLE\ORADATA\PUBTEST\INDX01.DBF
3C+f8z1l0k {p0input datafile fno=00006 name=D:\ORACLE\ORADATA\PUBTEST\USERS01.DBFITPUB个人空间Tz&_&],]/g;O*P
input datafile fno=00005 name=D:\ORACLE\ORADATA\PUBTEST\TOOLS01.DBFITPUB个人空间5R ru-~ q/q(h?I
input datafile fno=00003 name=D:\ORACLE\ORADATA\PUBTEST\EXAMPLE01.DBFITPUB个人空间2HO!L,CpE @t2`f
channel ORA_DISK_1: starting piece 1 at 10-JUN-08ITPUB个人空间 Q6IY%X*V]%D7Z
channel ORA_DISK_1: finished piece 1 at 10-JUN-08
3V&sQSdu%c0piece handle=D:\BACKUP\3SJIJA02_1_1 comment=NONEITPUB个人空间${Or^;I ix2HK'z1X
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:36ITPUB个人空间 N%ya0{D7{L T(NT
Finished backup at 10-JUN-08

RMAN> exit

ITPUB个人空间/y:I5{"B?t.Ii
Recovery Manager complete.

C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"

SQL*Plus: Release 9.2.0.8.0 - Production on Tue Jun 10 15:39:33 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

ITPUB个人空间h2@iwM2D-S~
Connected to:ITPUB个人空间3s`*X!cc\e'wO u
Oracle9i Enterprise Edition Release 9.2.0.8.0 - ProductionITPUB个人空间)H-\dzHB%]
With the Partitioning, OLAP and Oracle Data Mining optionsITPUB个人空间.Q}gs'y@#M&pK1E
JServer Release 9.2.0.8.0 - Production

SQL> shutdown abort;ITPUB个人空间7o y5`n(C1`
ORACLE instance shut down.
l4@T,z S0SQL> exitITPUB个人空间K+dga+pG~
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
`f;gg+G CjF3v0With the Partitioning, OLAP and Oracle Data Mining options
C*Z5YOM1N0JServer Release 9.2.0.8.0 - Production

C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"

SQL*Plus: Release 9.2.0.8.0 - Production on Tue Jun 10 15:39:46 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to an idle instance.

SQL> exit
:? gc E}OKE;t0Disconnected

C:\Documents and Settings\Paul Yi>rman target /

Recovery Manager: Release 9.2.0.8.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

Oracle instance started

Total System Global Area     101785012 bytes

Fixed Size                      454068 bytesITPUB个人空间G:R'Mkz
Variable Size                 75497472 bytes
b i!? o/J_t5a.l0Database Buffers              25165824 bytesITPUB个人空间W8s4LM V
Redo Buffers                    667648 bytes

RMAN> restore controlfile from 'd:\backup\3SJIJA02_1_1';

Starting restore at 10-JUN-08

using target database controlfile instead of recovery catalog
@g3]:i;Yr0allocated channel: ORA_DISK_1
|y+@1e.N-o"@s J;k.c0channel ORA_DISK_1: sid=11 devtype=DISK
g7W%ZOUky|U0channel ORA_DISK_1: restoring controlfile
.N*T,[rF4t0channel ORA_DISK_1: restore completeITPUB个人空间d,j%ld e
replicating controlfileITPUB个人空间.LLGC6id
input filename=D:\ORACLE\ORADATA\PUBTEST\CONTROL01.CTL
|&E/ZO\ }2g0output filename=D:\ORACLE\ORADATA\PUBTEST\CONTROL02.CTLITPUB个人空间3{+K,w|-S
output filename=D:\ORACLE\ORADATA\PUBTEST\CONTROL03.CTLITPUB个人空间rw;FGF:@~
Finished restore at 10-JUN-08

RMAN> alter database mount;

database mounted

RMAN> restore database;

Starting restore at 10-JUN-08

using channel ORA_DISK_1ITPUB个人空间a@?}g)~UV AJ
RMAN-00571: ===========================================================
eEo5^*e9z)@%R.nc0RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============ITPUB个人空间W(U\;W4w2t
RMAN-00571: ===========================================================
D6Y ]#nah6NA0RMAN-03002: failure of restore command at 06/10/2008 15:41:07
tC"SA LtR;l0RMAN-06026: some targets not found - aborting restoreITPUB个人空间R,Keve/tJ_@
RMAN-06023: no backup or copy of datafile 6 found to restore
*s$Tb@YtM0RMAN-06023: no backup or copy of datafile 5 found to restoreITPUB个人空间Kl*MC]Le J k?
RMAN-06023: no backup or copy of datafile 4 found to restore
zyP:x.p[*V-z;{'Hv0RMAN-06023: no backup or copy of datafile 3 found to restoreITPUB个人空间(W1ZNHdQS
RMAN-06023: no backup or copy of datafile 2 found to restore
JT6W2?W-_)P#S0RMAN-06023: no backup or copy of datafile 1 found to restore

RMAN>

因为这是在备份数据文件前备份控制文件的,所以控制文件的备份没包括最新的备份集信息,导致恢复失败

这种情况下的恢复只能通过dbms_backup_restore包了  ,或着启用控制文件自动备份的参数为on

以下是测试过程:

C:\Documents and Settings\Paul Yi>rman target /

Recovery Manager: Release 9.2.0.8.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database: PUBTEST (DBID=799229701)

RMAN> show all;

RMAN configuration parameters are:
u1X Ky6p0CONFIGURE RETENTION POLICY TO REDUNDANCY 1;ITPUB个人空间,s.kKO#b:R!g5F
CONFIGURE BACKUP OPTIMIZATION ON;ITPUB个人空间7i)Ocn8\
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
\#rg D/K Xv8Qdf0CONFIGURE CONTROLFILE AUTOBACKUP OFF;
c \6k\0kb"|0CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'd:\backup\%F';ITPUB个人空间@,]X p-Gt!b'VB
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # defaultITPUB个人空间8GT2L.b!u+UA
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultITPUB个人空间1d f6@ Dn.l
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # defaultITPUB个人空间s8z'ol5l,v
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   'd:\backup\%U';ITPUB个人空间C,sV3Ng'[s
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
LL `0ACL,N0CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\ORA92\DATABASE\SNCFPUBTEST.ORA
:Q@-i#KAhe9EN4c5`,^0'; # default

RMAN> configure controlfile autobackup on;

old RMAN configuration parameters:ITPUB个人空间*rVa(GZ)EB8m-g0K _
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
}TI w0jNRMn0new RMAN configuration parameters:ITPUB个人空间l4c.?9Yh/}\i&O:F9i
CONFIGURE CONTROLFILE AUTOBACKUP ON;ITPUB个人空间8nF I(sdrvC
new RMAN configuration parameters are successfully stored

RMAN> backup database;

Starting backup at 10-JUN-08
LHC @Yn#Y&bWH0using channel ORA_DISK_1
X1ZpBM*H([G9f0channel ORA_DISK_1: starting full datafile backupsetITPUB个人空间"Y5I? d8r.`u%W}
channel ORA_DISK_1: specifying datafile(s) in backupset
m8m+l:`(?`7{s0input datafile fno=00001 name=D:\ORACLE\ORADATA\PUBTEST\SYSTEM01.DBFITPUB个人空间V^)e'w|/?u.H Z
input datafile fno=00002 name=D:\ORACLE\ORADATA\PUBTEST\UNDOTBS01.DBFITPUB个人空间5oF,o%W w,V
input datafile fno=00004 name=D:\ORACLE\ORADATA\PUBTEST\INDX01.DBFITPUB个人空间7a0X9tz;I)S yBP
input datafile fno=00006 name=D:\ORACLE\ORADATA\PUBTEST\USERS01.DBFITPUB个人空间:r5x$b9Bl9CR c
input datafile fno=00005 name=D:\ORACLE\ORADATA\PUBTEST\TOOLS01.DBF
gl]bf0H{0input datafile fno=00003 name=D:\ORACLE\ORADATA\PUBTEST\EXAMPLE01.DBF
*F!ub FMW0channel ORA_DISK_1: starting piece 1 at 10-JUN-08ITPUB个人空间1r$D~E3d!H5Gb1{P2D
channel ORA_DISK_1: finished piece 1 at 10-JUN-08ITPUB个人空间{&U;hj"Lef'xL)w}
piece handle=D:\BACKUP\3UJIJBK6_1_1 comment=NONEITPUB个人空间(Y KT@u"G
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
"ZD"js,U|0Finished backup at 10-JUN-08

Starting Control File and SPFILE Autobackup at 10-JUN-08ITPUB个人空间S.Xv4c0S4I DM
piece handle=D:\BACKUP\C-799229701-20080610-05 comment=NONE
&f$nJJ-[e9v;Z@0Finished Control File and SPFILE Autobackup at 10-JUN-08

RMAN>

C:\Documents and Settings\Paul Yi>sqlplus "/as sysdba"

SQL*Plus: Release 9.2.0.8.0 - Production on Tue Jun 10 15:59:57 2008

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

ITPUB个人空间b\'u!?Sl
Connected to:ITPUB个人空间@I4@$sO*?
Oracle9i Enterprise Edition Release 9.2.0.8.0 - ProductionITPUB个人空间.GD*Q^+US r
With the Partitioning, OLAP and Oracle Data Mining options
~#kDu;d ]Y;sm0JServer Release 9.2.0.8.0 - Production

SQL> shutdown abort;ITPUB个人空间KDCrPvV eC
ORACLE instance shut down.ITPUB个人空间t8B ck R
SQL> exit
1L4HG:c^0Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - ProductionITPUB个人空间$@`j3A U)[2{4Xn
With the Partitioning, OLAP and Oracle Data Mining optionsITPUB个人空间%b${l@%E!]![ u
JServer Release 9.2.0.8.0 - Production

C:\Documents and Settings\Paul Yi>rman target /

Recovery Manager: Release 9.2.0.8.0 - Production

Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

Oracle instance started

Total System Global Area     101785012 bytes

Fixed Size                      454068 bytes
E"O Pv}0Variable Size                 75497472 bytes
Q[$uSmQ0Database Buffers              25165824 bytes
fzjV,tGwC0Redo Buffers                    667648 bytes

RMAN> restore controlfile from 'd:\backup\C-799229701-20080610-05';

Starting restore at 10-JUN-08

using channel ORA_DISK_1
,}#XVL;L/D N"R0channel ORA_DISK_1: restoring controlfileITPUB个人空间-WL]-lL1Kn
channel ORA_DISK_1: restore completeITPUB个人空间%oq5V1Vr~Qx
replicating controlfile
c u ]Y };xiiS0input filename=D:\ORACLE\ORADATA\PUBTEST\CONTROL01.CTLITPUB个人空间DZV:B[`,W
output filename=D:\ORACLE\ORADATA\PUBTEST\CONTROL02.CTLITPUB个人空间kX%x8?Royx4t(g
output filename=D:\ORACLE\ORADATA\PUBTEST\CONTROL03.CTL
Ay5F{%[0Finished restore at 10-JUN-08

RMAN> alter database mount;

database mounted

RMAN> restore database;

Starting restore at 10-JUN-08

using channel ORA_DISK_1
'{@$f:S(b3b$x&T5fQG0skipping datafile 1; already restored to file D:\ORACLE\ORADATA\PUBTEST\SYSTEM01
*w.A?NP,Wx0.DBF
T3t;Sd@ P#F0skipping datafile 2; already restored to file D:\ORACLE\ORADATA\PUBTEST\UNDOTBS0
Yk_ iJ9Q0gm[JP01.DBF
pBA,\{E+Fm2K5X0j0skipping datafile 3; already restored to file D:\ORACLE\ORADATA\PUBTEST\EXAMPLE0
v8[c |![X3xt01.DBF
6{&X"W2quU#t R0skipping datafile 4; already restored to file D:\ORACLE\ORADATA\PUBTEST\INDX01.DITPUB个人空间7?5jjY K
BFITPUB个人空间ks9M0Rw!qK2o$D
skipping datafile 5; already restored to file D:\ORACLE\ORADATA\PUBTEST\TOOLS01.ITPUB个人空间*_;U&Is%y0w
DBF
V*u.A+M;[ K6r/]/S0skipping datafile 6; already restored to file D:\ORACLE\ORADATA\PUBTEST\USERS01.ITPUB个人空间fKV:N/r1Q
DBFITPUB个人空间S o-x] cR7G m
restore not done; all files readonly, offline, or already restored
^ IQU@x0Finished restore at 10-JUN-08

RMAN> recover database;

Starting recover at 10-JUN-08
yP6\Z{0using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 1 is already on disk as file D:\ORACLE\ORADATA\PUBITPUB个人空间3Tr:U#b*S4p-I j`|f
TEST\REDO3_01.LOGITPUB个人空间@ k.E,_)u W^
archive log filename=D:\ORACLE\ORADATA\PUBTEST\REDO3_01.LOG thread=1 sequence=1
ru|tb7EN5LCnD0media recovery completeITPUB个人空间it.UX2mE8| A
Finished recover at 10-JUN-08

RMAN> alter database open;

RMAN-00571: ===========================================================ITPUB个人空间:B Ay?$h Qi
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============ITPUB个人空间7vg!SOB.]qG:g
RMAN-00571: ===========================================================ITPUB个人空间8gQ3z r] g0q j0c
RMAN-03002: failure of alter db command at 06/10/2008 16:02:21ITPUB个人空间 Mv%j|K/E/o%e#\
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

RMAN> alter database open resetlogs;

database opened
9] HS,jQ wg*vw)|w}0

可以看到控制文件的备份是在备份集备份后才备份的,所以包含有备份集信息可以成功恢复

 


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-13  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 20359
  • 日志数: 291
  • 图片数: 2
  • 建立时间: 2007-12-11
  • 更新时间: 2008-10-04

RSS订阅

Open Toolbar