Oracle Apps R122 - ADO
Oracle Apps R122 - ADO
[email protected]
blog.trutek.com
Latest Book
Sponsored by
ePrentise
by Mike Swing
2
Online Patching
• All EBS patches for Release
12.2 and beyond are Online
Patches
• Online Patching of code is
enabled by the Dual File
System and 11gR2 Database
Editioning features
Run Edition
• Online Patching of
transactional tables is
enabled by Editioning Views
and Cross-Edition Triggers
• The Patch Edition becomes Patch Edition
the Run Edition at Cutover
3
R12.2 Online Patching
https://blogs.oracle.com/stevenChan/entry/
glimpses_of_e_business_suite
4
Best Practices with ADOP
• During the prepare phase, use the option sync_mode=delta
(rsync)
• Before a cutover manually stop the concurrent managers
• Use shared disk for the apps tier
• Don’t use the hotpatch option unless the patch is really a
hotpatch
• Use ad_zd.grant_privs to avoid invalid object swarms
• If after running finalize, while waiting to run cutover you
want to apply more patches, you can. After, run finalize,
cutover and cleanup.
• Don’t apply customizations during an ADOP session
• Don’t run AutoConfig during an ADOP session
Editioned Database Objects
Editioned Database Objects may have a different
definition in each database edition.
Editioned database object types are:
View (Ordinary)
PL/SQL Package
PL/SQL Trigger
User-Defined Type (Editioned)
Synonym
Virtual Private Database Policy
Non-Editioned Objects can’t refer to
an Editioned Object
Non-Editioned Objects include tables,
materialized views, database links, partitions,
etc.
Editioned objects should go in the APPS schema
and
Non-editioned objects should go in the APPS_NE
schema.
Custom non-editioned objects should go in the
XXCUST_NE schema
Effectively-Editioned Database
Objects
Tables and Materialized Views
10
Deploying Custom Code
• Apply customizations as an online patch: The custom
code is patched into the patch edition when an online
patching cycle is open. This is the most recommended
approach but requires compliance to the full set
development standards.
• Apply customizations as a downtime patch: The
custom code is patched into the run edition, either
during an extended online patching cutover downtime,
or as a separate downtime patch.
• Hot Patching of Custom Code is Explicitly Discouraged.
Materialized Views
• The Materialized View is a non-editioned object type,
and therefore a materialized view cannot directly
reference editioned objects.
• To avoid this limitation, Oracle E-Business Suite Online
Patching technology implements a new Effectively
Editioned Materialized View compound object.
• Application developers create and maintain the
Materialized View Definition (query) in an ordinary
view.
• The Online Patching technology then automatically
maintains a corresponding Materialized View
Implementation that is legal for editioned databases.
12
DB Links & Materialized Views
• DB Links & Materialized Views are currently
not editionable
• Objects of an editionable type are not
editionable when used by a non-editionable
object
13
Data Dictionary Views
DBA_ALL_EDITIONS – editions in the database
DBA_ALL_OBJECTS – objects (inherited) in
current edition
DBA_ALL_OBJECTS_AE – actual objects across all
editions
Invalid Objects by Edition
select count(*) from dba_objects where
status='INVALID'
and edition_name = SYS_CONTEXT('USERENV',
'CURRENT_EDITION_NAME');
To view objects in all editions, add _ae to the
data dictionary views:
select * from dba_objects_ae;
15
DBA_OBJECTS, DBA_OBJECTS_AE,
AD_OBJECTS
DBA_OBJECTS shows object information for the current
edition, but the STATUS column in this view may show the
object as VALID even if the object actually needs to be
compiled before use.
AD_OBJECTS shows the correct status for each object visible in the
current edition.
It also shows whether the object is “actual” (a real object) in the current
edition, or a "stub" object (the object definition was inherited from a
previous edition).
33
AD_ZD_TABLE.PATCH
• Whenever you directly alter the structure of a table,
you must call the AD_ZD_TABLE.PATCH procedure.
• The PATCH procedure looks at the physical table
columns and then generates the editioning view
which presents the logical columns for that table.
• The PATCH procedure is called automatically when
applying table structure changes using XDF or ODF.
exec ad_zd_table.patch('APPLSYS',
'XYZ_USER_SERVICE')
Editionable Objects
The following object types are editionable:
• FUNCTION
• LIBRARY
• PACKAGE and PACKAGE BODY
• PROCEDURE
• TRIGGER
• TYPE and TYPE BODY
• SYNONYM
• VIEW
Effectively-Editioned Objects
These object types are non-editioned at the database level, meaning
they have a single definition that is visible to all database editions.
But for each object in this category, the Online Patching tools
implement special support so that the object can be patched without
impacting the running application.
New restrictions and standards apply to each effectively-editioned
object type.
The following object types are covered:
Table (Ordinary)
Seed Data Table
Seed Data Loader
Index
Integrity Constraint
Materialized View
Migrate to Editioning Views
1. Rename Table (for example to old table name_BASE)
2. Constraints continue to refer to the table
3. Create the Editioning View with the old table name
4. Using ‘CREATE OR REPLACE EDITIONING VIEW
5. Reroute privileges – grant on view rather than table
6. Recompile the triggers on the table
7. These now become triggers on the Editioning View
8. Recompile all invalid PL/SQL program units and Views
9. They now refer to the Editioning View instead of the table
10. VPD policies are reassigned to the View
11. Regular auditing and FGA is on the table
37
AD_ZD_TABLE.UPGRADE
Upgrade the table for Online Patching using the
AD_ZD_TABLE.UPGRADE procedure.
This will generate an Editioning View (EV) for the
table and then create an APPS synonym that points
to the Editioning View.
exec ad_zd_table.upgrade('APPLSYS', 'XXX_CUST')
The table is now ready for use from the APPS
schema. The generated EV is named XXX_CUST#
and looks exactly like the table at this point.
Forward Cross Edition Triggers
You might need to update an existing logical column
either to:
• Change the column definition (data type, data
length, not null constraint)
• Change the column data (how data is stored in
the column)
To update existing data without disturbing the
running application we must create a new
physical column (called a revised column) to hold
the updated data.
Cross Edition Triggers
• If you remove a (mandatory) column from the
current Editioning View…
– a Reverse Cross-edition Trigger ensures that new
records get some value in that (invisible) column
• If you add a (mandatory) column to the table
(and the current Editioning View)…
– a Forward Cross-edition Trigger ensures that
records DMLed through previous Editioning View
versions are made valid
40
ADZDDBCC.sql and gscc.pl
• You must ensure your custom code complies with the
new standards that ensure the relevant database
objects and code can successfully be patched online.
• Use the tools provided to review your customizations
for violations of EBS Online Patching standards:
• Database Standards Checker (ADZDDBCC.sql) - This
utility scans the data dictionary for objects and code
that violate the standards.
• File system check report (gscc.pl) - This script scans the
file system for source files that violate the standards.
41
Online Patching standards
Be aware that any custom code may need updating in
preparation for an upgrade to R 12.2.n, so that it is
compliant with Online Patching standards.
Prior to upgrading to R12.2.n the following must be run early
in the planning cycle:
• Online Patching Readiness Report to identify issues in
custom database objects that will be fixed automatically Vs
needing manual intervention.
• Manual Fix Readiness Report.
• Global Standards Compliance Checker script. Address errors
that are reported by this script
• Online Patching Database Compliance Checker. Fix any
violations of development standards listed in this report.
42
Check the Edition
• echo $FILE_EDITION
43
Check the Edition
• echo $RUN_BASE
• echo $PATCH_BASE
• echo $NE_BASE
Online Patching
45
Example of ADOP Patching Cycle
$ . <EBS_ROOT>/EBSapps.env run
$ adop phase=prepare
$ adop phase=apply patches=123456
$ adop phase=finalize
$ adop phase=cutover
$ . <EBS_ROOT>/EBSapps.env run
$ adop phase=cleanup
46
Customize the Patch Edition
Before running finalize_mode
47
Hot Patching Customizations
“An approach that explicitly discouraged is hot
patching of customizations. Applying custom
changes to the run edition of the system while the
system is online carries the risk of causing large
chain reaction invalidation of objects in the
dependency tree of whatever is getting patched.
This can cause runtime failure in user sessions, and
the code may temporarily be in an inconsistent
state which can lead to data corruption, runtime
exceptions, or other unexpected behavior while
the patch is being applied.”
Forward Cross Edition Triggers
You might need to update an existing logical column
either to:
• Change the column definition (data type, data
length, not null constraint)
• Change the column data (how data is stored in
the column)
To update existing data without disturbing the
running application we must create a new
physical column (called a revised column) to hold
the updated data.
Data is updated in the Patch Edition
during Patching
51
Reverse Cross Edition Triggers
• The reverse cross-edition trigger only fires
when the table contents is changed from the
patch edition (such as during seed data
loading).
Example of installing a new PL/SQL
package via a Manual Patch
$ source /u01/R122_EBS/EBSapps.env patch
$ cd $PATCH_TOP/manual_patch
$ copy_files.sh
cp fnd/patch/115/sql/* $FND_TOP/patch/115/sql
$ manual_db_steps.sh
sqlplus apps/apps
@$FND_TOP/patch/115/sql/XXX_CUST_S.pls
sqlplus apps/apps
@$FND_TOP/patch/115/sql/XXX_CUST_B.pls
Confirm Manual Patch Changes
$ source /u01/R122_EBS/EBSapps.env patch
$ sqlplus apps/apps
SQL> show errors package XXX_CUST
SQL> show errors package body XXX_CUST
SQL> quit
Run Manual Patch Phases
• Finalize
$ adop phase=finalize
• Cutover
$ adop phase=cutover
$ source /u01/R122_EBS/EBSapps.env run
• Cleanup
$ adop phase=cleanup
Manually copy the three .txt files from the 3636980\izu\admin directory to
your own temporary directory.
Run AD Splice
Run ADSPLICE
AD Splice must be run from the admin directory under APPL_TOP, and is invoked
by running the command:
$ adsplice
When prompted for the following, you can press Enter to accept the default
location:
Enter the directory where your AD Splicer control file is located.
The default directory is [/oracle/VIS/apps/apps_st/appl/admin] :
When prompted for the following, you can press Enter to accept the default
filename:
Please enter the name of your AD Splicer control file [newprods.txt] :
When prompted for the following, you can press Enter to accept the default value
and regenerate the environment file:
Do you wish to regenerate your environment file [Yes] ?
2. Run the following SQL to check the product installations table has one
row for your custom product:
SQL>select * from fnd_product_installations where APPLICATION_ID =
50201;
This statement should return one row only.
68
Deploying Custom Files
• Connect to the run edition file system on your development
environment.
• Copy the custom files to the appropriate directory on the run
edition file system.
• If you copied any custom files under the $JAVA_TOP directory, run
the adcgnjar utility to generate and sign a JAR file containing these
files. When prompted, enter the user name and password of the
APPS user.
• If necessary, use the appropriate utility for your product or
component to upload the custom files to the database.
• Add entries for the custom files to the custom synchronization
driver file to ensure that the adop utility synchronizes these files
between the run file system and the patch file system the next time
you run the prepare phase.
Deploying Custom Files
• Connect to the run edition file system on your development
environment.
• Copy the custom files to the appropriate directory on the run
edition file system.
• If you copied any custom files under the $JAVA_TOP directory, run
the adcgnjar utility to generate and sign a JAR file containing these
files. When prompted, enter the user name and password of the
APPS user.
• If necessary, use the appropriate utility for your product or
component to upload the custom files to the database.
• Add entries for the custom files to the custom synchronization
driver file to ensure that the adop utility synchronizes these files
between the run file system and the patch file system the next time
you run the prepare phase.
Deploying Custom Files
• Connect to the run edition file system on your development
environment.
• Copy the custom files to the appropriate directory on the run
edition file system.
• If you copied any custom files under the $JAVA_TOP directory, run
the adcgnjar utility to generate and sign a JAR file containing these
files. When prompted, enter the user name and password of the
APPS user.
• If necessary, use the appropriate utility for your product or
component to upload the custom files to the database.
• Add entries for the custom files to the custom synchronization
driver file to ensure that the adop utility synchronizes these files
between the run file system and the patch file system the next time
you run the prepare phase.
Step 1: Create or Replace Editioned
Database Objects
• Step 1: Create or Replace Editioned Database Objects in
your development database
• If your application changes will cause significant object
invalidation in the development database, you may wish to
call the "ad_zd.compile" procedure to recompile invalid
objects in the run edition.
• Due to a database limitation the user_objects or all_objects
dictionary views only return correct object status after
running a full compilation procedure
(utl_recomp.recomp_parallel or ad_zd.compile).
• As a workaround, you can check object status using the
ad_objects view included with online patching.
select * from ad_objects where status='INVALID';
Step 2: Create the patch
$ cd $PATCH_TOP/manual_patch
$ vi copy_files.sh
Insert the following:
cp fnd/patch/115/sql/* $FND_TOP/patch/115/sql
$ vi manual_db_steps.sh
Insert the following:
sqlplus apps/apps
@$FND_TOP/patch/115/sql/XXX_CUST_S.pls
sqlplus apps/apps
@$FND_TOP/patch/115/sql/XXX_CUST_B.pls
Hot Patching of Customizations
• An approach that explicitly discouraged is hot patching
of customizations. Applying custom changes to the run
edition of the system while the system is online carries
the risk of causing large chain-reaction invalidation of
objects in the dependency tree of whatever is getting
patched.
• This can cause runtime failure in user sessions, and the
code may temporarily be in an inconsistent state which
can lead to data corruption, runtime exceptions, or
other unexpected behavior while the patch is being
applied.
Full vs Runtime Compliance
• Full compliance with all standards in this section
enable a product to support both correct runtime
operation and online patching in an Oracle E-
Business Suite Release 12.2 environment.
• Runtime compliance is a subset of the full
standards that allows a product operate correctly
in the Oracle E-Business Suite Release 12.2
runtime, but without supporting online patching
of the product itself.
Full vs Runtime Compliance
• A product that only implements runtime
compliance must be patched using downtime
patching. Oracle E-Business Suite products are
required to implement full compliance, but
custom or third-party products have the
option to only implement the runtime
compliance subset. Runtime compliance
standards are marked with a [minimal] tag.
Full vs Runtime Compliance
• Note: These standards only apply to objects
and data that are directly managed by
application developers.
• The database may generate internal/hidden
tables, indexes, types, and other objects to
implement certain higher level features.
• These development standards do not apply to
these generated objects.
DBCC Violations
Minimal Compliance
Minimal Compliance
These checks represent the minimum
requirement for correct operation of E-
Business Suite Release 12.2.
Do not attempt to operate the system if there
are P1 minimal compliance violations.
no rows selected
SECTION-4 [minimal]
"EBS_LOGON Trigger must be enabled."
no rows selected
SECTION-5 [minimal]
"The database initialization parameter
_system_trig_enabled must be set to TRUE."
no rows selected
SECTION-6 [minimal]
"'ADMINISTER DATABASE TRIGGER' privilege must
not be granted to APPS."
no rows selected
SECTION-7 [minimal]
"'EXEMPT ACCESS POLICY' privilege must not be
granted to APPS."
no rows selected
SECTION-8 [minimal]
"Object must be VALID."
no rows selected
SECTION-13 [minimal]
"Table Trigger must be on the editioning view, not the table, if the editioning
view exists."
- P2: These triggers may operate incorrectly once the table is patched with
revised columns.
- If the trigger is needed, move it to the editioning view by calling the table
upgrade procedure.
SQL> exec ad_zd_table.upgrade(table_owner, table_name)
Note: If the trigger table is a custom table that will not be patched using
online patching, then this violation can be ignored.
no rows selected
SECTION-14 [minimal]
"Table Synonym must point to the editioning view, not the table, if
the editioning view exists."
no rows selected
SECTION-15 [minimal]
"Synonym must point to an object."
- P2: These VPD policies may operate incorrectly once the table is patched with
revised columns.
Note: If the VPD table is a custom table that will not be patched using online patching,
then this violation can be ignored.
no rows selected
SECTION-25 [minimal]
"Column Type should not be ROWID."
no rows selected
SECTION-26 [minimal]
"Query/DML statements must access tables via
the APPS table synonym."
- P2: These objects may operate incorrectly after
the referenced table has been patched.
- Fix: Change the object to reference tables via
the APPS table synonym.
SECTION-34 [minimal]
"Index Must be usable."
no rows selected
SECTION-40 [minimal]
"Materialized View name must be unique within
the first 29 bytes."
no rows selected
SECTION-41 [minimal]
*
"Materialized View (MV) must have a corresponding Logical View (MV#)."
- P1: These MVs did not upgrade correctly and are non-functional. This can happen if
the MV query is not a legal ordinary view query.
- Fix: Recreate the MV using the AD_MV.CREATE_MV procedure.
- Unneeded MVs can be ignored but should be dropped.
Note: This check is only active after Online Patching Enablement.
#
OWNER MVIEW_NAME
---------------- ------------------------------
APPS XXSCP_MTL_PARAMETERS_TEST
APPS XXSCP_TEST_MV
APPS XXSCP_TEST_MV1
SECTION-42 [minimal]
*
"Logical View (MV#) must have a corresponding Materialized View (MV)."
- P1: These MVs did not upgrade correctly and are non-functional. This is
likely because the MV query references an editioned PL/SQL function.
- Fix: create the MV according to development standards using the
AD_MV.CREATE_MV procedure.
- Unneeded MVs can be ignored but should be dropped.
#
OWNER VIEW_NAME
---------------- -----------------------------------------------
APPS XXSCP_SS_PLNR_BUYER_MV#
SECTION-43 [minimal]
"Object name must not match any E-Business
Suite schema name."
- P1: Online Patching will not allow execution until the until
the this manual step is completed. See My Oracle Support
Knowledge Document 1594274.1 for further information.
NODE_NAME PATCH_CHECKER_MESSAGE
------------------------------ ---------------------------------
ascp-uat-vm-db01 All required database bug fixes
have been applied to this node
SECTION-46 [minimal]
"If Online Patching has been enabled, the
EBS_PATCH service must be running."
- P2: If the latest package version is not installed then dynamic SQL
executed in the schema might fail.
- Fix: Create the APPS_DDL spec and body in the listed schemas by
running the installation scripts.
sqlplus <username>/<password> @
$AD_TOP/patch/115/sql/adaddls.pls
sqlplus <username>/<password> @
$AD_TOP/patch/115/sql/adaddlb.pls
no rows selected
DBCC Full Compliance
Full Compliance [full]
These checks indicate whether an object can be
patched using Online Patching.
Objects which do not meet full compliance may
have limitations in how they can be patched, or
may need to be patched using downtime
patching.
Full compliance also requires that all minimal
compliance checks are passed.
Custom code that will only be patched using
downtime patching does not need to meet the
full compliance level.
SECTION-10 [full]
"APPS object names must end with alphanumeric character."
no rows selected
SECTION-12 [full]
"Editioning view must have table."
no rows selected
SECTION-17 [full]
"Table name must not end with '#' character."
- P2: The '#' character in table and view names is reserved for
use by the Online Patching tools. Online patching may not
operate correctly on tables that violate this standard.
- Fix: Rename the table and correct any code references to the
new table name.
#
no rows selected
SECTION-18 [full]
"Table name must be unique within the first 29 bytes."
no rows selected
SECTION-19 [full]
"Table must be owned by an EBS product schema, not APPS.“
- Note: An unused table can be ignored or dropped. Tables that are managed
dynamically by application runtime can be ignored.
TABLE_NAME
------------------------------
ABC1
ABC_DEF
ABC_TEST
SECTION-20 [full]
“Table must have an editioning view."
Note: Tables that are dynamically created by application runtime can be ignored.
Note: Tables that end with "_A" are typically audit tables by the Audit Trail feature, and can be ignored.
Note: This check is only active after Online Patching Enablement.
OWNER TABLE_NAME
---------------- ------------------------------
XXSCP ITEM_PC_BACKUP_2906
XXSCP MSC_SOURCING_RULES_BKUP
SECTION-21 [full]
"Base column name can only use '#' as the last character."
- P2: These columns will not show correctly in the editioning view.
- Fix: Rename the column
no rows selected
SECTION-22 [full]
SECTION-22 [full]
"Base column name must be unique within 28 bytes."
- P3: these columns cannot be revised using the same logical name during online patching.
- Fix violations by renaming the column to a shorter base name.
- Fixes can be deferred until there is a reason to patch the column. Unused columns can be ignored.
Note: This check only works after Online Patching Enablement.
- Note: The LONG-to-CLOB datatype change should be implemented before Online Patching
Enablement.
- Note: If you alter the column type via 'ALTER TABLE' DDL (instead of using using XDF/ODF) you will
need to rebuild indexes on the affected table manually.
- Note: Changing a LONG to CLOB will cause any trigger that references the CLOB column in the "UPDATE
OF" clause of a trigger to go invalid. Fix this by referencing the table in the "ON" clause of the
trigger
- Unused LONG columns can be ignored, but should be dropped.
#
Internal Checks
Internal Checks
This report also implements a number of internal
checks which verify that the upgrade and Online
Patching Enablement process executed correctly.
Violations of internal checks indicate upgrade
failure and should be reviewed with support if the
cause is not understood.
For further information about development
standards, review the Online Patching Development
Standards chapter of the Oracle E-Business Suite
R12.2 Developer Guide R12.2, and My Oracle
Support document 1577661.1.
Internal Checks
SECTION-11 [internal]
*
"APPS_NE Object must not also exist in APPS."
# no rows selected
Internal Checks
SECTION-23 [internal]
*
"Column Type must be a built-in type or non-editioned User Defined Type."
- Check for related errors in the Online Patching Enablement error log.
#
1 row selected.
Internal Checks
SECTION-27 [internal]
*
"AQ table must NOT have an editioning view."
#
no rows selected
Internal Checks
SECTION-28 [internal]
*
"Seed data table must have standard ZD_EDITION_NAME column."
- P2: failed upgrade of seed data table, do not use until corrected.
- ZD_EDITION_NAME column must be VARCHAR2(30) NOT NULL
- Check ad_zd_logs for related messages
#
no rows selected
Internal Checks
SECTION-29 [internal]
*
"Seed data table must have a maintenance trigger."
no rows selected
Internal Checks
SECTION-30 [internal]
*
"Seed data table must have a VPD policy on the EV."
no rows selected
Internal Checks
SECTION-31 [internal]
*
"Seed data table must have a VPD policy function."
no rows selected
MOS Note 1577661.1
Developing and Deploying Customizations in Oracle
E-Business Suite Release 12.2
example:
exec ad_zd_seed.prepare('WF_MESSAGES');
$AD_TOP/sql/ADZDSHOWEV.sql XXX_CUST
-- EV Column Mapping
VIEW_COLUMN -> TABLE_COLUMN
--------------------------- ---- -------------------
ID = ID
TYPE = SERVICE_TYPE
DESC = DESC
AD_ZD.GRANT_PRIVS
This procedure allows a developer to grant
privileges on Oracle E-Business Suite objects
without causing object invalidation.
There are occasions where you might want to grant
privileges to objects in the APPS schema; for
example, you might want to create a database user
with read-only privileges.
However, due to the way that editioned objects are
treated, granting a privilege on an editioned object
directly may cause temporary invalidation of any
dependent objects.
AD_ZD.GRANT_PRIVS
To avoid such invalidation, use the procedure
AD_ZD.GRANT_PRIVS:
procedure GRANT_PRIVS( X_PERMISSIONS in
VARCHAR2,
X_OBJECT_NAME in VARCHAR2,
X_GRANTEE in VARCHAR2,
X_OPTIONS in VARCHAR2 default
NULL);
end;
Synonyms
• Most APPS synonyms are automatically created
by the adop patching tool. Do not create, modify,
or drop automatically managed synonyms unless
directed by this standard.
• A table synonym must point to the editioning
view, not the table, if the editioning view exists.
(dbcc: SECTION-14) [minimal]
• A synonym must point to an object. (dbcc:
SECTION-15)[minimal]
• Do not create public synonyms.
Materialized View
An effectively-editioned Materialized View includes both a
Logical View (managed by the developer) and a Materialized
View (generated by Online Patching).
The Logical View is an ordinary database view, and is therefore
an editioned object that can be changed in the Patch Edition
without affecting the Run Edition.
But the generated Materialized View is a non-editioned
object, meaning the definition and content of the materialized
view is shared across all editions.
In order to avoid breaking the running application during an
online patch, the system must defer materialized view
regeneration until the cutover phase, when the application is
down.
Materialized View
During online patching, materialized view
regeneration happens automatically during the
cutover phase whenever the materialized view
implementation is out-of-date with respect to the
Logical View.
A materialized view implementation becomes out-
of-date if the Logical View is patched anything
which the Logical View depends on is patched or
recompiled any seed data table the materialized
view depends on is prepared for loading new
content in the patch edition
Materialized View
Materialized view cutover processing will take care
to avoid regenerating materialized views unless
there is an actual change required in the MV
implementation.
When regenerating the MV implementation, the
system will try to preserve the existing MV
container table (with its data), but if the shape of
the container table must change, then the
container table is dropped and recreated
automatically.
AD_ZD_MVIEW.UPGRADE
• To change the definition of a materialized view, you
first replace the definition of the corresponding logical
view in your development database.
• This is done using SQL DDL as usual.
• In this example, we create a new view that our MV
definition will reference, and then update the
XYZ_SCHEMAS_MV# Logical View to use the new view.
• When you are satisfied with the results of the updated
Logical View, remember to call the
AD_ZD_MVIEW.UPGRADE procedure to regenerate
materialized view implementation.
Generate the Materialized View
On an editioned database, materialized views are
generated from their corresponding logical views using
the AD_ZD_MVIEW.UPGRADE procedure.
exec ad_zd_mview.upgrade('APPS', 'XYZ_SCHEMAS_MV')
In this example, the UPGRADE procedure detects that
materialized view is missing and generates it from the
Logical View.
The Materialized View definition is generated by
transforming the Logical View query into an equivalent
implementation query that directly references the
underlying tables and columns.
Generate the Materialized View
You can see the resulting MV implementation objects using the
"ADZDSHOWMV" utility script:
??????????????