Anda di halaman 1dari 3

RESTORE CONTROLFILE USING RMAN

backups on disk no catalog

1RMAN> set DBID xxxxxxx


2RMAN> restore controlfile from {'<path>' | autobackup};

backups on disk with catalog

1RMAN> restore controlfile

Restore of the control file from controlfile autobackup


Database state : Nomount

1RMAN> set dbid xxxxxx


2
3RMAN> restore controlfile from autobackup;

The restored control file is written to all locations listed in the CONTROL_FILES
initialization parameter.

Database state : OPEN

RMAN> restore until time 'sysdate-1' CONTROLFILE to


1'/u02/oradata/20130218_control01.ctl' from autobackup;

Note: The until time clause set the time validity for controlfile. By default RMAN looks for
autobackup for 7 days.
If you want to override this then simply use this:

RMAN> restore until time 'sysdate-1 'CONTROLFILE to


1'/u02/oradata/20130218_control01.ctl' from autobackup maxdays 31;

if you multiple backups of the controlfile on a particular day , restore from autobackup
always
restores the latest copy
If you need to restore controlfile from a specific backup then we need to use “SET UNTIL
TIME”

1run
2{
3set until time "to_date('20130218:12:01','yyyymmdd:hh24:mi')";
4restore controlfile from autobackup preview;
5}
Restore Controlfile to a new location

1restore controlfile to ‘d:\controlfile_backup\04042012_control01.ctl’;

you can run the above command when the database is in a nomount/mount / open states as
you are not overwritting the controlfile

restore controlfile from a know position

1rman> restore controlfile from 'filename';

RESTORING THE SERVER PARAMETER FILE (SPFILE) FROM BACKUP

using recovery catalog

1rman> connect target /


2
rman> startup force mount; -- ( rman starts the instance with a dummy
3parameter file)
4
5rman> restore spfile from autobackup ;

to restore to a non default location

1rman> restore spfile to '/tmp/spfiletest.ora' from autobackup ;

Using controlfile autobackups

1rman> set dbid xxxxxxx; ( if you need to get the dbid refer to
http://arjudba.blogspot.co.uk/2008/05/how-to-discover-find-dbid.html )
2
3rman> restore spfile from autobackup;

if you need to serach past the 7 days default

rman> restore until time 'sysdate-1' SPFILE to '/tmp/spfiletest.ora'


1from autobackup maxdays 100;

Example of recovering spfile and controlfile using rman

1 rman target =/
2
rman> set dbid = xxxxxx if you need to get the dbid refer to
3 http://arjudba.blogspot.co.uk/2008/05/how-to-discover-find-dbid.html )
4 rman>
5 run
6 {
set controlfile autobackup format for device type disk to
7 '/rmanbackup/oradata/uknppp/cf_%F';
8 restore spfile from autobackup;
9 }
10
11rman> shutdown;
12
rman> startup force nomount;
13
14rman> run
15{
16
17set controlfile autobackup format for device type disk to
18'/rmanbackup/oradata/uknppp/cf_%F';
19restore controlfile from autobackup;
20}
21

https://mdesouza.wordpress.com/2013/02/21/rman-restore-of-controlfile-and-spfile/

Anda mungkin juga menyukai