Monday, February 14, 2011

Switching archive log destination

Generate a log file using default destination.

/arch/toronto
-rw-r----- 1 oracle oinstall 6656 Feb 14 17:40 1_16_742858742.dbf

Change the destination now, and generate another log file.

/arch/toronto_temp
-rw-r----- 1 oracle oinstall 10240 Feb 14 17:43 1_17_742858742.dbf

Switch the destination back to original, and generate another log file.

/arch/toronto
-rw-r----- 1 oracle oinstall 6656 Feb 14 17:40 1_16_742858742.dbf
-rw-r----- 1 oracle oinstall 2560 Feb 14 17:43 1_18_742858742.dbf

Run a backup of archive logs.

Starting backup at 14-FEB-11
current log archived
...
archived log file name=/arch/toronto/1_16_742858742.dbf RECID=14 STAMP=743103604
archived log file name=/arch/toronto_temp/1_17_742858742.dbf RECID=15 STAMP=743103792
archived log file name=/arch/toronto/1_18_742858742.dbf RECID=16 STAMP=743103834
archived log file name=/arch/toronto/1_19_742858742.dbf RECID=17 STAMP=743104161
archived log file name=/arch/toronto/1_20_742858742.dbf RECID=18 STAMP=743104162
Finished backup at 14-FEB-11

We will see both the original destination and temp destination archive logs are backed up and removed.

Now restore the log file sequence #17 to original location.

/arch/toronto
-rw-r----- 1 oracle oinstall 10240 Feb 14 17:51 1_17_742858742.dbf

We can view archive log details using rman.

List of Backup Sets
===================

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
51 119.51M DISK 00:00:05 12-FEB-11
BP Key: 54 Status: AVAILABLE Compressed: NO Tag: TAG20110212T201930
Piece Name: /data/stage/toronto/backup/01m4gnmj_1_1

List of Archived Logs in backup set 51
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 4 779391 11-FEB-11 800324 11-FEB-11
1 5 800324 11-FEB-11 823330 12-FEB-11
1 6 823330 12-FEB-11 841950 12-FEB-11

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
71 90.00K DISK 00:00:00 12-FEB-11
BP Key: 76 Status: AVAILABLE Compressed: NO Tag: TAG20110212T202027
Piece Name: /data/stage/toronto/backup/03m4gnoc_1_1

List of Archived Logs in backup set 71
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 7 841950 12-FEB-11 842048 12-FEB-11

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
137 265.18M DISK 00:00:41 14-FEB-11
BP Key: 140 Status: AVAILABLE Compressed: NO Tag: TAG20110214T163109
Piece Name: /data/stage/toronto/backup/05m4lj2f_1_1

List of Archived Logs in backup set 137
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 4 779391 11-FEB-11 800324 11-FEB-11
1 5 800324 11-FEB-11 823330 12-FEB-11
1 6 823330 12-FEB-11 841950 12-FEB-11
1 7 841950 12-FEB-11 842048 12-FEB-11
1 8 842048 12-FEB-11 847862 12-FEB-11
1 9 847862 12-FEB-11 869074 13-FEB-11
1 10 869074 13-FEB-11 891741 13-FEB-11
1 11 891741 13-FEB-11 916649 14-FEB-11
1 12 916649 14-FEB-11 916667 14-FEB-11

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
203 41.03M DISK 00:00:01 14-FEB-11
BP Key: 206 Status: AVAILABLE Compressed: NO Tag: TAG20110214T173236
Piece Name: /data/stage/toronto/backup/07m4lmlk_1_1

List of Archived Logs in backup set 203
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 5 800324 11-FEB-11 823330 12-FEB-11
1 13 916667 14-FEB-11 918073 14-FEB-11
1 14 918073 14-FEB-11 918159 14-FEB-11
1 15 918159 14-FEB-11 918179 14-FEB-11

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
260 35.00K DISK 00:00:00 14-FEB-11
BP Key: 263 Status: AVAILABLE Compressed: NO Tag: TAG20110214T174923
Piece Name: /data/stage/toronto/backup/09m4lnl3_1_1

List of Archived Logs in backup set 260
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 16 918179 14-FEB-11 918390 14-FEB-11
1 17 918390 14-FEB-11 918461 14-FEB-11
1 18 918461 14-FEB-11 918475 14-FEB-11
1 19 918475 14-FEB-11 918602 14-FEB-11
1 20 918602 14-FEB-11 918620 14-FEB-11

No comments:

Post a Comment