Vous êtes sur la page 1sur 6

RESTORE AND RECOVERY PROCEDURE OF PRODUCTION DATABASE

BACKUP ON TEST SERVERS


As part of disaster recovery exercise or to test the validity of a RMAN backup, a full
restore and recovery of databases can be performed on scratch or test servers utilising
the production RMAN backups which have been restored from the tape backups on
these test or scratch servers.
This note will illustrate the above procedure by detailing the steps reuired to restore
the backup of a production database !prod"# on a test server linux$" .
The following assumptions are made in this note%
The RMAN backups have been restored from tape backups to the same
backup location on the test server as the production server where the backup
was originally taken
The identical directory structure as is present on production has been created
on the test server. This will apply to not only the location of the database files
!data, control files, redo log files#, but also to the bdump,cdump, udump and
adump locations.
&ontrolfile autobackup has been enabled. This is important.
Overview
Restore the spfile from the autobackup
Restore the controlfile from the autobackup
Restore the data files
Recover by applying archived redo log files
'pen the database with resetlogs
Restore the SPFILE
[oracle@linux01 prod1]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Producion on !"u #un 24
1$:2$:%& 2010
'opyrig" (c) 1*&2+ 200,+ -racle. .ll rig"s reserved.
conneced o arge daa/ase (no sared)
RM.01 set dbid=4266928631
execuing co22and: 34! 5675
RM.01 startup force nomount;
sarup 8ailed: -R.-010,&: 8ailure in processing syse2 para2eers
9RM-0010*: could no open para2eer 8ile
:;u01;app;oracle;produc;10.2.0;d/s;iniprod1.ora:
saring -racle insance <i"ou para2eer 8ile 8or rerival o8
sp8ile
-racle insance sared
!oal 3yse2 =lo/al .rea 1%*$&$%%2 /yes
>ixed 3i?e 20$*0%@ /yes
Aaria/le 3i?e @,10*@1@ /yes
5aa/ase 6u88ers &$&&@0&0 /yes
Redo 6u88ers @$4&&00 /yes
RM.01 run
2> {SE !"#$"%&'%E ()"*(!+), &"$-( &"$ .E/'!E 0,E .'S+ "
1/u22/bac3up/prod1/4&1;
3> restore spfi5e from autobac3up;
4> 6
execuing co22and: 34! '-0!R-9>794 .B!-6.'CBP >-RM.!
3aring resore a 24-#B0-10
using c"annel -R.D573CD1
c"annel -R.D573CD1: looEing 8or auo/acEup on day: 20100@24
c"annel -R.D573CD1: looEing 8or auo/acEup on day: 20100@2$
c"annel -R.D573CD1: looEing 8or auo/acEup on day: 20100@22
c"annel -R.D573CD1: auo/acEup 8ound: ;u02;/acEup;prod1;c-42@@*2&@$1-
20100@22-00
c"annel -R.D573CD1: 3P>794 resore 8ro2 auo/acEup co2plee
>inis"ed resore a 24-#B0-10
RM.01 s7utdo8n immediate;
daa/ase closed
daa/ase dis2ouned
-racle insance s"u do<n
Restore the Control File
7n "is case+ "e insance is no< /eing sared <i" "e resored
sp8ile. Fe can creae a p8ile as <ell 8ro2 "is sp8ile is so
reGuired.
RM.01 startup nomount
conneced o arge daa/ase (no sared)
-racle insance sared
!oal 3yse2 =lo/al .rea $1%411@@0& /yes
>ixed 3i?e 204$*04 /yes
Aaria/le 3i?e 1&,*0%22&& /yes
5aa/ase 6u88ers 12%&2*1200 /yes
Redo 6u88ers 14,2*21@ /yes
RM.01 set dbid=4266928631
execuing co22and: 34! 5675
RM.01 run
2> {SE !"#$"%&'%E ()"*(!+), &"$-( &"$ .E/'!E 0,E .'S+ "
1/u22/bac3up/prod1/4&1;
3> restore contro5fi5e from autobac3up;
4> 6
execuing co22and: 34! '-0!R-9>794 .B!-6.'CBP >-RM.!
using arge daa/ase conrol 8ile insead o8 recovery caalog
3aring resore a 24-#B0-10
allocaed c"annel: -R.D573CD1
c"annel -R.D573CD1: sidH%41 devypeH573C
recovery area desinaion: ;u02;8las"DrecoveryDarea
daa/ase na2e (or daa/ase uniGue na2e) used 8or searc": PR-51
c"annel -R.D573CD1: no auo/acEups 8ound in "e recovery area
c"annel -R.D573CD1: looEing 8or auo/acEup on day: 20100@24
c"annel -R.D573CD1: looEing 8or auo/acEup on day: 20100@2$
c"annel -R.D573CD1: looEing 8or auo/acEup on day: 20100@22
c"annel -R.D573CD1: auo/acEup 8ound: ;u02;/acEup;prod1;c-42@@*2&@$1-
20100@22-00
c"annel -R.D573CD1: conrol 8ile resore 8ro2 auo/acEup co2plee
oupu 8ilena2eH;u0$;oradaa;prod1;conrol1.cl
oupu 8ilena2eH;u04;oradaa;prod1;conrol2.cl
oupu 8ilena2eH;u0%;oradaa;prod1;conrol$.cl
>inis"ed resore a 24-#B0-10
RM.01 a5ter database mount;
daa/ase 2ouned
released c"annel: -R.D573CD1
Restore the dt!se
RM.01 restore database;
3aring resore a 24-#B0-10
3aring i2plici crossc"ecE /acEup a 24-#B0-10
allocaed c"annel: -R.D573CD1
c"annel -R.D573CD1: sidH%41 devypeH573C
allocaed c"annel: -R.D573CD2
c"annel -R.D573CD2: sidH%40 devypeH573C
allocaed c"annel: -R.D573CD$
c"annel -R.D573CD$: sidH%$& devypeH573C
allocaed c"annel: -R.D573CD4
c"annel -R.D573CD4: sidH%$, devypeH573C
allocaed c"annel: -R.D573CD%
c"annel -R.D573CD%: sidH%$@ devypeH573C
allocaed c"annel: -R.D573CD@
c"annel -R.D573CD@: sidH%$% devypeH573C
'rossc"ecEed 44 o/Iecs
>inis"ed i2plici crossc"ecE /acEup a 24-#B0-10
3aring i2plici crossc"ecE copy a 24-#B0-10
using c"annel -R.D573CD1
using c"annel -R.D573CD2
using c"annel -R.D573CD$
using c"annel -R.D573CD4
using c"annel -R.D573CD%
using c"annel -R.D573CD@
>inis"ed i2plici crossc"ecE copy a 24-#B0-10
searc"ing 8or all 8iles in "e recovery area
caaloging 8iles...
no 8iles caaloged
using c"annel -R.D573CD1
using c"annel -R.D573CD2
using c"annel -R.D573CD$
using c"annel -R.D573CD4
using c"annel -R.D573CD%
using c"annel -R.D573CD@
c"annel -R.D573CD1: saring daa8ile /acEupse resore
c"annel -R.D573CD1: speci8ying daa8ile(s) o resore 8ro2 /acEup se
resoring daa8ile 0000, o ;u0$;oradaa;prod1;syse202.d/8
resoring daa8ile 0000* o
;u0$;oradaa;prod1;glass8is"I2sDdaa01.d/8
resoring daa8ile 00010 o ;u0$;oradaa;prod1;2ci<Ddaa01.d/8
c"annel -R.D573CD1: reading 8ro2 /acEup piece
;u02;/acEup;prod1;"Glg%"pD1D1
c"annel -R.D573CD2: saring daa8ile /acEupse resore
c"annel -R.D573CD2: speci8ying daa8ile(s) o resore 8ro2 /acEup se
resoring daa8ile 00004 o ;u0$;oradaa;prod1;Iira.d/8
resoring daa8ile 0000% o ;u0$;oradaa;prod1;users01.d/8
resoring daa8ile 0001& o ;u0$;oradaa;prod1;2collageDlo/01.d/8
c"annel -R.D573CD2: reading 8ro2 /acEup piece
;u02;/acEup;prod1;"olg%"oD1D1
c"annel -R.D573CD$: saring daa8ile /acEupse resore
c"annel -R.D573CD$: speci8ying daa8ile(s) o resore 8ro2 /acEup se
resoring daa8ile 0000$ o ;u0$;oradaa;prod1;sysaux01.d/8
...
...
c"annel -R.D573CD2: resored /acEup piece 1
piece "andleH;u02;/acEup;prod1;"plg%"oD1D1 agH!.=20100@22!200404
c"annel -R.D573CD2: resore co2plee+ elapsed i2e: 00:2,:$%
c"annel -R.D573CD1: resored /acEup piece 1
piece "andleH;u02;/acEup;prod1;"olg%"oD1D1 agH!.=20100@22!200404
c"annel -R.D573CD1: resore co2plee+ elapsed i2e: 00:4*:12
>inis"ed resore a 24-#B0-10
Re"over the dt!se
The recovery will fail at a point where it cannot restore any more archived redo log
files.
(n this case the last archived log file which has been backed up is seuence )"*.
This information can be obtained by issuing a +(,T -A&./0 '1 AR&2(34+'5
A++ command.
,o RMAN will fail when it tries to apply seuence )"6 7.
RM.01 reco9er database
3aring recover a 24-#B0-10
using c"annel -R.D573CD1
using c"annel -R.D573CD2
using c"annel -R.D573CD$
using c"annel -R.D573CD4
using c"annel -R.D573CD%
using c"annel -R.D573CD@
saring 2edia recovery
c"annel -R.D573CD1: saring arc"ive log resore o de8aul
desinaion
c"annel -R.D573CD1: resoring arc"ive log
arc"ive log "readH1 seGuenceH@1$
c"annel -R.D573CD1: reading 8ro2 /acEup piece
;u02;/acEup;prod1;"ulg@/oD1D1
c"annel -R.D573CD1: resored /acEup piece 1
piece "andleH;u02;/acEup;prod1;"ulg@/oD1D1 agH!.=20100@22!201,%*
c"annel -R.D573CD1: resore co2plee+ elapsed i2e: 00:00:02
arc"ive log
8ilena2eH;u02;8las"DrecoveryDarea;PR-51;arc"ivelog;2010D0@D24;o1D28D1
D@1$D@2@0o/01D.arc "readH1 seGuenceH@1$
c"annel de8aul: deleing arc"ive log(s)
arc"ive log
8ilena2eH;u02;8las"DrecoveryDarea;PR-51;arc"ivelog;2010D0@D24;o1D28D1
D@1$D@2@0o/01D.arc recidH1224 sa2pH,22%$0&%&
una/le o 8ind arc"ive log
arc"ive log "readH1 seGuenceH@14
RM.0-00%,1:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
RM.0-00%@*: HHHHHHHHHHHHHHH 4RR-R M433.=4 3!.'C >-99-F3
HHHHHHHHHHHHHHH
RM.0-00%,1:
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
RM.0-0$002: 8ailure o8 recover co22and a 0@;24;2010 1%:01:0$
$-(#:262;4< media reco9er= re>uesting un3no8n 5og< t7read 1 se> 614
5o8scn 3989;194
O#en the dt!se with RESETLO$S
[oracle@linux01 PR-51]$ rman target /
Recovery Manager: Release 10.2.0.4.0 - Producion on !"u #un 24
1%:04:4& 2010
'opyrig" (c) 1*&2+ 200,+ -racle. .ll rig"s reserved.
conneced o arge daa/ase: PR-51 (5675H42@@*2&@$1+ no open)
RM.01 sGl :aler daa/ase open reselogs:J
using arge daa/ase conrol 8ile insead o8 recovery caalog
sGl sae2en: aler daa/ase open reselogs
RM.01

Vous aimerez peut-être aussi