RMAN> run
2> {
3> set archivelog destination to '/tmp';
4> restore archivelog sequence 142 thread 2;
5> }
executing command: SET ARCHIVELOG DESTINATION
Starting restore at 2015-03-12 00:22:25
using channel ORA_DISK_1
archived log for thread 2 with sequence 142 is already on disk as file +FRA/rac/archivelog/2015_03_11/thread_2_seq_142.717.874033939
restore not done; all files read only, offline, or already restored
Finished restore at 2015-03-12 00:22:25
注,這裏因爲原本的歸檔日誌還存在,導致restore archivelog到/tmp下失敗。
如果log_archive_dest_1或log_archive_dest未設置,歸檔日誌默認放到閃回區。如果要restore的歸檔日誌在閃回區還存在的話,則無法restore。
手工去除後,restore到/tmp了
RMAN> delete archivelog sequence 142 thread 2;
RMAN> run
2> {
3> set archivelog destination to '/tmp';
4> restore archivelog sequence 142 thread 2;
5> }
[grid@rac1 ~]$ ll -ltar /tmp
total 48904
drwx------ 2 root root 4096 Sep 21 15:54 keyring-PiyxKA
。。。
-rw-r----- 1 oracle asmadmin 49039872 Mar 12 00:24 2_142_870389881.dbf