Skip to content

Commit

Permalink
Merge pull request #663 from ministryofjustice/oasys_db_refresh_test
Browse files Browse the repository at this point in the history
Updated to correct the sql for controlfile
  • Loading branch information
Sandhya1874 authored Apr 4, 2024
2 parents b5084f3 + 1433dec commit 1db5a8e
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
set head off echo off feedback off
spool /tmp/{{ ORACLE_DB_REFRESH_FILE }}
with controlfile_details as
( select db_key, max(completion_time) completion_time
from rcvcatowner.RC_BACKUP_CONTROLFILE
where db_name = '{{ ORACLE_DB_REFRESH_DB_NAME }}' group by db_key
)
select a.HANDLE
from rcvcatowner.RC_BACKUP_PIECE a, controlfile_details b
where a.db_key =b.db_key
and a.completion_time=b.completion_time;
(
select db_key, max(stamp) stamp from rcvcatowner.rc_backup_controlfile
where autobackup_date is NULL and db_name = '{{ ORACLE_DB_REFRESH_DB_NAME }}'
group by db_key
)
select a.HANDLE from rcvcatowner.rc_backup_piece a, controlfile_details b, rcvcatowner.rc_backup_controlfile c
where a.db_key =b.db_key and a.stamp=b.stamp and a.stamp=c.stamp and a.db_key=c.db_key and a.set_stamp=c.set_stamp and a.bs_key=c.bs_key
/

exit

0 comments on commit 1db5a8e

Please sign in to comment.