-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #663 from ministryofjustice/oasys_db_refresh_test
Updated to correct the sql for controlfile
- Loading branch information
Showing
1 changed file
with
9 additions
and
8 deletions.
There are no files selected for viewing
17 changes: 9 additions & 8 deletions
17
ansible/roles/oracle-db-refresh/templates/get_latest_backup_control_file.sql.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |