Thursday, 25 February 2016

Customization overwrite after adop cutover phase

Customization overwrite after adop cutover phase in Release 12.2.4

If your customizations like forms/reports deployed on Oracle EBS Release 12.2.4 on run system lost after adop phase=cutover as run and patch file system synch.

Do the following:
Edit: /opt/oracle/TEST/fs_ne/EBSapps/appl/ad/custom/adop_sync.drv  file and add below entry within Start and End Customizations.


rsync -zr %s_current_base%/EBSapps/appl/fpms %s_other_base%/EBSapps/appl/fpms



Worked Example
------------------------------


# $Header: adop_sync_drv.tmp 120.2.12020000.9 2014/11/03 09:00:11 cgautam ship $  
# +============================================================================================+
# | Copyright (c) 2005, 2014 Oracle and/or its affiliates. | 
# | All rights reserved.                                   | 
# | Version 12.0.0                                         | 
# +============================================================================================+
# | -------------------------------------------------------------------------
# | | IMPORTANT: You may only edit the Customization Section of this file,  |
# | | between the "#Begin Customization" and "#End Customization" tags.     |
# | -------------------------------------------------------------------------
# |
# | This file is maintained to add/preserve the actions to be done in addition to the process 
# | of normal synchronization between RUN and Patch file systems. User would edit this file
# | to add the actions within '#Begin Customization' and '#End Customization' section. 
# | The actions would be performed during ADOP synchronization phase.
# | 
# | The custom sync up driver file named adop_sync.drv and would be present in the
# | %s_ne_base%/EBSapps/appl/ad/custom directory. Users are recommended to edit 
# | only this adop_sync.drv file for such customization/synchronization.
# |
# | A template file for the same would be present under %s_adtop%/admin/template/adop_sync.tmp.
# | The template can be patched.
# | The ADOPCustomSyncUP API would check the version of this template and compare with 
# | adop_sync.drv file.
# | into template within '#Begin Customization' and '#End Customization'.
# | 
# | If template version and adop_sync.drv version are same then adop_sync.drv would be read and 
# | the actions would be performed/executed.
# |
# |
# | Customers are allowed to use context variables while defining the actions. The syntax to define 
# | Context variable in action is %s_sample_var%.
# | ADOPCustomSyncUp API would take care of instantiating these context variables while executing the actions.
# |
# | If passwords need to be piped-in to the scripts then those need to be mentioned as shown in 
# | Scripts section in the sample mentioned below.
# | All stdin agruments need to be specified as STDIN_ARGS={%s_appsPass%, %s_wlsPass%}, and this 
# | need to delimited by '|' after action like below:
# | command|STDIN_ARGS={%s_appsPass%, %s_wlsPass%}
# |
# | ----------------------------------------------------------------------------
# | Custom synchronization which is called during PREPARE phase of ADOP will use
# | values from RUN context file.
# | All the custom commands used in this driver should have PATHs relative to 
# | s_current_base and s_other_base ONLY.
# | -----------------------------------------------------------------------------
# | 
# +============================================================================================+


#Begin Customization

#Copy Starts
#Sample copy action. This copy could be anything like simple file copy from user home.
#
#For Unix Platform
#rsync -zr /d01/oracle/TEST/fs1/EBSapps/appl/some_dir /d01/oracle/TEST/fs2/EBSapps/appl/some_dir
rsync -zr %s_current_base%/EBSapps/appl/fpms %s_other_base%/EBSapps/appl/
rsync -zr %s_current_base%/EBSapps/appl/ggl %s_other_base%/EBSapps/appl/

#For Windows Platform
#xcopy /dieqy /d01/oracle/TEST/fs1\EBSapps\appl\some_dir /d01/oracle/TEST/fs2\EBSapps\appl\some_dir 
#Copy Ends

#JSP Start
#Sample syntax to compile custom JSP using ojspCompile.pl
#For Unix Platforms
#perl /d01/oracle/TEST/fs2/EBSapps/appl/fnd/12.0.0/patch/115/bin/ojspCompile.pl --compile -s "a.jsp, b.jsp" --flush
#perl /d01/oracle/TEST/fs2/EBSapps/appl/fnd/12.0.0/patch/115/bin/ojspCompile.pl --compile -s "diff.jsp" --flush 
#For Windows Platform
#perl /d01/oracle/TEST/fs2\EBSapps\appl\fnd\2.0.0\patch\115\bin\ojspCompile.pl --compile -s "a.jsp, b.jsp" --flush
#perl /d01/oracle/TEST/fs2\EBSapps\appl\fnd\2.0.0\patch\115\bin\ojspCompile.pl --compile -s "diff.jsp" --flush 
#JSP End

#Scripts Start
#Sample syntax for custom scripts.
#The scripts could be a shell OR CMD or perl OR WLST script
#For Unix Platforms
#sh /d01/oracle/TEST/fs2/EBSapps/appl/ad/12.0.0/bin/custom.pl -contextfile=<CONTEXT_FILE_PATH>|STDIN_ARGS={%s_appsPass%, %s_wlsPass%}
#sh /d01/oracle/TEST/fs2/FMW_Home/wlserver_10.3/common/bin/wlst.sh custom.py -appspwd %s_appsPass%
#For Windows Platform
#/d01/oracle/TEST/fs2\EBSapps\appl\ad\12.0.0\bin\custom.pl -contextfile=<CONTEXT_FILE_PATH>|STDIN_ARGS={%s_appsPass%, %s_wlsPass%}

#sh /d01/oracle/TEST/fs2/EBSapps/appl/ad/12.0.0/bin/custom.pl -contextfile=<CONTEXT_FILE_PATH>|STDIN_ARGS={%s_appsPass%, %s_wlsPass%}
#sh /d01/oracle/TEST/fs2/FMW_Home/wlserver_10.3/common/bin/wlst.sh custom.py -appspwd %s_appsPass%
#For Windows Platform
#/d01/oracle/TEST/fs2\EBSapps\appl\ad\12.0.0\bin\custom.pl -contextfile=<CONTEXT_FILE_PATH>|STDIN_ARGS={%s_appsPass%, %s_wlsPass%}
#/d01/oracle/TEST/fs2\FMW_Home\wlserver_10.3\common\bin\wlst.cmd custom.py -appspwd %s_appsPass%
#Scripts End

#SQL Starts
#Sample SQL script
#For Unix Platforms
#/d01/oracle/TEST/fs2/EBSapps/10.1.2/bin/sqlplus APPS/%s_appsPass% @test.sql
#/d01/oracle/TEST/fs2/EBSapps/10.1.2/bin/sqlplus /nolog @/d01/oracle/TEST/fs2/EBSapps/test.sql|STDIN_ARGS={APPS, %s_appsPass%, TWO_TASK}
#For Windows Platform
#/d01/oracle/TEST/fs2\EBSapps\10.1.2\bin\sqlplus APPS/%s_appsPass% @test.sql
#SQL ends

#Forms Start
#Sample to compile custom forms. 
#Copy the generated fmx into <FORMS_PATH>
#For Unix Platforms
#/d01/oracle/TEST/fs2/EBSapps/10.1.2/bin/frmcmp <some Location>/custom.fmb APPS/%s_appsPass%
#For Windows Platform
#/d01/oracle/TEST/fs2\EBSapps\10.1.2\bin\frmcmp <some Location>/custom.fmb APPS/%s_appsPass%
#Froms End

#End Customization

                                                                              104,1         Bot

Wednesday, 24 February 2016

Creating a Custom Application in Oracle E-Business Suite Release 12.2 (adsplice)

-Creating a Custom Application in Oracle E-Business Suite Release 12.2 (Doc ID 1577707.1)
This note describes the basic steps needed to create a custom application in Oracle E-Business Suite Release 12.2.

Create the schema in the database. I am creating a schema called  'tgc' and I use the same schema for all the custom application.

CREATE USER TGC IDENTIFIED BY tgc
DEFAULT TABLESPACE APPS_TS_TX_DATA
TEMPORARY TABLESPACE TEMP1
PROFILE DEFAULT
ACCOUNT UNLOCK;

GRANT CONNECT, RESOURCE TO TGC;
GRANT CREATE ANY CONTEXT TO TGC;
GRANT CREATE ANY TYPE TO TGC;
GRANT CREATE CLUSTER TO TGC;
GRANT CREATE DATABASE LINK TO TGC;
GRANT CREATE DIMENSION TO TGC;
GRANT CREATE INDEXTYPE TO TGC;
GRANT CREATE LIBRARY TO TGC;
GRANT CREATE MATERIALIZED VIEW TO TGC;
GRANT CREATE OPERATOR TO TGC;
GRANT CREATE PROCEDURE TO TGC;
GRANT CREATE PUBLIC SYNONYM TO TGC;
GRANT CREATE SEQUENCE TO TGC;
GRANT CREATE SYNONYM TO TGC;
GRANT CREATE TABLE TO TGC;
GRANT CREATE TRIGGER TO TGC;
GRANT CREATE TYPE TO TGC;
GRANT CREATE VIEW TO TGC;

Section 1: Create A Custom Application Using adsplice
a. download Patch 3636980 "Support Diagnostics (IZU) patch for AD Splice" from My Oracle Support.

b. Manually copy the three .txt files from the 3636980\izu\admin directory to your own temporary directory.

c. Rename izuprod.txt to <CUSTOM MODULE>prod.txt. In this example, we will be using "tgcprod.txt".

d. Rename izterr.txt to <CUSTOM MODULE>terr.txt. In this example, we will be using "tgcterr.txt".

e. Open newprods.txt in a text editor.

i) Change all references of "izu" to <custom module> and all references of "IZU" to <CUSTOM MODULE> (i.e. keep the case sensitivity).

In this example, we will be changing references of "izu" to be "tgc" and "IZU" to be "TGC".


In my example, I will change 'izu' to 'tgc' and 'IZU' to 'TGC'.


%%% Splicer control file format 12.0.A
#
# $Header: newprods.txt 120.1 2006/09/20 12:57:45 jaobrien noship $
#
#
# Section for Oracle Support Diagnostic Tools

product=tgc
base_product_top=*APPL_TOP*
oracle_schema=tgc
sizing_factor=100
main_tspace=APPS_TS_TX_DATA
index_tspace=APPS_TS_TX_IDX
temp_tspace=TEMP1
default_tspace=APPS_TS_TX_DATA

# end of Oracle Support Diagnostic Tools




ii) Change all references to prodid 278 to your own unique number.

It is recommended you pick a number above 50,000 that is not already in use. You can run the following SQL to find out if your selected custom application ID number is available:
SQL>select decode(count ,0, 'Selected number is Available', 'Selected number already in use') Status, &&enter_custom_applID selected_number
from
(
select count(*) as count from
(
select 'x' from fnd_oracle_userid
where oracle_id= &&enter_custom_applID
union
select 'x' from fnd_application
where application_id= &&enter_custom_applID
)
);

In this example, we will use a prodid of 500001.
g) Open tgcterr.txt in a text editor.

i) Change all references of "izu" to <custom module> and all references of "IZU" to <CUSTOM MODULE> (keeping the case sensitivity)
In this example, we will be changing references of "izu" to be "tgc" and "IZU" to be "TGC".

ii) Change the text "Oracle_Support_Diagnostic_Tools" to be "tgc_custom_app".
h. Copy the following text files to the $APPL_TOP/admin directory
tgcprod.txt
tgcterr.txt
newprods.txt
i. Change directory to the admin directory under $APPL_TOP

j. Run adsplice

adsplice must be run from the admin directory under APPL_TOP, and is invoked by running the adsplice command.
Note: In Oracle E-Business Suite Release 12.2, AD Splice first makes the new user edition-enabled, then enables Edition-Based Redefinition (EBR) for the custom objects.

[oracle@rp admin]$ adsplice

                     Copyright (c) 2002, 2012 Oracle Corporation
                        Redwood Shores, California, USA

                                   AD Splicer

                                 Version 12.2.0

NOTE: You may not use this utility for custom development
      unless you have written permission from Oracle Corporation.

Your default directory is '/u01/oracle/TEST/fs1/EBSapps/appl'.
Is this the correct APPL_TOP [Yes] ?
AD Splicer records your AD Splicer session in a text file
you specify.  Enter your AD Splicer log file name or press [Return]
to accept the default file name shown in brackets.

Filename [adsplice.log] : 11022015.log

************* Start of AD Splicer session *************
AD Splicer version: 12.2.0
AD Splicer started at: Wed Feb 11 2015 17:54:19

APPL_TOP is set to /u01/oracle/TEST/fs1/EBSapps/appl

Change DB = YES.


Please enter the name of the Oracle E-Business Suite System that this
APPL_TOP belongs to.

The Applications System name must be unique across all Oracle
Applications Systems at your site, must be from 1 to 30 characters
long, may only contain alphanumeric and underscore characters,
and must start with a letter.

Sample Applications System names are: "prod", "test", "demo" and
"Development_2".

Applications System Name [TEST] : TEST *


NOTE: If you do not currently have certain types of files installed
in this APPL_TOP, you may not be able to perform certain tasks.

Example 1: If you don't have files used for installing or upgrading
the database installed in this area, you cannot install or upgrade
the database from this APPL_TOP.

Example 2: If you don't have forms files installed in this area, you cannot
generate them or run them from this APPL_TOP.

Example 3: If you don't have concurrent program files installed in this area,
you cannot relink concurrent programs or generate reports from this APPL_TOP.


Do you currently have or want to install files  used for installing or upgrading
the database in this APPL_TOP [YES] ? YES *


Do you currently have or want to install Java and HTML files for HTML-based
functionality in this APPL_TOP [YES] ? YES *


Do you currently have or want to install Oracle E-Business Suite forms files
in this APPL_TOP [YES] ? YES *


Do you currently have or want to install concurrent program files
in this APPL_TOP [YES] ? YES *


Please enter the name Oracle E-Business Suite will use to identify this APPL_TOP.

The APPL_TOP name you select must be unique within an Oracle E-Business Suite
System, must be from 1 to 30 characters long, may only contain
alphanumeric and underscore characters, and must start with a letter.

Sample APPL_TOP Names are: "prod_all", "demo3_forms2", and "forms1".

APPL_TOP Name [rp] : rp *



You are about to install or upgrade Oracle E-Business Suite product tables
in your ORACLE database 'TEST'
using ORACLE executables in '/u01/oracle/TEST/fs1/EBSapps/10.1.2'.

Is this the correct database [Yes] ?

AD Splicer needs the password for your 'SYSTEM' ORACLE schema
in order to determine your installation configuration.

Enter the password for your 'SYSTEM' ORACLE schema: 


The ORACLE username specified below for Application Object Library
uniquely identifies your existing product group: APPLSYS

Enter the ORACLE password of Application Object Library [APPS] : 

AD Splicer is verifying your username/password.

The status of various features in this run of AD Splicer is:

                                           <-Feature version in->
Feature                          Active?   APPLTOP    Data model    Flags
------------------------------   -------   --------   -----------   -----------
CHECKFILE                        Yes       1          1             Y N N Y N Y
PREREQ                           Yes       6          6             Y N N Y N Y
CONCURRENT_SESSIONS              No        2          2             Y Y N Y Y N
PATCH_TIMING                     Yes       2          2             Y N N Y N Y
PATCH_HIST_IN_DB                 Yes       6          6             Y N N Y N Y
SCHEMA_SWAP                      Yes       1          1             Y N N Y Y Y
JAVA_WORKER                      Yes       1          1             Y N N Y N Y
CODELEVEL                        Yes       1          1             Y N N Y N Y



Reading product information from file...

Reading language and territory information from file...

Reading language information from applUS.txt ...

Reading database to see what industry is currently installed.

Reading FND_LANGUAGES to see what is currently installed.
Currently, the following language is installed:

Code   Language                                Status
----   --------------------------------------- ---------
US     American English                        Base        

Your base language will be AMERICAN.

Setting up module information.
Reading database for information about the modules.
Saving module information.
Reading database for information about the products.
Reading database for information about how products depend on each other.
Reading topfile.txt ...

Saving product information.
*** Edition Enabled User ***


Please enter the directory where your AD Splicer control file is located.

The default directory is [/u01/oracle/TEST/fs1/EBSapps/appl/admin] :

Please enter the name of your AD Splicer control file [newprods.txt] :


Processing file /u01/oracle/TEST/fs1/EBSapps/appl/admin/newprods.txt...
  Loading information for product 'tgc'...

Warning: Because the database is in new tablespace mode, AD Splicer is ignoring the tablespace settings in your control file!

Successfully read file /u01/oracle/TEST/fs1/EBSapps/appl/admin/newprods.txt.


Verifying localizations...

Validating inter-product dependency information...

Re-organizing product information lists...


Adding new languages into FND_LANGUAGES...


Creating ORACLE usernames for products...

AD Splicer is creating or updating the ORACLE username TGC
with password ***** for tgc custom app tables.

Granting privileges for tablespaces...

Granting required system privileges and creating APPS*DDL packages...

sqlplus -s TGC/***** @/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adsqlwrapper.sql '/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adaddls.pls ***** TGC *****'

Done running adaddls.pls for TGC

sqlplus -s TGC/***** @/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adsqlwrapper.sql '/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adaaddls.pls ***** TGC *****'

Done running adaaddls.pls for TGC

sqlplus -s TGC/***** @/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adsqlwrapper.sql '/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adaddlb.pls ***** TGC *****'

Done running adaddlb.pls for TGC

sqlplus -s TGC/***** @/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adsqlwrapper.sql '/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adaaddlb.pls ***** TGC *****'

Done running adaaddlb.pls for TGC

Registering ORACLE usernames/passwords.

**
**Inserting application information for new products...
**


**** Running Seed Table Prepare for FND_APPLICATION ****

**** Running Seed Table Prepare for FND_APPLICATION_TL ****
INSERT INTO  FND_OAM_CONTEXT_CUSTOM (OA_VAR,CTX_TYPE,OA_TYPE,NAME,DEFAULT_VALUE,TITLE,DESCRIPTION) VALUES ('c_tgc','A','PROD_TOP','c_tgc','/u01/oracle/TEST/fs1/EBSapps/appl/tgc/12.0.0','custom prod top tgc','this is spliced custom prod top')  Temporarily resetting CLASSPATH to:
  "/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/java/adjava.zip:/u01/oracle/TEST/fs1/EBSapps/comn/util/jdk32/lib/dt.jar:/u01/oracle/TEST/fs1/EBSapps/comn/util/jdk32/lib/tools.jar:/u01/oracle/TEST/fs1/EBSapps/comn/util/jdk32/jre/lib/rt.jar:/u01/oracle/TEST/fs1/EBSapps/comn/shared-libs/ebs-3rdparty/WEB-INF/lib/ebs3rdpartyManifest.jar:/u01/oracle/TEST/fs1/FMW_Home/Oracle_EBS-app1/shared-libs/ebs-fmw/WEB-INF/lib/ebsFMWManifest.jar:/u01/oracle/TEST/fs1/FMW_Home/Oracle_EBS-app1/shared-libs/ebs-appsborg/WEB-INF/lib/ebsAppsborgManifest.jar:/u01/oracle/TEST/fs1/FMW_Home/oracle_common/modules/oracle.uix_11.1.1/uix2.jar:/u01/oracle/TEST/fs1/EBSapps/comn/java/classes:/u01/oracle/TEST/fs1/EBSapps/10.1.2/forms/java:/u01/oracle/TEST/fs1/EBSapps/10.1.2/forms/java/frmall.jar:/u01/oracle/TEST/fs1/EBSapps/10.1.2/jlib/ewt3.jar:/u01/oracle/TEST/fs1/EBSapps/10.1.2/j2ee/OC4J_BI_Forms/applications/formsapp/formsweb/WEB-INF/lib/frmsrv.jar"

  Calling /u01/oracle/TEST/fs1/EBSapps/comn/util/jdk32/jre/bin/java ...

Running fnd_application_pkg.add_language ...
**
**Updating product information for new products...
**


Populating INSTALL_GROUP_NUM column to FND_ORACLE_USERID table.

**
**Updating product dependency information...
**


Recording modules in the database...done.

**
**Updating Data Groups...
**


Reading existing data groups from database.

Registering any new data groups.


Registering any new data group units.


Updating Data Group "Standard" to point to
APPS #1 Account (ORACLE ID = 900)


Updating Patch Advisor tables to include new product information ..

sqlplus -s APPS/***** @/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/patch/115/sql/adsqlwrapper.sql '/u01/oracle/TEST/fs1/EBSapps/appl/ad/12.0.0/sql/adpaseed.sql *****'

Done.

Saving module actions...done.

Saving product actions...done.

Making product top directory for product "tgc"...
Directory will be /u01/oracle/TEST/fs1/EBSapps/appl/tgc/12.0.0

  Making directory "log" for product "tgc"...
  Making directory "out" for product "tgc"...
  Making directory "mesg" for product "tgc"...
  Making directory "sql" for product "tgc"...
    Creating stub file "sql/TGCNLINS.sql" for product "tgc"...
  Making directory "admin/sql" for product "tgc"...
    Creating stub file "admin/sql/TGCNLADD.sql" for product "tgc"...
  Making directory "admin/driver" for product "tgc"...

 Recording ADSPLICE action for product: tgc


Do you wish to regenerate your environment file [Yes] ?

Checking if AutoConfig is enabled....

Running AutoConfig on : All products ...

The log file is located at:
/u01/oracle/TEST/fs1/EBSapps/appl/admin/TEST/log/autoconfig_1.log

Please check the log file for more details about the run of AutoConfig.

If you added new products, use FNDCPASS to change their default passwords.

AD Splicer is complete.

Errors and warnings are listed in the log file
/u01/oracle/TEST/fs1/EBSapps/appl/admin/TEST/log/11022015.log

10. Check the adsplice and Autoconfig log file.

and in other log files in the same directory.

[oracle@rp admin]$ vi /u01/oracle/TEST/fs1/EBSapps/appl/admin/TEST/log/autoconfig_1.log
[oracle@rp admin]$ vi /u01/oracle/TEST/fs1/EBSapps/appl/admin/TEST/log/11022015.log
[oracle@rp admin]$ cd $TGC_TOP

Now you can verify that the Custom Product/ Application is in the database using the following queries:

Log in to SQLPLUS as apps.

select * from fnd_application where application_short_name = 'XXONT';
select * from fnd_product_installations where APPLICATION_ID = 50301;
select * from dba_users where username = 'XXONT'; 
Login to new session of Application node and check for environment file
$ env |grep XXONT
XXONT_TOP=/u01/app/oracle/fs1/EBSapps/appl/xxont/12.0.0
$

$ ls $XXONT_TOP
admin  log  mesg  out  sql