DBA Data[Home] [Help]

APPS.AD_ZD_MVIEW dependencies on AD_ZD

Line 1: PACKAGE BODY AD_ZD_MVIEW AS

1: PACKAGE BODY AD_ZD_MVIEW AS
2: -- $Header: ADZDMVB.pls 120.38.12020000.12 2013/05/09 14:49:45 rraam ship $
3:
4:
5: /*******************************************************************

Line 17: AD_ZD_LOG.Message('ad.plsql.ad_zd_mview.'||p_module, p_log_type, p_message);

13: -- Diagnostic Log shortcut
14: procedure LOG(p_module varchar2, p_log_type varchar2, p_message varchar2)
15: is
16: begin
17: AD_ZD_LOG.Message('ad.plsql.ad_zd_mview.'||p_module, p_log_type, p_message);
18: end;
19:
20:
21: /*-----------------------------------------------------------------+

Line 524: l_phase varchar2(80) := ad_zd_parallel_exec.C_PHASE_CUTOVER;

520: is
521: c_module varchar2(25) := 'drop_recreate';
522: l_exp_mvdef clob;
523: l_exist number;
524: l_phase varchar2(80) := ad_zd_parallel_exec.C_PHASE_CUTOVER;
525: l_ddl_defs ddl_defs;
526: begin
527: log(c_module, 'PROCEDURE', 'begin: '||p_owner||'.'||p_mview_name);
528:

Line 529: if (ad_zd.get_edition('PATCH') is null) then

525: l_ddl_defs ddl_defs;
526: begin
527: log(c_module, 'PROCEDURE', 'begin: '||p_owner||'.'||p_mview_name);
528:
529: if (ad_zd.get_edition('PATCH') is null) then
530: l_phase := ad_zd_parallel_exec.C_PHASE_UPGRADE_MVIEW;
531: end if;
532:
533: -- If MVLog exist then install mvlog marker

Line 530: l_phase := ad_zd_parallel_exec.C_PHASE_UPGRADE_MVIEW;

526: begin
527: log(c_module, 'PROCEDURE', 'begin: '||p_owner||'.'||p_mview_name);
528:
529: if (ad_zd.get_edition('PATCH') is null) then
530: l_phase := ad_zd_parallel_exec.C_PHASE_UPGRADE_MVIEW;
531: end if;
532:
533: -- If MVLog exist then install mvlog marker
534: select count(1) into l_exist

Line 563: log(c_module, 'ERROR', 'MV creation failed. Storing all dependent DDLs in AD_ZD_DDL_HANDLER table');

559: begin
560: exec(c_module, l_exp_mvdef);
561: exception
562: when others then
563: log(c_module, 'ERROR', 'MV creation failed. Storing all dependent DDLs in AD_ZD_DDL_HANDLER table');
564: for idx in 1..l_ddl_defs.count
565: loop
566: ad_zd_parallel_exec.load(
567: x_phase => l_phase,

Line 566: ad_zd_parallel_exec.load(

562: when others then
563: log(c_module, 'ERROR', 'MV creation failed. Storing all dependent DDLs in AD_ZD_DDL_HANDLER table');
564: for idx in 1..l_ddl_defs.count
565: loop
566: ad_zd_parallel_exec.load(
567: x_phase => l_phase,
568: x_sql => l_ddl_defs(idx),
569: x_unique => true);
570: log(c_module, 'ERROR', l_ddl_defs(idx));

Line 582: log(c_module, 'ERROR', 'Dependent object creation failed. Storing DDL in AD_ZD_DDL_HANDLER table');

578: begin
579: exec(c_module, l_ddl_defs(idx));
580: exception
581: when others then
582: log(c_module, 'ERROR', 'Dependent object creation failed. Storing DDL in AD_ZD_DDL_HANDLER table');
583: ad_zd_parallel_exec.load(
584: x_phase => l_phase,
585: x_sql => l_ddl_defs(idx),
586: x_unique => true);

Line 583: ad_zd_parallel_exec.load(

579: exec(c_module, l_ddl_defs(idx));
580: exception
581: when others then
582: log(c_module, 'ERROR', 'Dependent object creation failed. Storing DDL in AD_ZD_DDL_HANDLER table');
583: ad_zd_parallel_exec.load(
584: x_phase => l_phase,
585: x_sql => l_ddl_defs(idx),
586: x_unique => true);
587: log(c_module, 'ERROR', l_ddl_defs(idx));

Line 663: l_appsname := ad_zd.apps_schema;

659:
660: begin
661: log(c_module, 'PROCEDURE', 'begin: '||p_owner||'.'||p_mview_name);
662:
663: l_appsname := ad_zd.apps_schema;
664: l_owner := trim(nvl(p_owner, l_appsname));
665:
666: -- Check if MV exists
667: select count(1) into l_mvexist

Line 1082: l_appsname := ad_zd.apps_schema;

1078:
1079: BEGIN
1080: log(c_module, 'PROCEDURE', 'begin: '||p_owner||'.'||p_mvname);
1081:
1082: l_appsname := ad_zd.apps_schema;
1083: l_owner := trim(nvl(p_owner, l_appsname));
1084:
1085: -- Verify MVQ exists (it must)
1086: SELECT count(1)

Line 1111: delete from ad_zd_clob

1107: else
1108:
1109: log(c_module, 'STATEMENT', 'MV exists, checking definition');
1110:
1111: delete from ad_zd_clob
1112: where owner=l_owner and name in
1113: (p_mvname, get_mvq_name(p_mvname));
1114:
1115: -- Get MV query text into CLOB

Line 1116: insert into ad_zd_clob(owner, name, query)

1112: where owner=l_owner and name in
1113: (p_mvname, get_mvq_name(p_mvname));
1114:
1115: -- Get MV query text into CLOB
1116: insert into ad_zd_clob(owner, name, query)
1117: select owner, mview_name, to_lob(query)
1118: from dba_mviews
1119: where owner=l_owner and mview_name=p_mvname;
1120:

Line 1122: from ad_zd_clob

1118: from dba_mviews
1119: where owner=l_owner and mview_name=p_mvname;
1120:
1121: select query into l_mv_text
1122: from ad_zd_clob
1123: where owner=l_owner and name=p_mvname;
1124:
1125: -- Get MVQ query text into CLOB
1126: insert into ad_zd_clob(owner, name, query)

Line 1126: insert into ad_zd_clob(owner, name, query)

1122: from ad_zd_clob
1123: where owner=l_owner and name=p_mvname;
1124:
1125: -- Get MVQ query text into CLOB
1126: insert into ad_zd_clob(owner, name, query)
1127: select owner, view_name, to_lob(text)
1128: from dba_views
1129: where owner=l_owner and view_name=l_mvq_name;
1130:

Line 1132: from ad_zd_clob

1128: from dba_views
1129: where owner=l_owner and view_name=l_mvq_name;
1130:
1131: select query into l_mvq_text
1132: from ad_zd_clob
1133: where owner=l_owner and name=l_mvq_name;
1134:
1135: -- Compare query text, process if different
1136: if (dbms_lob.compare(expand_query(l_mvq_text), l_mv_text) <> 0) then

Line 1413: l_appsname := ad_zd.apps_schema;

1409: l_owner varchar2(30);
1410: begin
1411: log(c_module, 'PROCEDURE', 'begin: '||p_owner||'.'||p_mvname);
1412:
1413: l_appsname := ad_zd.apps_schema;
1414: if(length(trim(nvl(p_owner, ' '))) > 0)
1415: then
1416: l_owner := upper(trim(p_owner));
1417: else

Line 1623: ad_zd_table.ev_view_column(mvlc.column_name) as basecol

1619: select basecol, latestcol, mvlcol
1620: from
1621: (
1622: select
1623: ad_zd_table.ev_view_column(mvlc.column_name) as basecol
1624: , max(tabc.column_name) as latestcol
1625: , max(mvlc.column_name) as mvlcol
1626: from
1627: dba_tab_cols tabc

Line 1633: and ad_zd_table.ev_view_column(tabc.column_name) =

1629: where mvlc.owner = x_table_owner
1630: and mvlc.name = x_table_name
1631: and tabc.owner = mvlc.owner
1632: and tabc.table_name = mvlc.name
1633: and ad_zd_table.ev_view_column(tabc.column_name) =
1634: ad_zd_table.ev_view_column(mvlc.column_name)
1635: group by ad_zd_table.ev_view_column(mvlc.column_name)
1636: order by ad_zd_table.ev_view_column(mvlc.column_name)
1637: )

Line 1634: ad_zd_table.ev_view_column(mvlc.column_name)

1630: and mvlc.name = x_table_name
1631: and tabc.owner = mvlc.owner
1632: and tabc.table_name = mvlc.name
1633: and ad_zd_table.ev_view_column(tabc.column_name) =
1634: ad_zd_table.ev_view_column(mvlc.column_name)
1635: group by ad_zd_table.ev_view_column(mvlc.column_name)
1636: order by ad_zd_table.ev_view_column(mvlc.column_name)
1637: )
1638: where latestcol<>mvlcol;

Line 1635: group by ad_zd_table.ev_view_column(mvlc.column_name)

1631: and tabc.owner = mvlc.owner
1632: and tabc.table_name = mvlc.name
1633: and ad_zd_table.ev_view_column(tabc.column_name) =
1634: ad_zd_table.ev_view_column(mvlc.column_name)
1635: group by ad_zd_table.ev_view_column(mvlc.column_name)
1636: order by ad_zd_table.ev_view_column(mvlc.column_name)
1637: )
1638: where latestcol<>mvlcol;
1639:

Line 1636: order by ad_zd_table.ev_view_column(mvlc.column_name)

1632: and tabc.table_name = mvlc.name
1633: and ad_zd_table.ev_view_column(tabc.column_name) =
1634: ad_zd_table.ev_view_column(mvlc.column_name)
1635: group by ad_zd_table.ev_view_column(mvlc.column_name)
1636: order by ad_zd_table.ev_view_column(mvlc.column_name)
1637: )
1638: where latestcol<>mvlcol;
1639:
1640: l_first boolean := TRUE;

Line 1744: , ad_zd_mview.get_mv_name(lvv.view_name) mv_name

1740: case when lvx.status=1 then NULL else sysdate end
1741: else
1742: lvx.mtime
1743: end lv_changed
1744: , ad_zd_mview.get_mv_name(lvv.view_name) mv_name
1745: , mvo.created mv_changed
1746: from
1747: sys.obj$ lvx
1748: , ( select

Line 1788: l_stmt := 'begin '||ad_zd.apps_schema||'.ad_zd_mview.upgrade('''||

1784: -- execute cutover action
1785: upgrade(row.owner, row.mv_name);
1786: else
1787: -- store cutover action
1788: l_stmt := 'begin '||ad_zd.apps_schema||'.ad_zd_mview.upgrade('''||
1789: row.owner||''','''||row.mv_name||'''); end;';
1790:
1791: log(c_module, 'STATEMENT', 'Storing cutover action for: '||row.mv_name);
1792: ad_zd_parallel_exec.load(

Line 1792: ad_zd_parallel_exec.load(

1788: l_stmt := 'begin '||ad_zd.apps_schema||'.ad_zd_mview.upgrade('''||
1789: row.owner||''','''||row.mv_name||'''); end;';
1790:
1791: log(c_module, 'STATEMENT', 'Storing cutover action for: '||row.mv_name);
1792: ad_zd_parallel_exec.load(
1793: x_phase => ad_zd_parallel_exec.c_phase_cutover,
1794: x_sql => l_stmt,
1795: x_unique => true); /* there are channces for duplicacy */
1796:

Line 1793: x_phase => ad_zd_parallel_exec.c_phase_cutover,

1789: row.owner||''','''||row.mv_name||'''); end;';
1790:
1791: log(c_module, 'STATEMENT', 'Storing cutover action for: '||row.mv_name);
1792: ad_zd_parallel_exec.load(
1793: x_phase => ad_zd_parallel_exec.c_phase_cutover,
1794: x_sql => l_stmt,
1795: x_unique => true); /* there are channces for duplicacy */
1796:
1797: end if;

Line 1852: | Main api to be called from AD_ZD_PREP |

1848: /*+----------------------------------------------------------------+
1849: | |
1850: | UPGRADE_DB |
1851: | |
1852: | Main api to be called from AD_ZD_PREP |
1853: | |
1854: +----------------------------------------------------------------+*/
1855:
1856: procedure UPGRADE_DB(x_execute number default 1)

Line 1871: and v.view_name = ad_zd_mview.get_mvq_name(m.mview_name) )

1867: where read_only_flag in ('A', 'E', 'U', 'B') )
1868: and not exists
1869: ( select 'X' from dba_views v
1870: where v.owner = m.owner
1871: and v.view_name = ad_zd_mview.get_mvq_name(m.mview_name) )
1872: and not exists
1873: ( select 'X'
1874: from fnd_oracle_userid fou
1875: , fnd_product_installations fpi

Line 1884: ad_zd_mview.get_mv_name(v.view_name) name

1880: and aoo.object_name = m.mview_name
1881: and aoo.object_type = 'MATERIALIZED VIEW' )
1882: union
1883: select v.owner owner,
1884: ad_zd_mview.get_mv_name(v.view_name) name
1885: from dba_views v
1886: where v.view_name like '%'||'#'
1887: and v.editioning_view = 'N'
1888: and v.owner in

Line 1894: and m.object_name = ad_zd_mview.get_mv_name(v.view_name)

1890: where read_only_flag in ('A', 'E', 'U', 'B') )
1891: and not exists
1892: ( select 'X' from dba_objects m
1893: where m.owner = v.owner
1894: and m.object_name = ad_zd_mview.get_mv_name(v.view_name)
1895: and m.object_type = 'MATERIALIZED VIEW'
1896: and m.status = 'VALID' )
1897: and not exists
1898: ( select 'X'

Line 1915: ad_zd_parallel_exec.load(

1911: for obj in c_mvs loop
1912: if (x_execute = 1) then
1913: upgrade(obj.owner, obj.name);
1914: else
1915: ad_zd_parallel_exec.load(
1916: ad_zd_parallel_exec.c_phase_upgrade_mview,
1917: 'begin '||ad_zd.apps_schema||'.ad_zd_mview.upgrade('''||
1918: obj.owner||''','''||obj.name||'''); end;');
1919: end if;

Line 1916: ad_zd_parallel_exec.c_phase_upgrade_mview,

1912: if (x_execute = 1) then
1913: upgrade(obj.owner, obj.name);
1914: else
1915: ad_zd_parallel_exec.load(
1916: ad_zd_parallel_exec.c_phase_upgrade_mview,
1917: 'begin '||ad_zd.apps_schema||'.ad_zd_mview.upgrade('''||
1918: obj.owner||''','''||obj.name||'''); end;');
1919: end if;
1920: end loop;

Line 1917: 'begin '||ad_zd.apps_schema||'.ad_zd_mview.upgrade('''||

1913: upgrade(obj.owner, obj.name);
1914: else
1915: ad_zd_parallel_exec.load(
1916: ad_zd_parallel_exec.c_phase_upgrade_mview,
1917: 'begin '||ad_zd.apps_schema||'.ad_zd_mview.upgrade('''||
1918: obj.owner||''','''||obj.name||'''); end;');
1919: end if;
1920: end loop;
1921:

Line 1950: l_appsname := ad_zd.apps_schema;

1946: l_lv_name varchar2(30);
1947: l_appsname varchar2(30);
1948: l_defer_stmt varchar2(2000);
1949: begin
1950: l_appsname := ad_zd.apps_schema;
1951: l_mv_owner := trim(nvl(x_mview_owner, l_appsname));
1952: log(C_MODULE, 'PROCEDURE', 'begin: '|| l_mv_owner ||'.'||x_mview_name);
1953:
1954: -- Drop Logical view pointing to the materialized view

Line 1955: ad_zd_mview.drop_mvq(l_mv_owner, x_mview_name);

1951: l_mv_owner := trim(nvl(x_mview_owner, l_appsname));
1952: log(C_MODULE, 'PROCEDURE', 'begin: '|| l_mv_owner ||'.'||x_mview_name);
1953:
1954: -- Drop Logical view pointing to the materialized view
1955: ad_zd_mview.drop_mvq(l_mv_owner, x_mview_name);
1956:
1957: -- (Deferred) drop materialized view logic
1958: if ad_zd.get_edition_type = 'RUN' then
1959: -- Drop materialized view

Line 1958: if ad_zd.get_edition_type = 'RUN' then

1954: -- Drop Logical view pointing to the materialized view
1955: ad_zd_mview.drop_mvq(l_mv_owner, x_mview_name);
1956:
1957: -- (Deferred) drop materialized view logic
1958: if ad_zd.get_edition_type = 'RUN' then
1959: -- Drop materialized view
1960: log(c_module, 'EVENT', 'Drop MV '||l_mv_owner||'.'||x_mview_name);
1961: begin
1962: exec(c_module, x_drop_stmt);

Line 2003: ad_zd.load_ddl ('CLEANUP', l_defer_stmt);

1999: l_defer_stmt := 'begin execute immediate '''|| regexp_replace(x_drop_stmt, '''', '''''') || '''; ' ||
2000: 'execute immediate ''' || regexp_replace(x_upd_stmt, '''', '''''') ||
2001: '''; exception when others then null; end;';
2002:
2003: ad_zd.load_ddl ('CLEANUP', l_defer_stmt);
2004: else
2005: ad_zd.load_ddl ('CLEANUP', x_drop_stmt);
2006: end if;
2007:

Line 2005: ad_zd.load_ddl ('CLEANUP', x_drop_stmt);

2001: '''; exception when others then null; end;';
2002:
2003: ad_zd.load_ddl ('CLEANUP', l_defer_stmt);
2004: else
2005: ad_zd.load_ddl ('CLEANUP', x_drop_stmt);
2006: end if;
2007:
2008: -- Return 'N' as the table object is not deleted yet.
2009: X_DROPPED := 'N';

Line 2016: END AD_ZD_MVIEW;

2012: log( c_module, 'PROCEDURE', 'end');
2013: commit;
2014: end DROP_MV;
2015:
2016: END AD_ZD_MVIEW;