Oracle Database Restore archivelogs from Sequence to Sequence Based on the Dates we give.

Share via:

select ‘restore archivelog from logseq ‘||
min(sequence#) ||
‘ until logseq ‘ ||
max(sequence#) ||
‘ thread ‘ ||
thread# || ‘;’
from gv$archived_log
where completion_time between
to_date(‘&start_date’,’DD-MON-YY HH24:MI:SS’) AND
to_date(‘&end_date’,’DD-MON-YY HH24:MI:SS’)
group by thread#;

 

 

Input Required:

Enter value for start_date: 02-OCT-16

Enter value for end_date: 02-NOV-16

Sample Output NON-RAC : 

restore archivelog from logseq 636 until logseq 745 thread 1;

Sample Output RAC Environment: 

restore archivelog from logseq 3717 until logseq 4048 thread 1;
restore archivelog from logseq 3559 until logseq 3846 thread 2;

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (14 votes, average: 5.00 out of 5)
Loading...

2 thoughts on “Oracle Database Restore archivelogs from Sequence to Sequence Based on the Dates we give.

Add Comment