Restore database


Restore edeceyimiz database ucun asagdaki Rman scriptini istifade ede bilerik.
RUN
{
RESTORE CONTROLFILE FROM '/data/ANARDB/controlfile/cntrlfile.copy';
ALTER DATABASE MOUNT;
RESTORE DATABASE FROM TAG before_test;
recover database FROM TAG archbackup;
ALTER DATABASE OPEN RESETLOGS;
}
Daha saglam sekilde restore etmek ucun yuxarida yazmis oldugumuz Rman scriptini 3 yere bolubadim adim ilerleye bilerik.
Rman ile baglandiqdan sonra ilk olaraq controlfile 'leri restore et
Rman target /
RUN
{
RESTORE CONTROLFILE FROM '/data/ANARDB/controlfile/cntrlfile.copy';
}
Belelikler controlfile'leri spfile'lerin gosterdiyi yere restore oldu. Artik kontrolfile'lerimiz var. DB ni mount ede bilerik.
Indi DB bashqa bir yere restor edeceyimiz ucun asagdaki adimlari etmek gerekecekdir.
Restore database den once hokmen set newname gostermeliyik.
connect target /; 
 
run { 
set command id to "ef1"; 
set until time = "TO_DATE('08/11/2014 15:00:00','mm/dd/yyyy HH24:MI:SS')"; 
allocate channel t1 type 'SBT_TAPE' parms 'ENV=(NSR_SERVER=express,NSR_CLIENT=tuna)';
 set newname for datafile 1 to '/export/home0/anardata/ANARDB/system01.dbf'; 
 set newname for datafile 2 to '/export/home0/anardata/ANARDB/undotbs01.dbf'; 
 set newname for datafile 3 to '/export/home0/anardata/ANARDB/sysaux01.dbf'; 
 set newname for datafile 4 to '/export/home0/anardata/ANARDB/dft_data01.dbf'; 
 set newname for datafile 5 to '/export/home0/anardata/ANARDB/dft_index01.dbf'; 
 set newname for datafile 6 to '/export/home0/anardata/ANARDB/dft_clob01.dbf'; 
restore database; 
}
Sonrasinde controlfile'lerde deyisikliklerin qalmasi ucun asagdaki sekilde Rman scripti yaza bilerik.
connect target /; 
 
run { 
set command id to "ef1"; 
set until time = "TO_DATE('08/11/2010 15:00:00','mm/dd/yyyy HH24:MI:SS')"; 
allocate channel t1 type 'SBT_TAPE' parms 'ENV=(NSR_SERVER=express,NSR_CLIENT=tuna)';
 set newname for datafile 1 to '/export/home0/anardata/ANARDB/system01.dbf'; 
 set newname for datafile 2 to '/export/home0/anardata/ANARDB/undotbs01.dbf'; 
 set newname for datafile 3 to '/export/home0/anardata/ANARDB/sysaux01.dbf'; 
 set newname for datafile 4 to '/export/home0/anardata/ANARDB/dft_data01.dbf'; 
 set newname for datafile 5 to '/export/home0/anardata/ANARDB/dft_index01.dbf'; 
 set newname for datafile 6 to '/export/home0/anardata/ANARDB/dft_clob01.dbf'; 
switch datafile all;
}
Sonrasinda alter database rename file ile redeloglarin patch'lerini controlfile'de deyisdirmeliyik.
Sqlplus ile db mount modda olarken edilmelidir.
Alter database rename file ‘kohne_patch’ to ‘teze_patch’;
En son archivelog'lari recover edib db ni resetlogs'da aciriq.
RUN
{
recover database FROM TAG archbackup;
ALTER DATABASE OPEN RESETLOGS;
}
Onuda qeyd edim ki DB ni resetlogs'da acdiqdan sonra DB den hokmen full backup almaliyiq

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: