[Home] [Help]
272:
273: end if;
274:
275: --Bug 7255366 nissubra---
276: update ad_snapshots set snapshot_update_date = sysdate
277: where snapshot_id in (p_snapshot_id, p_global_snapshot_id);
278:
279: commit;
280:
294: end if;
295:
296: select s.appl_top_id, aat.applications_system_name, aat.name
297: into l_appl_top_id, l_apps_sys_nm, l_at_name
298: from ad_snapshots s, ad_appl_tops aat
299: where s.appl_top_id = aat.appl_top_id
300: and s.snapshot_id = p_snapshot_id;
301:
302: begin
374:
375: end backfill_bugs_from_patch_hist;
376:
377:
378: -- Creates just the top level info (ad_appl_tops and ad_snapshots)
379: procedure get_create_global_view_header
380: (
381: p_apps_system_name varchar2,
382: p_is_run_flow boolean,
442: to_char(tape_version) = (select release_name
443: from fnd_product_groups
444: where applications_system_name =
445: p_apps_system_name);
446: insert into ad_snapshots
447: (
448: snapshot_id, release_id,
449: appl_top_id, snapshot_name,
450: snapshot_creation_date, snapshot_update_date,
452: ran_snapshot_flag,
453: creation_date, last_updated_by, created_by, last_update_date
454: )
455: select
456: ad_snapshots_s.nextval, l_release_id,
457: p_global_appl_top_id, 'GLOBAL_VIEW',
458: sysdate, sysdate,
459: l_snapshot_type, 'Created from Current View Snapshots',
460: 'N',
460: 'N',
461: sysdate, 5, 5, sysdate
462: from dual
463: where not exists (select 'Already exists'
464: from ad_snapshots
465: where appl_top_id = p_global_appl_top_id
466: and snapshot_type = l_snapshot_type
467: and snapshot_name = 'GLOBAL_VIEW');
468:
469: /* Get above created Global snapshot ID */
470:
471: select snapshot_id
472: into p_global_snapshot_id
473: from ad_snapshots
474: where snapshot_type = l_snapshot_type
475: and snapshot_name = 'GLOBAL_VIEW'
476: and appl_top_id = p_global_appl_top_id;
477:
518: end if;
519:
520: select snapshot_id
521: bulk collect into l_cv_ids
522: from ad_snapshots s, ad_appl_tops at1
523: where s.appl_top_id = at1.appl_top_id
524: and at1.applications_system_name = p_apps_system_name
525: and at1.appl_top_type = 'R'
526: and at1.active_flag = 'Y'
679: end if;
680:
681: begin
682: select snapshot_id into l_global_snapshot_id
683: from ad_snapshots
684: where snapshot_name ='GLOBAL_VIEW'
685: and snapshot_type= l_global_snapshot_type
686: and appl_top_id = (
687: select appl_top_id
698: if p_instantiate_from_preseed then
699: if l_global_snapshot_id <> -1 then
700: begin
701: select 'x' into l_dummy
702: from ad_snapshots ads
703: where ads.release_id = l_release_id
704: and ads.snapshot_id = l_global_snapshot_id;
705: exception when no_data_found then
706: l_dummy := null;
706: l_dummy := null;
707: end;
708:
709: if l_dummy is null then
710: update ad_snapshots
711: set snapshot_type = 'O',
712: snapshot_name = snapshot_name||'-'||snapshot_id,
713: last_update_date = sysdate
714: where snapshot_id = l_global_snapshot_id;
735: --
736:
737: select ss.snapshot_id
738: into l_preseeded_snapshot_id
739: from ad_snapshots ss, -- seeded
740: ad_appl_tops ats -- seeded
741: where ss.appl_top_id = ats.appl_top_id
742: and ss.snapshot_type = 'B'
743: and ss.snapshot_name like '*PRESEEDED*'||p_release_name||'%'
817: if l_global_snapshot_id <> -1 then
818:
819: begin
820: select 'x' into l_dummy
821: from ad_snapshots ads, ad_releases adr
822: where ads.release_id = adr.release_id
823: and ads.snapshot_id = l_global_snapshot_id
824: and adr.major_version = ( select distinct major_version from ad_releases
825: where release_id = l_release_id );
828: l_dummy := null;
829: end;
830:
831: if l_dummy is null then
832: update ad_snapshots
833: set snapshot_type = 'O',
834: snapshot_name = snapshot_name||'-'||snapshot_id,
835: last_update_date = sysdate
836: where snapshot_id = l_global_snapshot_id;
836: where snapshot_id = l_global_snapshot_id;
837: l_global_snapshot_id := -1;
838:
839: else
840: update ad_snapshots
841: set release_id = l_release_id,
842: last_update_date = sysdate
843: where snapshot_id = l_global_snapshot_id
844: and release_id <> l_release_id;
874: 'EXPLICIT', 'IMPLICIT'),
875: decode(min(decode(success_flag, 'N', 1, 2)), 1, 'N', 'Y')
876: from ad_snapshot_bugfixes
877: where snapshot_id in (select snapshot_id
878: from ad_snapshots s, ad_appl_tops at1
879: where s.appl_top_id = at1.appl_top_id
880: and at1.applications_system_name = p_apps_system_name
881: and at1.appl_top_type = 'R'
882: and s.snapshot_type = l_current_snapshot_type
1254: );
1255:
1256: select snapshot_id
1257: into l_snapshot_id
1258: from ad_snapshots
1259: where appl_top_id = p_appl_top_id
1260: and snapshot_name = 'CURRENT_VIEW'
1261: and snapshot_type = l_current_snapshot_type;
1262:
1270:
1271: /* Get Global snapshot ID for this Applications System */
1272:
1273: select snapshot_id into l_global_snapshot_id
1274: from ad_snapshots s, ad_appl_tops t
1275: where s.snapshot_type = l_global_snapshot_type and
1276: s.snapshot_name = 'GLOBAL_VIEW' and
1277: s.appl_top_id = t.appl_top_id and
1278: t.applications_system_name = l_apps_system_name;
1878: ' new files in the curr-vw snapshot');
1879: end if;
1880:
1881: select count(*) into l_snapshot_count
1882: from ad_snapshots s, ad_appl_tops t
1883: where s.snapshot_type = l_current_snapshot_type and
1884: s.appl_top_id = t.appl_top_id and
1885: t.applications_system_name = l_apps_system_name;
1886:
2179: where sf1.file_id = l_deleted_ru_file_ids(i)
2180: and nvl(sf1.containing_file_id, -1) = nvl(sf.containing_file_id, -1)
2181: and sf1.snapshot_id in (
2182: select s.snapshot_id
2183: from ad_snapshots s, ad_appl_tops a
2184: where s.snapshot_type = l_current_snapshot_type
2185: and s.appl_top_id = a.appl_top_id
2186: and a.applications_system_name = l_apps_system_name
2187: and nvl(a.active_flag,'Y') = 'Y'
2195:
2196: end if;
2197:
2198: --Bug 7255366 nissubra---
2199: update ad_snapshots set last_update_date = sysdate,
2200: snapshot_update_date = sysdate
2201: where snapshot_id in (l_snapshot_id, l_global_snapshot_id);
2202:
2203: commit;
2349:
2350: begin
2351: select snapshot_id
2352: into l_curr_vw_snapshot_id
2353: from ad_snapshots
2354: where appl_top_id = p_appl_top_id
2355: and snapshot_name = 'CURRENT_VIEW'
2356: and snapshot_type = l_snapshot_type;
2357: exception when no_data_found then
2361:
2362: begin
2363: select ss.snapshot_id, ss.release_id
2364: into l_preseeded_snapshot_id, l_preseeded_rlse_id
2365: from ad_snapshots ss, -- seeded
2366: ad_appl_tops ats -- seeded
2367: where ss.appl_top_id = ats.appl_top_id
2368: and ss.snapshot_type = 'B'
2369: and ss.snapshot_name like '*PRESEEDED*'||l_rlse_nm||'%'
2379: if l_preseeded_snapshot_id <> -1 then
2380: if l_curr_vw_snapshot_id <> -1 then
2381: begin
2382: select 'x' into l_dummy
2383: from ad_snapshots ads
2384: where nvl(ran_snapshot_flag, 'N') = 'Y'
2385: and ads.release_id = p_release_id
2386: and ads.snapshot_id = l_curr_vw_snapshot_id;
2387: exception when no_data_found then
2388: l_dummy := null;
2389: end;
2390:
2391: if l_dummy is null then
2392: update ad_snapshots
2393: set snapshot_type = 'O',
2394: snapshot_name = snapshot_name||'-'||snapshot_id,
2395: last_update_date = sysdate
2396: where snapshot_id = l_curr_vw_snapshot_id;
2403: if l_curr_vw_snapshot_id = -1 then
2404:
2405: -- create new CV through pressed.
2406:
2407: select ad_snapshots_s.nextval into l_curr_vw_snapshot_id from dual;
2408:
2409: insert into ad_snapshots
2410: (
2411: snapshot_id,
2405: -- create new CV through pressed.
2406:
2407: select ad_snapshots_s.nextval into l_curr_vw_snapshot_id from dual;
2408:
2409: insert into ad_snapshots
2410: (
2411: snapshot_id,
2412: release_id, appl_top_id,
2413: snapshot_name, comments,
2501: /* set ran_snapshot_flag only incase the *PRESEEDED* snapshot
2502: * has files information.
2503: */
2504:
2505: update ad_snapshots
2506: set ran_snapshot_flag = 'Y',
2507: last_update_date = sysdate
2508: where snapshot_id = l_curr_vw_snapshot_id;
2509:
2522: if l_curr_vw_snapshot_id <> -1 then
2523:
2524: begin
2525: select 'x' into l_dummy
2526: from ad_snapshots ads, ad_releases adr
2527: where ads.release_id = adr.release_id
2528: and ads.snapshot_id = l_curr_vw_snapshot_id
2529: and adr.major_version = ( select distinct major_version from ad_releases
2530: where release_id = p_release_id );
2534: end;
2535:
2536: if l_dummy is null then
2537:
2538: update ad_snapshots
2539: set snapshot_type = 'O',
2540: last_update_date = sysdate,
2541: snapshot_name = snapshot_name||'-'||snapshot_id
2542: where snapshot_id = l_curr_vw_snapshot_id;
2557: end if;
2558:
2559: p_return_code := G_INSTANTIATED_SNAPSHOT; -- Instantiated Snapshot
2560:
2561: select ad_snapshots_s.nextval into l_curr_vw_snapshot_id from dual;
2562:
2563: insert into ad_snapshots
2564: (
2565: snapshot_id,
2559: p_return_code := G_INSTANTIATED_SNAPSHOT; -- Instantiated Snapshot
2560:
2561: select ad_snapshots_s.nextval into l_curr_vw_snapshot_id from dual;
2562:
2563: insert into ad_snapshots
2564: (
2565: snapshot_id,
2566: release_id, appl_top_id,
2567: snapshot_name, comments,
2579: from dual;
2580:
2581: else
2582:
2583: update ad_snapshots
2584: set release_id = p_release_id,
2585: last_update_date = sysdate
2586: where snapshot_id = l_curr_vw_snapshot_id
2587: and release_id <> p_release_id;