Monday, July 30, 2007

Rman script to backup all archivelogs.

RMAN> run {
allocate channel c1 type disk;
backup
format 'C:\oracle\backup\archivelog_t%t_s%s_p%p'
(archivelog all);
release channel c1;
}

Replace C:\oracle\backup\archivelog_t%t_s%s_p%p with
/home/oracle/backup/archivelog_t%t_s%s_p%p' for installation on linux or solaris.

Sample run.


RMAN> run {
2> allocate channel c1 type disk;
3> backup
4> format 'C:\oracle\backup\archivelog_t%t_s%s_p%p'
5> (archivelog all);
6> release channel c1;
7> }

released channel: ORA_DISK_1
allocated channel: c1
channel c1: sid=154 devtype=DISK

Starting backup at 26-JUL-07
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=2 recid=1 stamp=628270225
input archive log thread=1 sequence=3 recid=2 stamp=628284784
input archive log thread=1 sequence=4 recid=3 stamp=628285179
input archive log thread=1 sequence=5 recid=4 stamp=628311648
input archive log thread=1 sequence=6 recid=5 stamp=628332181
input archive log thread=1 sequence=7 recid=6 stamp=628332596
input archive log thread=1 sequence=8 recid=7 stamp=628365463
input archive log thread=1 sequence=9 recid=8 stamp=628369650
input archive log thread=1 sequence=10 recid=9 stamp=628218339
input archive log thread=1 sequence=11 recid=10 stamp=628260560
input archive log thread=1 sequence=12 recid=11 stamp=628691422
input archive log thread=1 sequence=13 recid=12 stamp=628771850
input archive log thread=1 sequence=14 recid=13 stamp=628884854
input archive log thread=1 sequence=15 recid=14 stamp=628953327
input archive log thread=1 sequence=16 recid=15 stamp=628965073
input archive log thread=1 sequence=17 recid=16 stamp=628965401
input archive log thread=1 sequence=18 recid=17 stamp=628965520
channel c1: starting piece 1 at 26-JUL-07
channel c1: finished piece 1 at 26-JUL-07
piece handle=C:\ORACLE\BACKUP\ARCHIVELOG_T628965521_S3_P1 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:18
Finished backup at 26-JUL-07

released channel: c1

RMAN>

No comments: