Académique Documents
Professionnel Documents
Culture Documents
When performing a restore operation, it is best to open two telnet sessions, one for SQL commands, and one for RMAN commands. or the rest of this doc!ment, RMAN commands will be prefaced with the RMAN" prompt, and SQL commands will be prefaced with the SQL" prompt. A # indicates that the command is e$ec!ted from the %ni$ prompt.
t!pe d"s#;
(nce the recovery has been completed, e$ec!te a complete RMAN bac'!p to establish a new baseline.
(nce the recovery has been completed, e$ec!te a complete RMAN bac'!p to establish a new baseline. Restoring Specific &atafiles
In this scenario, it is assumed that your control files are still accessible. You have a backup, done for example with backup database plus archivelog; $ake the datafile that needs recovery offline, restore the datafile, recover the datafile, and bring the datafile online. If you cannot take the datafile offline, then shutdown abort the database and restore in mount mode. +irst try to take the datafile offline: SQL> alter database data&"le '/u( /oracle/db/A)* /tab/A)* +tab,db&' o&&l"ne; %& this works' continue with the R#A$ recover() $ rman target / rcvcat rcvcat/rcvcat@oemprod R#A$> restore data&"le '/u( /oracle/db/A)* /tab/A)* +tab,db&' R#A$> recover data&"le '/u( /oracle/db/A)* /tab/A)* +tab,db&' SQL> alter database data&"le '/u( /oracle/db/A)* /tab/A)* +tab,db&' onl"ne; If taking the datafile offline fails, follow these steps:
$ sqlplus / as SYSDBA SQL> shutdown abort; SQL> startup mount; $ rman target / rcvcat rcvcat/rcvcat@oemprod R#A$> restore data&"le '/u( /oracle/db/A)* /tab/A)* +tab,db&'; R#A$> recover data&"le '/u( /oracle/db/A)* /tab/A)* +tab,db&'; SQL> alter database open;
(nce the recovery has been completed, e$ec!te a complete RMAN bac'!p to establish a new baseline. Restoring ,ontrol iles
In this scenario, it is assumed that your control files are backed up. You have a backup, done for example with backup database plus archivelog; In an ideal world you"ll never use R !N to restore a control file. 3ut if something catastrophic happens, and you lose all control files, here are the steps for getting them back: $he following examples assume that you are using a catalog. +irst, here"s the simplest 'racle4i syntax for restoring a control file: $ sqlplus / as SYSDBA SQL> shutdown abort; SQL> startup nomount; $ rman target / rcvcat rcvcat/rcvcat@oemprod Set the database id *!+%!, with the &ollowing co""and -his is a ./0digit nu"ber that R#A$ uses to uni1uel( identi&( this database in the recover( log -he nu"ber can be obtained &ro" an( previous R#A$ backup log &ile R#A$> set db"d - ..........;
R#A$> restore control&"le; SQL> alter database mount; SQL> alter database open; If this fails with ... /0A1( 2345 must use 06S678/9S or :/06S678/9S opt"on &or database open ... then you must perform a recover database: SQL> shutdown abort; SQL> startup mount; $ rman target / rcvcat rcvcat/rcvcat@oemprod R#A$> recover database; SQL> alter database open resetlogs; R#A$> reset database;
Note, that all offline archivelogs are now !seless, perform a f!ll bac' as soon as possible. Restoring (nline Redologs
In this scenario, it is assumed that your control files are backed up. You have a backup, done for example with backup database plus archivelog2
$ s1lplus 23 as s(sdba2 SQL> shutdown abort; SQL> startup nomount; $ rman target / rcvcat rcvcat/rcvcat@oemprod Set the database id *!+%!, with the &ollowing co""and -his is a ./0digit nu"ber that R#A$ uses to uni1uel( identi&( this database in the recover( log -he nu"ber can be obtained &ro" an( previous R#A$ backup log &ile R#A$> set db"d - ..........; R#A$> restore control&"le; SQL> alter database mount; R#A$> restore database; R#A#> recover database; R#A$0//45.) R#A$0//478) R#A$0//45.) R#A$0/=//>) R#A$0/7/4@) 66666666666666666666666666666666666666666666666666666666666 666666666666666 ERROR #ESSA9E S-AC: ;OLLO<S 666666666666666 66666666666666666666666666666666666666666666666666666666666 &ailure o& recover co""and at /83>?3>//@ ..)/=)>= "edia recover( re1uesting unknown log) thread . se1 . lowscn ?@@?@.@
#ince the online logs were lost, complete recovery is not possible. 'pen the database with resetlogs to continue. R#A$> alter database open resetlogs; 1111111111111111111111111111111111111*;</07A:71111111111111111111111111111111111111111111 Dur"ng th"s t!pe o& recover!= "& !ou rece"ve error messages l"#e th"s5 R#A$> restore database; Starting restore at ..0ABL0/4 using channel ORACS+-C-ADEC. using channel ORAC!%S:C. R#A$0//45.) 66666666666666666666666666666666666666666666666666666666666 R#A$0//478) 666666666666666 ERROR #ESSA9E S-AC: ;OLLO<S 666666666666666 R#A$0//45.) 66666666666666666666666666666666666666666666666666666666666 R#A$0/=//>) &ailure o& restore co""and at /53..3>//4 .@)>4)>> R#A$0/7/>7) so"e targets not &ound 0 aborting restore R#A$0/7/>=) no backup or cop( o& data&ile ./ &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile 8 &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile ? &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile 5 &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile 7 &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile 4 &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile @ &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile = &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile > &ound to restore R#A$0/7/>=) no backup or cop( o& data&ile . &ound to restore >use the &ollow"ng d"rect"ons to recover ?recreate the control&"le@5 A"th the database mounted= e.ecute Balter database bac#up control&"le to trace resetlogs;C <er&orm a shutdown abort on the database= but rema"n at the SD8E prompt, *n another telnet sess"on= go to the udump d"rector! to retr"eve the result"ng trace &"le and cop! "t to another locat"on to ed"t "t,
6d"t the &"le and add the phrase unt"l cancel to the recover database command at the end, 7he phrase should read recover database unt"l cancel us"ng bac#up control&"le, 0emove the alter database open command a&ter the recover command, Save the &"le w"th a ,sql e.tens"on, Bac# at the SD8E prompt= e.ecute the mod"&"ed trace &"le, Ahen prompted &or an arch"ved log= t!pe "n cancel and the repl! should be med"a recover! cancelled, *ssue alter database open resetlogs, 7he database should open a&ter a &ew moments, Fonnect to the 0;A: recover! catalog and "ssue the reset database command, <er&orm a &ull 0;A: bac#up as soon as poss"ble,
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
$o perform incomplete media recovery, you must restore all datafiles from backups created prior to the time to which you want to recover and then open the database with the R.#.$,'5# option when recovery completes. $he R.#.$,'5# operation creates a new incarnation of the database2 in other words, a database with a new stream of log se6uence numbers starting with log se6uence 7. :/76 G Start ever! 0;A: "ncomplete recover! w"th the &ollow"ng commands5 $ s1lplus 23 as s(sdba2 SQL> shutdown abort; SQL> startup mount; $ rman target / rcvcat rcvcat/rcvcat@oemprod
11Hor t"me1based recover!= use these commands5 R#A$> restore database unt"l t"me %to+date?'(I/ J/(2 R#A$> recover database unt"l t"me %to+date?'(I/ J/(2 "edia recover( co"plete SQL> alter database open resetlogs; 11Hor SF:1based recover!= user these commands5 R#A$> restore database unt"l scn (((; R#A$> recover database unt"l scn (((; "edia recover( co"plete SQL> alter database open resetlogs; 11Hor change1based recover!= user these commands5 R#A$> restore database unt"l sequence 44JM; R#A$> recover database unt"l sequence 44JM; "edia recover( co"plete SQL> alter database open resetlogs; 11Arch"ved log sequence number 11Arch"ved log sequence number J5(5(('=';;/DD/YY KKJL5;*5SS'@%; J5(5(('=';;/DD/YY KKJL5;*5SS'@%;
(nce the recovery has been completed, e$ec!te the following steps0
Delete pr"or bac#ups w"th th"s command ?&rom the 0;A: prompt@5
R#A$> delete &orce backup; +his command removes all prior bac'!ps from the RMAN catalog as they can no longer be !sed once the database has been restarted with the resletlogs option. After completing this command, create a new RMAN bac'!p to establish a new baseline.
$ rman target / rcvcat rcvcat/rcvcat@oemprod R#A$> restore A0FK*N68/9 H0/; 7*;6 'SYSDA761 ' O:7*8 7*;6 'SYSDA76'; or R#A$> restore A0FK*N68/9 H0/; 7*;6 %to+date?'(I/ O:7*8 7*;6 'SYSDA76'; /(2 ((5((5( '=';;/DD/YY KKJL5;*5SS'@