We are upgrading our Oracle e-Business Suite from 12.1.3.6 to 12.2.3.
This is a preparatory session prepared for our Development Team and may be useful to others. All copyrights reserved; no reproduction without permission.
AUS_R12_2_for_Developers_@jhlui1 (PDF Link)
Contents Outline:
- R12.2 Overview For Developers
- May 5, 2014
- James H. Lui, OCP
- Sr. Oracle Applications DBA
- @jhlui1
What’s Covered
- What’s an Edition?
- What’s an Online Patch?
- How is Development Affected?
- Examples
- What Can I Do?
What’s an Edition? (Doc ID 1489116.1)
- An edition is like a workspace or private environment where database objects are redefined. When we are satisfied with the change that we have made, those changes in the edition can be then rolled out to all the application users.
- With Edition-Based Redefinition you can have two objects with the same name, as long as they are in different Editions.
- An edition is effectively a version label that can be assigned to all editionable objects in a schema.
–When a new edition is used by a schema, all editionable objects are inherited by the new edition from the previous edition.
–These objects can subsequently then be altered or dropped as desired, but doing so will stop the inheritance of that object.
–From Oracle database 11gR2 onwards, each database has at least one edition, the default being ORA$BASE.
–The default edition can be displayed using the DATABASE_PROPERTIES view.
<illustration>
What Objects Can Be Editioned?
- (Doc ID 1489116.1)
- <illustration>
The following object types are editionable:
- FUNCTION
- LIBRARY
- PACKAGE and PACKAGE BODY
- PROCEDURE
- TRIGGER
- TYPE and TYPE BODY
- SYNONYM
- VIEW
Review contents of the APPS versus APPS_NE schemas for detai
What are The Rules for Editioning?
- (Doc ID 1489116.1 – there are more…)
A non-editionedobject cannot depend on an editioned object.
Some examples:
– A public synonym cannot refer to an editioned object.
(why APPS-owned synonyms take precedence)
– A function-based index cannot depend on an editioned function.
– A materialized view cannot depend on an editioned view.
(why a lot of MV’s are invalidated in 12.2)
– A table cannot have a column of a user-defined data type (collection or Abstract Data Type/ADT) whose owner is editions-enabled (APPS is, APPS_NE isn’t.)
– A noneditioned subprogram cannot have a static reference to a subprogram whose owner is editions-enabled.
(APPS_NE.<package> cannot reference APPS.<function>)
Editioning Example: PTCHARMK
- (adop phase=prepare in-progress)
- SQL Statement which produced this data:
- SELECT * FROM dba_editions;
- <illustration>
- What’s an Edition? (Doc ID 1489116.1)
- SELECT property_value
FROM database_properties
WHERE property_name = ‘DEFAULT_EDITION’;
<illustration> - ALTER SESSION SET edition=V_20140428_1435;
<illustration>
- SELECT SYS_CONTEXT(‘USERENV’, ‘SESSION_EDITION_NAME’) AS edition FROM dual;
<illustration>
What’s an Online Patch?(Doc ID 1583902.1)
- Online patching is a new patching mechanism that allows the application of patches while the system is up and running, and the users are working as normal (…while ensuring object version consistency.)
- What are the phases that make up the Online Patching cycle?
–Prepare a virtual copy (patch edition) of the running application (run edition).
–Apply patches to the patch edition of the application.
–Finalize the system in readiness for the cutover phase.
–Cutover to the patch edition and make it the new run edition.
–Cleanup obsolete definitions or data to recover space.
- When a patch is applied, adop will:
–Synchronizethe contents of the run file system to the patch file system. (phase=prepare)
–Apply patching actions on the patch file system. (phase=apply)
–During the cutover phase, the adoputility (phase=cutover) :
- Restartsthe application tier services.
- Swap [Patch FS] <-> [Run FS]
Online Patching: Our Filesystem (note: we moved the $INST_TOP down a level from /u01 to facilitate preservation as a separate NFS mount during refreshes)
- /u01
–fs1/
–fs2/
–fs_ne/
–inst/
–oraInventory/
- Online Patching: The Environment
<illustration>
Online Patching: Switching Envs(Doc ID 1545584.1 – Requires 12.2.2 minimum)
Change directory to the Base directory and run script EBSapps.env giving “run” or “patch” as argument, eg:
cd /u01/oracle/EBS122
. ./EBSapps.env run
E-Business Suite Environment Information
—————————————-
RUN File System : <EBS base dir>/fs1/EBSapps/appl
PATCH File System : <EBS base dir>/fs2/EBSapps/appl
Non-Editioned File System : <EBS base dir>/fs_ne
DB Host: <hostname.domain name> Service/SID: <SID>
Sourcing the RUN File System …
Online Patching: Switching Envs(Doc ID 1545584.1 – for PTCHARMK at 12.2.0)
Use fsauto<SID>.sh(already included in the applptch .profile)
cd ~
. ./fsauto${ORACLE_SID}.sh
Running fsauto 1.0 :
Context Name (<SID_host>) : PTCHARMK_aburpaofinm01
RUNEdition APPL_TOP : /u01/fs1
PATCHEdition APPL_TOP : /u01/fs2
APPL_TOP environment file : /u01/fs1/EBSapps/appl/APPSPTCHARMK_aburpaofinm01.env
Non-Editioned File System : /u01/fs_ne/EBSapps/appl
Instance Top Directory : /u01/inst/fs1/inst/apps/PTCHARMK_aburpaofinm01
Admin Scripts Home : /u01/inst/fs1/inst/apps/PTCHARMK_aburpaofinm01/admin/scripts
Setting RUN Edition APPL_TOP environment for /u01/fs1 …
Current PATCH_TOP: /mnt/nfs/ebs/122postinstall
applptch@aburpaofinm01 $>
What’s an Online Patch?
- (Checking for Active Patching Sessions)
- SELECT ADOP_SESSION_ID,
- PREPARE_STATUS,
- APPLY_STATUS,
- FINALIZE_STATUS,
- CUTOVER_STATUS,
- CLEANUP_STATUS,
- ABORT_STATUS,
- STATUS,
- ABANDON_FLAG,
- NODE_NAME
- FROM AD_ADOP_SESSIONS
- ORDER BY ADOP_SESSION_ID;
What’s an Online Patch?
- (Why should I care?)
Q: Based on the below information querying the AD_ADOP_SESSIONS table in PTCHARMK:
<illustration>
- Which patching session will go first, and when?
- Which filesystem (fs1 or fs2) and edition is Run versus Patch?
- Where should my custom object/code/form/report go to test in this instance?
<illustration>
- What’s an Online Patch?
(Why should I care?)
Q: Based on the below information querying the AD_ADOP_SESSIONS table in PTCHARMK:
- Which patching session will go first, and when?
- Which filesystem and edition is Run versus Patch?
- Where should my custom object/code/form/report go to test in this instance?
<illustration>
Examples: Editioned View
(Why we use APPS.AR_DEBUGinstead of AR.AR_DEBUG)
/* ObjName | ObjType | ObjParent | ObjOwner
AR_DEBUG | TABLE | | AR
AR_DEBUG# |VIEW | | AR
AR_DEBUG | SYNONYM | | APPS
Synonym APPS.AR_DEBUG */
/* Formatted on 5/1/2014 3:26:22 PM (QP5 v5.256.13226.35510) */
CREATE OR REPLACE FORCE EDITIONING VIEW AR.AR_DEBUG#
(
DEBUG_TYPE,
ITEM_TYPE,
ITEM_KEY,
ACTIVITY_NAME,
EXECUTION_DATE,
DEBUG_MESSAGE
)
AS
SELECT DEBUG_TYPE DEBUG_TYPE,
ITEM_TYPE ITEM_TYPE,
ITEM_KEY ITEM_KEY,
ACTIVITY_NAME ACTIVITY_NAME,
EXECUTION_DATE EXECUTION_DATE,
DEBUG_MESSAGE DEBUG_MESSAGE
FROM “AR”.”AR_DEBUG”;
CREATE OR REPLACE SYNONYMAPPS.AR_DEBUGFOR AR.AR_DEBUG#;
GRANT DELETE, INSERT, SELECT, UPDATE, DEBUG ON AR.AR_DEBUG#TO APPS WITH GRANT OPTION;
GRANT SELECT ON AR.AR_DEBUG# TO XXUSR_SELECT_R;
Examples: PL/SQL Package
(APPS.ACCOUNT_MGR)
<illustration>
Examples: PL/SQL Package
(APPS.ACCOUNT_MGR)
<illustration>
How is Development Affected?
(Doc ID 1489116.1)
Not using an APPS.<editioned object synonym>
–Views: disappearing/appearing columns, indexes, even data
–PL/SQL: dropped/altered/changed API’s, usage, references
–Triggers: disappearing/appearing constraints, functional changes
–Types: disappearing/appearing columns, indexes, even data
–Synonyms: pointers change: ViewsóTables, all the above
- Invalid Objects Appear After Patching
- Functional Code Behavior Changes After Patching
- If another Developer is using an Edition:The DEFAULT_EDITION can change without warning
What to Do?
- Always Be Aware of other Patching or Development activity going on in the instance
- Stage Filesystem-based Code in both RUN_BASE and PATCH_BASE
- Scheduling of Data Changes is Critical (changes can vanish)
- Announce to all other Users if Creating/Cutting-Over a New Edition
- Flag all Base-Object Customizations for Detection during PPA
How to Flag a Customization
- (OAM -> Site Map -> [Maintenance] -> Register Flagged Files)
- <illustration>
How to Flag a Customization
- (OAM -> Site Map -> [Maintenance] -> Register Flagged Files)
- <illustration>
MOS References
- (support.oracle.com – CSI: 19086017)
- Deploying Customizations in Oracle E-Business Suite Release 12.2 (Doc ID 1577661.1)
- Master Note: Overview of Oracle Edition-Based Redefinition (EBR) (Doc ID 1489116.1)
- Oracle E-Business Suite Release 12.2: Online Patching FAQ
(Doc ID 1583902.1) - Oracle Application Framework Release Notes for Release 12.2.3 (Doc ID 1593782.1)
- Where to Deploy Custom Java [default: $JAVA_TOP/*]
(Doc ID 1609939.1) - Oracle E-Business Suite Release 12.2 Information Center
(Doc ID 1583153.1)
An in-depth white paper prepared for the NorCalOAUG by John Peters (2/2014):