Aslında komut ve metoloji olarak full backupdan bir farkı bulunmamaktadır. Burada da benzer komutlar ile backup setimiz içerisindeki archivelogları default dizinine veya bizim belirteceğimiz farklı bir dizine restore edebiliriz. Archivelogları neden restore etmeye ihtiyaç duyabilirim şeklinde bir soru gelenler olabilir. Eğer full restore / recover yapıyorsanız ve mutlaka son ana dönmek istiyorsanız mutlaka archive loglarınıza ihtiyaç duyacaksınız demektir, aslında archiveloglarınızı restore etmeniz için mutlaka bir restore / recover durumu olması da gerekmeyebilir. Örneğin production database’ inizde yaşanan bir problem den dolayı backupı alınmış olupda DG’ a henüz işlenmemiş olan logları silmeniz gerekebilir veya DG’ da yaşanan bir problem dolayı apply işlemi durmuş olup DG’ ının geride kalmış olup sizinde primary database ‘ inizin backuğı ile archivelogları sildiğinizi düşünün ki, böyle bir durumda sadece eksik olan arhivelogları bulabilirseniz problemi en kısa yoldan çözmüş olursunuz.
Aslında karşılaşabileceğiniz o kadar çok case varki, tümünden burada bahsetmemiz mümkün değil ancak, sık karşılaşılan durumlardan ve neler yapabileceğimizden bahsedelim ;
Archiveloglar ile ilgili history bilgisine V$LOG_HISTORY view’ inden ulaşabilirsiniz ;
SQL> select * from v$log_history
where rownum < 5
RECID STAMP THREAD# SEQUENCE# FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# RESETLOGS_CHANGE# RESETLOGS_TIME
---------- ---------- ---------- ---------- ------------- ---------- ------------ ----------------- ----
74 772640774 1 74 943856 15-OCA-12 943985 1 08-OCA-12
75 772640784 1 75 943985 15-OCA-12 950648 1 08-OCA-12
76 772640790 1 76 950648 15-OCA-12 953374 1 08-OCA-12
77 772640795 1 77 953374 15-OCA-12 956105 1 08-OCA-12
4 rows selected.
Elimizdeki backupları kullanarak archiveloglarımızdan biri veya birkaçını çeşitli kriterlere göre restore etmete çalışalım.
Öncesinde testlerimizi yapabilmemiz için tüm archivelogların, full database’ in ve controlfile’ in backupını backupset olarak almakla başlıyorum;
run {
allocate channel disk1 device type disk format ‘D:\oracle\rman\%U’;
allocate channel disk2 device type disk format ‘D:\oracle\rman\%U’;
allocate channel disk3 device type disk format ‘D:\oracle\rman\%U’;
backup database plus archivelog;
}
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
allocated channel: disk1
channel disk1: SID=134 device type=DISK
allocated channel: disk2
channel disk2: SID=13 device type=DISK
allocated channel: disk3
channel disk3: SID=71 device type=DISK
Starting backup at 24-MAR-12
current log archived
channel disk1: starting archived log backup set
channel disk1: specifying archived log(s) in backup set
input archived log thread=1 sequence=288 RECID=65 STAMP=776010543
input archived log thread=1 sequence=290 RECID=64 STAMP=776010543
channel disk1: starting piece 1 at 24-MAR-12
channel disk2: starting archived log backup set
channel disk2: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=66 STAMP=776012641
..
..
channel disk2: starting piece 1 at 24-MAR-12
channel disk3: starting archived log backup set
channel disk3: specifying archived log(s) in backup set
input archived log thread=1 sequence=21 RECID=86 STAMP=776988247
input archived log thread=1 sequence=22 RECID=87 STAMP=777013230
input archived log thread=1 sequence=23 RECID=88 STAMP=777031460
..
..
channel disk3: starting piece 1 at 24-MAR-12
channel disk1: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3HN6KO66_1_1 tag=TAG20120324T000524 comment=NONE
channel disk1: backup set complete, elapsed time: 00:00:25
channel disk1: starting archived log backup set
channel disk1: specifying archived log(s) in backup set
input archived log thread=1 sequence=41 RECID=106 STAMP=777856300
input archived log thread=1 sequence=42 RECID=107 STAMP=777890793
..
..
channel disk1: starting piece 1 at 24-MAR-12
channel disk2: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3IN6KO66_1_1 tag=TAG20120324T000524 comment=NONE
channel disk2: backup set complete, elapsed time: 00:00:46
channel disk2: starting archived log backup set
channel disk2: specifying archived log(s) in backup set
input archived log thread=1 sequence=67 RECID=132 STAMP=778720944
input archived log thread=1 sequence=68 RECID=133 STAMP=778720946
..
..
channel disk2: starting piece 1 at 24-MAR-12
channel disk3: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3JN6KO68_1_1 tag=TAG20120324T000524 comment=NONE
channel disk3: backup set complete, elapsed time: 00:00:35
channel disk2: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3LN6KO7N_1_1 tag=TAG20120324T000524 comment=NONE
channel disk2: backup set complete, elapsed time: 00:00:08
channel disk1: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3KN6KO6V_1_1 tag=TAG20120324T000524 comment=NONE
channel disk1: backup set complete, elapsed time: 00:00:27
Finished backup at 24-MAR-12
Starting backup at 24-MAR-12
channel disk1: starting full datafile backup set
channel disk1: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\ORACLE\ORADATA\PROD\SYSTEM01.DBF
input datafile file number=00004 name=C:\ORACLE\ORADATA\PROD\USERS01.DBF
channel disk1: starting piece 1 at 24-MAR-12
channel disk2: starting full datafile backup set
channel disk2: specifying datafile(s) in backup set
input datafile file number=00005 name=C:\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE
\ORACLEORADATAPRODDATA01.DBF
input datafile file number=00006 name=C:\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE
\ORACLEORADATAPRODTEST01.DBF
channel disk2: starting piece 1 at 24-MAR-12
channel disk3: starting full datafile backup set
channel disk3: specifying datafile(s) in backup set
input datafile file number=00003 name=C:\ORACLE\ORADATA\PROD\UNDOTBS01.DBF
input datafile file number=00002 name=C:\ORACLE\ORADATA\PROD\SYSAUX01.DBF
channel disk3: starting piece 1 at 24-MAR-12
channel disk1: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3MN6KO8I_1_1 tag=TAG20120324T000642 comment=NONE
channel disk1: backup set complete, elapsed time: 00:00:16
channel disk2: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3NN6KO8I_1_1 tag=TAG20120324T000642 comment=NONE
channel disk2: backup set complete, elapsed time: 00:00:15
channel disk3: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3ON6KO8M_1_1 tag=TAG20120324T000642 comment=NONE
channel disk3: backup set complete, elapsed time: 00:00:15
Finished backup at 24-MAR-12
Starting backup at 24-MAR-12
current log archived
channel disk1: starting archived log backup set
channel disk1: specifying archived log(s) in backup set
input archived log thread=1 sequence=77 RECID=142 STAMP=778723632
channel disk1: starting piece 1 at 24-MAR-12
channel disk1: finished piece 1 at 24-MAR-12
piece handle=D:\ORACLE\RMAN\3PN6KO9G_1_1 tag=TAG20120324T000712 comment=NONE
channel disk1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-MAR-12
Starting Control File and SPFILE Autobackup at 24-MAR-12
piece handle=C:\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE\C-183876134-20120324-00
comment=NONE
Finished Control File and SPFILE Autobackup at 24-MAR-12
released channel: disk1
released channel: disk2
released channel: disk3
RMAN>
Almış olduğumuz bu backup içerisinden ilk 10 archive ihtiyacımız olduğunu varsayalım ;
RUN {
RESTORE ARCHIVELOG FROM SEQUENCE 1 UNTIL SEQUENCE 10;
}
Starting restore at 24-MAR-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
allocated channel: ORA_DISK_2
archived log for thread 1 with sequence 1 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_23\O1_MF_1_1_7NDG9YTV_.ARC
archived log for thread 1 with sequence 2 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_23\O1_MF_1_2_7NF6PHWS_.ARC
archived log for thread 1 with sequence 3 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_24\O1_MF_1_3_7NG2VGM1_.ARC
archived log for thread 1 with sequence 4 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_24\O1_MF_1_4_7NHV2H7T_.ARC
archived log for thread 1 with sequence 5 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_24\O1_MF_1_5_7NHV9ZCQ_.ARC
archived log for thread 1 with sequence 6 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_25\O1_MF_1_6_7NJQK2Z6_.ARC
archived log for thread 1 with sequence 7 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_25\O1_MF_1_7_7NKMO0WR_.ARC
archived log for thread 1 with sequence 8 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_25\O1_MF_1_8_7NLHRZ1X_.ARC
archived log for thread 1 with sequence 9 is already on disk as file C:\ORACLE\F
LASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_26\O1_MF_1_9_7NMCLSPX_.ARC
archived log for thread 1 with sequence 10 is already on disk as file \O1_MF_1_10_7NNDT4CO_.ARC
restore not done; all files read only, offline, or already restored
Finished restore at 24-MAR-12
RMAN>
Restore etmeye çalıştığımız archiveloglar fiziki olarak diskimizde olduğundan dolayı zaten var olduğundan dolayı işlemi yapmadı. Disk üzerindeki tüm archivelogları siliyorum ;
delete noprompt archivelog all;
released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
released channel: ORA_DISK_6
released channel: ORA_DISK_7
released channel: ORA_DISK_8
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=13 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=71 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=136 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=201 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=14 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=74 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=137 device type=DISK
List of Archived Log Copies for database with db_unique_name PROD
=====================================================================
Key Thrd Seq S Low Time
——- —- ——- – ———
66 1 1 A 23-FEB-12
Name: C:\ORACLE\FLASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_23\O1_MF_1_1
_7NDG9YTV_.ARC
..
..
142 1 77 A 24-MAR-12
Name: D:\ORACLE\ARCH\ARC0000000077_0776010541.0001
deleted archived log
archived log file name=C:\ORACLE\FLASH_RECOVERY_AREA\PROD\ARCHIVELOG\2012_02_23\
O1_MF_1_1_7NDG9YTV_.ARC RECID=66 STAMP=776012641
deleted archived log
..
..
archived log file name=D:\ORACLE\ARCH\ARC0000000077_0776010541.0001 RECID=142 ST
AMP=778723632
Deleted 77 objects
RMAN> exit
Disk üzerinde hiçbir archivelog kalmadı. Şimdi ilk restore işlemimizi tekrarlayalım ;
RUN {
RESTORE ARCHIVELOG FROM SEQUENCE 1 UNTIL SEQUENCE 10;
}
Starting restore at 24-MAR-12
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
using channel ORA_DISK_7
using channel ORA_DISK_8
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=4
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=6
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=10
channel ORA_DISK_1: reading from backup piece D:\ORACLE\RMAN\3IN6KO66_1_1
channel ORA_DISK_1: piece handle=D:\ORACLE\RMAN\3IN6KO66_1_1 tag=TAG20120324T000524
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 24-MAR-12
Rman backupları restore ederken restore edilen path bilgisi güncel olarak archiveların çıkmış olduğu path’ dir. Yani archivelog path’ iniz zaman içerisinde değişiklik gösterebileceğinden burada şunu düşünmemek gerekir. Archiveloglar backupı alınırken hangi path’ de ise restore işlemi de o path’ e yapılacaktır, bu yanlış bir bilgidir.
Aynı restore işlemini şimdide farklı bir path’ e yapmayı deneyelim;
RUN {
SET ARCHIVELOG DESTINATION to ‘D:\oracle\arch2’;
RESTORE ARCHIVELOG FROM SEQUENCE 1 UNTIL SEQUENCE 10;
}
executing command: SET ARCHIVELOG DESTINATION
Starting restore at 24-MAR-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log restore to user-specified destination
archived log destination=D:\oracle\arch2
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=3
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=4
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=5
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=6
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=10
channel ORA_DISK_1: reading from backup piece D:\ORACLE\RMAN\3IN6KO66_1_1
channel ORA_DISK_1: piece handle=D:\ORACLE\RMAN\3IN6KO66_1_1 tag=TAG20120324T000524
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 24-MAR-12
RMAN>
Aynı işlemi aşağıdaki komutlada yapabilirdik ;
run {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
restore archivelog sequence 1;
restore archivelog sequence 2;
restore archivelog sequence 3;
restore archivelog sequence 4;
restore archivelog sequence 5;
restore archivelog sequence 6;
restore archivelog sequence 7;
restore archivelog sequence 8;
restore archivelog sequence 9;
restore archivelog sequence 10;
}
released channel: ORA_DISK_1
released channel: ORA_DISK_2
allocated channel: c1
channel c1: SID=134 device type=DISK
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=1
channel c1: reading from backup piece D:\ORACLE\RMAN\3IN6KO66_1_1
channel c1: piece handle=D:\ORACLE\RMAN\3IN6KO66_1_1 tag=TAG20120324T000524
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:07
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=2
channel c1: reading from backup piece D:\ORACLE\RMAN\3IN6KO66_1_1
channel c1: piece handle=D:\ORACLE\RMAN\3IN6KO66_1_1 tag=TAG20120324T000524
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:07
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
..
channel c1: restore complete, elapsed time: 00:00:15
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
..
channel c1: restore complete, elapsed time: 00:00:07
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
..
channel c1: restore complete, elapsed time: 00:00:15
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
..
channel c1: restore complete, elapsed time: 00:00:15
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
..
channel c1: restore complete, elapsed time: 00:00:07
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
..
channel c1: restore complete, elapsed time: 00:00:07
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
..
channel c1: restore complete, elapsed time: 00:00:15
Finished restore at 24-MAR-12
Starting restore at 24-MAR-12
channel c1: starting archived log restore to default destination
..
channel c1: restore complete, elapsed time: 00:00:15
Finished restore at 24-MAR-12
released channel: c1
RMAN>
Her iki yöntemde ihtiyaç duyduğumuz backupları restore etmeyi başardık. Ancak bu iki yöntem arasındaki tek fark sizinde farkedeceğiniz üzere zaman farkıdır. İlk yöntemde 35 sn’ de 10 tane archivelogu restore etmişken, ikinci yöntemde bu süre 7-8 kat daha uzamıştır. Archiveloglarınızın size’ ı, restore etmeniz gereken archivelog sayısı ve backupset’ inizin size’ i bu süreyi doğrudan etkileyen unsurlardır. Burada hedef backupseti en az okumayla tüm iş bitirilmeye çalışılmalıdır.
Sadece düne ait olan archivelogları restore etmeye çalışalım ;
RMAN> restore archivelog from time ‘sysdate-1’;
Starting restore at 24-MAR-12
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=67
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=68
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=69
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=70
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=71
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=72
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=73
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=74
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=75
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=76
channel ORA_DISK_1: reading from backup piece D:\ORACLE\RMAN\3LN6KO7N_1_1
channel ORA_DISK_2: starting archived log restore to default destination
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=57
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=58
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=59
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=60
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=61
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=62
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=63
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=64
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=65
channel ORA_DISK_2: restoring archived log
archived log thread=1 sequence=66
channel ORA_DISK_2: reading from backup piece D:\ORACLE\RMAN\3KN6KO6V_1_1
channel ORA_DISK_1: piece handle=D:\ORACLE\RMAN\3LN6KO7N_1_1 tag=TAG20120324T000
524
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=77
channel ORA_DISK_1: reading from backup piece D:\ORACLE\RMAN\3PN6KO9G_1_1
channel ORA_DISK_1: piece handle=D:\ORACLE\RMAN\3PN6KO9G_1_1 tag=TAG20120324T000
712
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_2: piece handle=D:\ORACLE\RMAN\3KN6KO6V_1_1 tag=TAG20120324T000
524
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:15
Finished restore at 24-MAR-12
Son olarak archivelogları restore etmeden (database backuplarında olduğu gibi) sağlamlığını test edelim;
RMAN> restore archivelog from time ‘sysdate-1’ validate ;
Starting restore at 24-MAR-12
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000057_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000058_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000059_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000060_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000061_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000062_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000063_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000064_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000065_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000066_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000067_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000068_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000069_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000070_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000071_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000072_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000073_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000074_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000075_0776010541.0001
channel ORA_DISK_1: scanning archived log D:\ORACLE\ARCH\ARC0000000076_0776010541.0001
channel ORA_DISK_2: scanning archived log D:\ORACLE\ARCH\ARC0000000077_0776010541.0001
Finished restore at 24-MAR-12
RMAN>
İlk scriptimizde validation işlemini yapmak isteseydik;
RUN {
RESTORE ARCHIVELOG FROM SEQUENCE 1 UNTIL SEQUENCE 10 validate ;
}
Starting restore at 24-MAR-12
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting validation of archived log backup set
channel ORA_DISK_1: reading from backup piece D:\ORACLE\RMAN\3IN6KO66_1_1
channel ORA_DISK_1: piece handle=D:\ORACLE\RMAN\3IN6KO66_1_1 tag=TAG20120324T000524
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: validation complete, elapsed time: 00:00:15
Finished restore at 24-MAR-12
RMAN>
Alınmış olan tüm archivelogları restore etmek isterseniz ki, buna çok ihtimal vermiyorum 🙂 ;
Run {
Restore archivelog all ;
}
Tüm loglarınıza kavuşmuş olacaksınız demektir. (tabi eğer backuplarınız duruyor ise)
Eğer restore edilmeye çalışan backuplara erişelemiyorsa (veya fiziki olarak bu backuplar artık yoksa);
RUN {
RESTORE ARCHIVELOG FROM SEQUENCE 1 UNTIL SEQUENCE 2;
}
Starting restore at 24-MAR-12
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=2
channel ORA_DISK_1: reading from backup piece D:\ORACLE\RMAN\3IN6KO66_1_1
channel ORA_DISK_1: ORA-19870: error while restoring backup piece D:\ORACLE\RMAN\3IN6KO66_1_1
ORA-19505: failed to identify file “D:\ORACLE\RMAN\3IN6KO66_1_1”
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 3) The system cannot find the path specified.
Gibi bir hatayla karşılaşacaksınız demektir.
Restore edilmeye çalışılan archivelog varolan backupset içerisinde bulunamıyorsa ;
RUN {
RESTORE ARCHIVELOG FROM SEQUENCE 500 UNTIL SEQUENCE 501;
}
Starting restore at 24-MAR-12
using channel ORA_DISK_1
using channel ORA_DISK_2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/24/2012 01:24:19
RMAN-20242: specification does not match any archived log in the repository
RMAN>
Hatası alacaksınız demektir.
Archivelog restore işlemi olarak aslında değinmediğimiz tek nokta backuplarınızı tape ünitesine alıyor iseniz allocate kısmında bu parametreleri gönderiyor olmanız gerektiğidir.
Archivelog recover işlemlerinde rman recovery catalog database’ I kullanıyor olmanız birşeyi değiştirmeyecektir. Sadece restore işlemini yapmadan önce cataloga bağlanıyor olmanız yeterli olacaktır.
Tuncay Selam,
Upgrade yöntemini tam olarak anlayamamakla braber, yazdıklarından oracle 10g olan bir veritabanından almış olduğun bir rman full backupı farklı bir sunucu üzerinde 11g olan bir database’ e restore etmeye çalışıyorsun sanırım. Öncelikle şunu belirteyim bu şekilde br upgrade yapamazsın. 10g binary den almış olduğun bir backupı 11g binarisi olan bir ortama direk olarak restore edemezsin. Dolayısyla farklı bir yöntem seçyor olman lazım, 10g db ini ilk önce aynı sunucu üzerinde upgrade edip sonrasında farklı bir sunucu üzerine migrate edebilirsin veya export – import ile 11g ye upgrade edebilirsin.
Merhaba; çalışmakta olan bir ora10g veritabanını ora11g ye aktarmak istiyorum. kurulumlar her şey tamam. Fakat restore archivelog all demek mecburi midir? 01.10.2016 full backup aldım. ve şuan archivelog kısmında kaldım.son 3 günün archivelog u var. daha eskiye ihtiyaç duyar mı ? ay olarak eski archive log yok ? veya yedek alırken archivelog a ihtiyaç duymaksızın yedek alınabilir mi? farklı bir makinaya restore edecem.