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

备份与恢复:用rman方式基于scn的不完全恢复

上一篇 / 下一篇  2008-04-08 18:10:36 / 个人分类:rman备份与恢复

SQL> create table test(a int);ITPUB个人空间ltC9?5B_
ITPUB个人空间^ _/tX.N-_
Table created.ITPUB个人空间Bv.](BD)\
ITPUB个人空间0Jux[ d D$t+T*~
SQL> insert into test values(1);ITPUB个人空间q:k,RvOq F
ITPUB个人空间Tl6rC[4Q$]
1 row created.ITPUB个人空间aw)eLZ%`

.kxXd3D0SQL> commit;ITPUB个人空间PW P4H7Kql
ITPUB个人空间`h]s0P `{
Commit complete.ITPUB个人空间3~H9?-ExH"Q
ITPUB个人空间 P^~p(e&|R E9F

5G_'~8f&WXp'YY0Cocuments and SettingsPaul Yi>rman target /ITPUB个人空间+^tSFY
ITPUB个人空间X.@iKw)B wv
Recovery Manager: Release 9.2.0.4.0 - Production
%u(P|OiX0
,r3I9ONq0Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.ITPUB个人空间0|+M`|\k~

n5VG` _?,FGL0connected to target database: PUBTEST (DBID=792660220)
'@-YXO|gC0ITPUB个人空间`KY j9RC{h
RMAN> run{allocate channel c1 type disk;ITPUB个人空间Nzogs"b ?.e
2> backup full tag 'dbfull' format 'd:ackupfull%u_%s_%p' databaseITPUB个人空间}E,k)V+iH
3> include current controlfile;ITPUB个人空间Bjz0k? {tc
4> sql 'alter system archive log current';
$H T2eH+BJ05> release channel c1;ITPUB个人空间,p"NLZjVYh
6> }ITPUB个人空间!J P&~%lT}},v5Yn,p

