From e56b70a2b383280ec264416a0fe7a37b6fa676ff Mon Sep 17 00:00:00 2001 From: sandhya1874 Date: Fri, 5 Apr 2024 14:06:41 +0100 Subject: [PATCH 1/2] Updated to get latest controlfile --- .../get_latest_backup_control_file.sql.j2 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ansible/roles/oracle-db-refresh/templates/get_latest_backup_control_file.sql.j2 b/ansible/roles/oracle-db-refresh/templates/get_latest_backup_control_file.sql.j2 index 72cd10ea7..1f6aea64e 100644 --- a/ansible/roles/oracle-db-refresh/templates/get_latest_backup_control_file.sql.j2 +++ b/ansible/roles/oracle-db-refresh/templates/get_latest_backup_control_file.sql.j2 @@ -1,13 +1,11 @@ set head off echo off feedback off spool /tmp/{{ SOURCE_DB }}_control.txt -with controlfile_details as -( - select db_key, max(stamp) stamp from rcvcatowner.rc_backup_controlfile - where autobackup_date is NULL and db_name = '{{ SOURCE_DB }}' - 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 +select handle from + (select a.db_key,b.db_name, a.handle, a.tag, a.media, a.completion_time + from rcvcatowner.rc_backup_piece a , rcvcatowner.rc_backup_controlfile b + where a.db_key=b.db_key and a.set_stamp=b.set_stamp + and a.tag like 'CONTROL%' and b.db_name='{{ SOURCE_DB }}' order by a.db_key, a.completion_time desc ) +where rownum=1 / - +spool off exit From fb9a9f999139a7f72214567cf6979837b1a1b058 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 5 Apr 2024 13:07:59 +0000 Subject: [PATCH 2/2] Commit changes made by code formatters --- ansible/roles/oracle-db-refresh/tasks/oracle_db_restore.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ansible/roles/oracle-db-refresh/tasks/oracle_db_restore.yml b/ansible/roles/oracle-db-refresh/tasks/oracle_db_restore.yml index ae848480a..da2160452 100644 --- a/ansible/roles/oracle-db-refresh/tasks/oracle_db_restore.yml +++ b/ansible/roles/oracle-db-refresh/tasks/oracle_db_restore.yml @@ -15,4 +15,3 @@ dest: "/tmp/{{ TARGET_DB }}_control.txt" flat: yes fail_on_missing: yes -