2G7a-D {U D0using target database controlfile instead of recovery catalogITPUB个人空间6X5~uzc${n"}
allocated channel: c1ITPUB个人空间 t hL,nxnzq
channel c1: sid=12 devtype=DISKITPUB个人空间.PMV%` U,nX;h0{|

/zcCG)`(Q5g0Starting backup at 08-APR-08ITPUB个人空间/[*AV*Y4T0Ve/Y
channel c1: starting full datafile backupsetITPUB个人空间0Wm5I3c7]W
channel c1: specifying datafile(s) in backupsetITPUB个人空间@^.Ci?Ib&p
including current SPFILE in backupset
"I\m[l+_9H]0including current controlfile in backupsetITPUB个人空间+W%fP9J;Vl0|~
input datafile fno=00001 name=D:ORACLEORADATAPUBTESTSYSTEM01.DBFITPUB个人空间_/st7R&x*PM4R
input datafile fno=00002 name=D:ORACLEORADATAPUBTESTUNDOTBS01.DBFITPUB个人空间S5aNG?:eM\
input datafile fno=00003 name=D:ORACLEORADATAPUBTESTINDX01.DBF
vDo-mM+{Q8f/[m0input datafile fno=00005 name=D:ORACLEORADATAPUBTESTUSERS01.DBFITPUB个人空间:i l{1Of c
channel c1: starting piece 1 at 08-APR-08ITPUB个人空间j$E7iUXh:J!y
channel c1: finished piece 1 at 08-APR-08ITPUB个人空间sSF(d:oS
piece handle=D:BACKUPFULL01JDAN3K_1_1 comment=NONE
W:eUig} pyUn!R.]#U/i0channel c1: backup set complete, elapsed time: 00:01:59
N^o,@.|&?0Finished backup at 08-APR-08ITPUB个人空间R Wc6mu/D4}1b

)I,oEu*PV0sql statement: alter system archive log current
3]6E8Nm(w Ba0ITPUB个人空间BIT}"zx
released channel: c1
2J7_D&x0PqY'S[0
9U? H O V v!}p0RMAN> exitITPUB个人空间&rx8s+\2H

P.@,O b'T0
h:W Y,v"B&m d:z X.x[0Recovery Manager complete.ITPUB个人空间"_u^[5l8wf
ITPUB个人空间*|MDsf
Cocuments and SettingsPaul Yi>sqlplus "/as sysdba"
,Hi%z%h#@Rb0
5L:Y$s#C xkW'cu0SQL*Plus: Release 9.2.0.4.0 - Production on Tue Apr 8 16:59:38 2008ITPUB个人空间]:IL&KV A{o7lK%l C
ITPUB个人空间 w@%lq$UA}
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
)J]:eS,o0ITPUB个人空间OF&m^$@)W
ITPUB个人空间D.V'E |Y1^
Connected to:
Jx.{L0g9T2wL0Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
F}-}1u'|0With the Partitioning, OLAP and Oracle Data Mining options
&E9S3fs q1P p;@0JServer Release 9.2.0.4.0 - ProductionITPUB个人空间6j(GU*[#d)Dd'US2^

!G\RyR3APCq-R0SQL> insert into test values(2);ITPUB个人空间[1\H[ e?ro R
ITPUB个人空间fvTVek St*}'T0A
1 row created.ITPUB个人空间V Y3jUH(A3@T

#|s{VP-C4FG%c0SQL> commit;ITPUB个人空间f:ehgFP(y

KM)KS6lHS2Q0Commit complete.ITPUB个人空间Y'b O0e[0t
ITPUB个人空间 G:T0x8\f[ Q
ITPUB个人空间*}T!G(L%DX}
SQL> select * from test;ITPUB个人空间2u@ dHR QNz
ITPUB个人空间*z"g_%yC._ XD
         A
$MV dYD.q0----------
,Q#K7\*o0Nj7r0         1ITPUB个人空间(r/J!{Hu.w
         2
|1v_S&[+z0ITPUB个人空间 f qz{+t$b
SQL> alter system switch logfile;
%['GvI,^,R5D)vf0
qYLz5w$v8o6g0System altered.ITPUB个人空间 y,OM,S2I+Z2T(Ff
ITPUB个人空间 O^ E:liiff
SQL> alter system switch logfile;ITPUB个人空间}0INN F Lg']
ITPUB个人空间 d&s'\Mx
System altered.ITPUB个人空间vG7Y%? Vf-_yZV
ITPUB个人空间"a:S:H0\:gS;u8U
SQL> select max(ktuxescnw * power(2, 32) + ktuxescnb) scn from x$ktuxe;ITPUB个人空间3u,@ A.\TDB

+ISF'e A0       SCNITPUB个人空间3~*?t P g
----------ITPUB个人空间-l?'v W9]:K? n
   1195547ITPUB个人空间)Uva!zG:l
ITPUB个人空间}pai;be
SQL> drop table test;ITPUB个人空间s*NR"v L z
ITPUB个人空间6Ff4A3iJ-A&n I?azh
Table dropped.ITPUB个人空间v0@&E2i^U

n1Bn(]wn(w0SQL> shutdown immediate;ITPUB个人空间1d8n/N"ls3r6O
Database closed.
@4n_$S:o0Database dismounted.
;`4J:ekFP$Z|?0ORACLE instance shut down.
-Q` C5m?!^ a0SQL> startup mount;ITPUB个人空间l%\Da:d)a+U m'I'[U
ORACLE instance started.ITPUB个人空间1t%xA i3s(d oO8|.X
ITPUB个人空间 YO-^&ecX
Total System Global Area  546382300 bytes
"N,B%W)[;p Xnd0Fixed Size                   455132 bytesITPUB个人空间2yb K1H6_RG+C
Variable Size             520093696 bytesITPUB个人空间/v)g_&R*i
Database Buffers           25165824 bytes
]6T4xEs9W0Redo Buffers                 667648 bytes
)pF5f_9RJmT"z~0Database mounted.
;{wU+F1W-r0SQL> exit
2~e#l,|lcc:\/]9n0Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
2W ~:S7`EU4M0With the Partitioning, OLAP and Oracle Data Mining optionsITPUB个人空间N;r#?6mSQ0|x
JServer Release 9.2.0.4.0 - Production
wO'v K!G$Fz7a!X\u&n0ITPUB个人空间$R+ikT)WO7j
Cocuments and SettingsPaul Yi>rman target /
]2u4D'[ IL2s0ITPUB个人空间!a0z;gK$IK.Ew
Recovery Manager: Release 9.2.0.4.0 - ProductionITPUB个人空间s7o v9px X(^#uKT
ITPUB个人空间 K6[2yPK*l7~S
Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
7kU [)I&c ?&v3Q?0ITPUB个人空间 UI4u"q3`5S r H
connected to target database: PUBTEST (DBID=792660220)
ji,Bzo hV-U I;I,Z}0
rF0sa~;z0l0RMAN> run{
J'RM H1xUZ_j02> allocate channel c1 type disk;
.QR!C.vSi#uR f03> restore database;ITPUB个人空间DilKd@-O
4>recover database until scn 1195547;ITPUB个人空间v?Q~0~0q
5> sql 'alter database open resetlogs';ITPUB个人空间^ H6s WbkF
6> release channel c1;
Vb.~:e(GKy.J T07> }
AY&n%F6N|C0ITPUB个人空间2VGBSKA,PsI'}
using target database controlfile instead of recovery catalogITPUB个人空间uJw|kFEa
allocated channel: c1ITPUB个人空间*W \XyS a/fc]
channel c1: sid=11 devtype=DISKITPUB个人空间F0M'ox{
ITPUB个人空间7x _#V_d3UV8l
Starting restore at 08-APR-08ITPUB个人空间,k \lZj&ljbB

9yGo%|6i0datafile 3 not processed because file is read-only
Q*|S y/[0channel c1: starting datafile backupset restoreITPUB个人空间#U+\jNI+c*d
channel c1: specifying datafile(s) to restore from backup set
O{s)i2YgL#p0restoring datafile 00001 to D:ORACLEORADATAPUBTESTSYSTEM01.DBFITPUB个人空间S?&n'e h%{|
restoring datafile 00002 to D:ORACLEORADATAPUBTESTUNDOTBS01.DBFITPUB个人空间V'g)l`y6pmi8kT~
restoring datafile 00005 to D:ORACLEORADATAPUBTESTUSERS01.DBFITPUB个人空间 D5mxP-ed
channel c1: restored backup piece 1ITPUB个人空间^QWH2w c
piece handle=D:BACKUPFULL01JDAN3K_1_1 tag=DBFULL params=NULLITPUB个人空间,n0@U.qy/sL
channel c1: restore complete
_.O+R&z4l&] y^F0Finished restore at 08-APR-08
o!rE ]2G!w/?H%B/?,}0ITPUB个人空间 b{rKRkz1GC2S
Starting recover at 08-APR-08ITPUB个人空间#o:y6zg(P
datafile 3 not processed because file is read-onlyITPUB个人空间[ H b1K Q+oz

X"l(GF*C0?,h:?{I0starting media recoveryITPUB个人空间a~'lj5w
ITPUB个人空间C)NR-d&T%g EN!L
archive log thread 1 sequence 1 is already on disk as file D:ORACLEORA92RDBMS
)a CRb/s*Sj*V0ARC00001.001
_~] kdD*L]0archive log thread 1 sequence 2 is already on disk as file D:ORACLEORA92RDBMS
XIK| LWT2q0ARC00002.001
7ij/|y1y#H7[,lC0archive log filename=D:ORACLEORA92RDBMSARC00001.001 thread=1 sequence=1ITPUB个人空间o3RT7fd,^ ]
media recovery complete
o m+p@N5b0Finished recover at 08-APR-08ITPUB个人空间g(b a P_r_H{
ITPUB个人空间{.C%j)l'~gV8c6g}
sql statement: alter database open resetlogs
i uK ZS,m0
.j*igq_3K8u%{0released channel: c1ITPUB个人空间*`yr3J]

G$mb$uzBI[0RMAN> exit
&S | [+ZL0
0m"l"~]&qs0ITPUB个人空间b}*{L j_1G
Recovery Manager complete.ITPUB个人空间,W.N2h$@S7l|
ITPUB个人空间TM6n,D l
Cocuments and SettingsPaul Yi>sqlplus "/as sysdba"ITPUB个人空间tPu;XQUn l.kf/[/w
ITPUB个人空间6L"Y-^ t,X0F9f NK:g
SQL*Plus: Release 9.2.0.4.0 - Production on Tue Apr 8 17:05:03 2008
2]'x8uK|oheE0
-z5auld8ug0Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
YF#E%m*Ac*Q0ITPUB个人空间$u&RZ%m0C'C1X{.b

-|_Q/^!vO%]0Connected to:
K`lH$t q5P/UI0Oracle9i Enterprise Edition Release 9.2.0.4.0 - ProductionITPUB个人空间H;Zy5PlL)KUS0Q
With the Partitioning, OLAP and Oracle Data Mining options
'X2X)b#fY0JServer Release 9.2.0.4.0 - Production
2mqM&jEog B1QY0
7I2R6`E?/f0SQL> select * from test;
5L8I%brh!A$Zai$\s Q0
X$^;W2\CLnR0         A
#K O+t2G9Ik,hZ0----------
%m Hl$^&q!c!P:S0         1ITPUB个人空间?!S.m"ZP5HucR#|_

.C6MRzPiW'Qo0SQL>ITPUB个人空间Zvr;PV]

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 

数据统计

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

RSS订阅

Open Toolbar