R12.2.x - Registering Custom Application/ Product/ CUSTOM_TOP in Oracle E-Business Suite Release 12.2

The process of registering custom application is different from other version oracle applications. Below are the steps that I followed to perform the register custom application like XXONT (An extension to the standard Oracle Order Management module). The same applies for any Custom Application /Product.

With R12.2.x, Oracle have introduced online patching functionality using two file editions - RUN and PATCH. We should NOT use Applications form to register custom application rather use adsplice to ensure that the application is set up for online patching.

Environment:
Two node architecture with application node in Linux and Database on HP UX Itanium

Application Release: R12.2.3 on Linux x-86 64 bit 6
This node runs all the components of the Oracle EBS like forms, weblogic, concurrent managers, OACore and so on.
Database : 11.2.0.3 on HP UX Itanium. Database node contains only the database.

Steps:

1. Create the schema in the database. I am creating a schema called  'PLUM' and I use the same schema for all the custom application. You are always welcome to create each schema for each custom application.

CREATE USER PLUM IDENTIFIED BY plum
DEFAULT TABLESPACE APPS_TS_TX_DATA
TEMPORARY TABLESPACE TEMP1
PROFILE DEFAULT
ACCOUNT UNLOCK; 

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

2. Download the patch 3636980 (Support Diagnostics (IZU) patch for AD Splice). This patch is generic for R12.

3.  Unzip the files in the patch and copy the following three files from p3636980_R12_GENERIC\3636980\izu\admin to your desktop/ current working folder.
  • izuprod.txt
  • izuterr.txt
  • newprods.txt
4.Rename the file izuprod.txt to [CUSTOM_MODULE]prod.txt and izuterr.txt to [CUSTOM_MODULE]terr.txt

In my case, I renamed the file as xxontprod.txt and xxontterr.txt.

5. Open the newprods.txt in a text editor and change all references of "izu" to [custom_module] and all references of "IZU" to [CUSTOM_MODULE]. Please do maintain the case sensitivity.

In my example, I will change 'izu' to 'xxont' and 'IZU' to 'XXONT'.

%%% 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=xxont
base_product_top=*APPL_TOP*
oracle_schema=plum
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


6. Open the xxontprod.txt in a text editor
  • Change all the references of 'izu' and 'IZU' with 'xxont' and 'XXONT' respectively. Please do maintain the case sensitivity.
  • Change the Application/Product ID from 278 to your own unique number.
Note: Oracle recommends to pick a number above 50000 that is not already in use. You can use the below SQL to confirm that Application/Product ID is available to use or not:

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)
);

I wanted to give 50301 for XXONT, so I entered 50301 as the parameter for the query. The SQL returned "Selected number is Available". 

So I changed 278 to 50301 in the file - xxontprod.txt.

7. Open the xxontterr.txt in a  text editor.
  • Change all the references of 'izu' to [custom_module] and 'IZU' to [CUSTOM_MODULE] keeping the case sensitivity. In our example, 'izu' --> 'xxont' and 'IZU'  --> 'XXONT'.
  • Change the text 'Oracle_Support_Diagnostic_Tools' to 'abc_custom_app". In my example, I changed the text to 'Plum_Oracle_Order_Management'.
8. Copy the three files to $APPL_TOP/admin directory.
  • xxontprod.txt
  • xxontterr.txt
  • newprods.txt
9. Change the directory to $APPL_TOP/admin and run adsplice. 
Note:  adsplice must be run from the admin directory under APPL_TOP.

$ adsplice



Your default directory is '/u01/app/oracle/fs1/EBSapps/appl'.
Is this the correct APPL_TOP [Yes] ?

Filename [adsplice.log] : adsplice_xxont.log



You are about to install or upgrade Oracle E-Business Suite product tables
in your ORACLE database 'D599'
using ORACLE executables in '/u01/app/oracle/fs1/EBSapps/10.1.2'.
Is this the correct database [Yes] ?



Enter the password for your 'SYSTEM' ORACLE schema:



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



Please enter the directory where your AD Splicer control file is located.
The default directory is [/u01/app/oracle/fs1/EBSapps/appl/admin] : 
Please enter the name of your AD Splicer control file [newprods.txt] :



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

Checking if AutoConfig is enabled....

Running AutoConfig on : All products ...

10. Check the adsplice and Autoconfig log file.

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


11. You can not create other additional directories if needed like bin, /forms/US, include, lib, mds, reports/US, workflow. 

Note:
If you are using Shared APPL_TOP, you need to  do all these process on ONE node and then run autoconfig on others. You don't have to rerun adsplice. If APPL_TOP is NOT SHARED, repeat the steps 8,9,10 and 11.


Do you have to repeat the steps for Patch File system ?
When you start the next online patching cycle, the prepare phase will run adsplice sync-up actions to synchronize the two file systems. Check for a known bug 18815526:R12.AD.C in case adsplice sync-up fails when prepare phase is run.

Reference:
Creating a Custom Application in Oracle E-Business Suite Release 12.2 (Doc ID 1577707.1)

Oracle 10g /11g - ORA-02082: a loopback database link must have a connection qualifier

I refreshed/cloned an Oracle 11.2.0.2 database from Production and I received the following error while dropping a database link:

SYS@ZERO SQL>drop  public database link ZERO;
drop  public database link ZERO
                           *
ERROR at line 1:
ORA-02082: a loopback database link must have a connection qualifier


Cause:

You are trying to create or drop a database link to the same database name. This is an expected behavior.

Solution:
Rename the global_name of the database before you can drop the database link.

SYS@ZERO SQL>select * from global_name;

GLOBAL_NAME
--------------------------------------------------------------------------------
ZERO.VAIDIYAN.COM


SYS@ZERO SQL>


SYS@ZERO SQL>drop  public database link ZERO;
drop  public database link ZERO
                           *
ERROR at line 1:
ORA-02082: a loopback database link must have a connection qualifie
r


SYS@ZERO SQL>alter database rename global_name to TEST;

Database altered.

SYS@ZERO SQL>drop  public database link ZERO;

Database link dropped.


SYS@ZERO SQL>alter database rename global_name to ZERO;

Database altered.

SYS@ZERO SQL>select * from global_name;

GLOBAL_NAME
--------------------------------------------------------------------------------
ZERO.VAIDIYAN.COM


SYS@ZERO SQL>

Reference:
ORA-02082 TRYING TO DROP A PUBLIC DBLINK (Doc ID 1070826.6)

Oracle 11g RDBMS - Renaming the Oracle Database (SID) without changing the DB ID using DBNEWID utility

DBNEWID is a Oracle Database utility to perform the following:
(i) Only the DBID of a database
(ii) Only the DBNAME of a database
(iii) Both the DBNAME and DBID of a database

What is a DBID?
The DBID is an internal, unique identifier for a database  that Oracle generates when a database is created. RMAN uses the DBID to identify databases.

When the DBID of a database is changed, all previous backups and archived logs of the database become unusable. This is similar to creating a database except that the data is already in the datafiles. You must open the database using RESETLOGS. If you only change DB_NAME then old backups are still USABLE and you NO NEED to open the database with RESETLOGS options.

I happen to perform  the option (ii)  for one of the databases -  renaming DBNAME.

Goal: Rename database from MISCTST to MISCDEV.

$ sqlplus / as sysdba
SQL> select dbid,open_mode from v$database;

      DBID OPEN_MODE
---------- --------------------
2725577770 READ WRITE

SQL> SELECT DECODE(value, NULL, 'PFILE', 'SPFILE') "Init File Type" FROM sys.v_$parameter WHERE name = 'spfile';

Init F
------
PFILE

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>startup mount;
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                  2168376 bytes
Variable Size             159386056 bytes
Database Buffers           50331648 bytes
Redo Buffers                5271552 bytes
Database mounted.
SQL>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
$
$ nid TARGET=/ as sysdba DBNAME=MISCDEV SETNAME=YES

DBNEWID: Release 11.2.0.1.0 - Production on Tue Oct 7 15:34:36 2014

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

Password:
Connected to database MISCTST (DBID=2725577770)

Connected to server version 11.2.0

Control Files in database:
    /m03/oradata/control01.ctl
    /m04/oradata/control02.ctl
    /m05/oradata/control03.ctl

Change database name of database MISCTST to MISCDEV? (Y/[N]) => Y

Proceeding with operation
Changing database name from MISCTST to MISCDEV
    Control File /m03/oradata/control01.ctl - modified
    Control File /m04/oradata/control02.ctl - modified
    Control File /m05/oradata/control03.ctl - modified
    Datafile /m05/oradata/system01.db - wrote new name
    Datafile /m05/oradata/undotbs01.db - wrote new name
    Datafile /m05/oradata/sysaux01.db - wrote new name
    Datafile /m05/oradata/users01.db - wrote new name
    Datafile /m05/oradata/appdata01.db - wrote new name
    Datafile /m05/oradata/POMSDATA.db - wrote new name
    Datafile /m05/oradata/temp01.db - wrote new name
    Control File /m03/oradata/control01.ctl - wrote new name
    Control File /m04/oradata/control02.ctl - wrote new name
    Control File /m05/oradata/control03.ctl - wrote new name
    Instance shut down

Database name changed to MISCDEV.
Modify parameter file and generate a new password file before restarting.
Succesfully changed database name.
DBNEWID - Completed succesfully.

$

Now  change the init parameter DB_NAME from MISCTST to MISCDEV

cp -p initMISCTST.ora initMISCDEV.ora
db_name='MISCDEV'

Recreate the oracle password file :

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password='abc!xyz' entries=10 force=y

Change the SID in $ORACLE_HOME/network/admin/tnsnames.ora and $ORACLE_HOME/network/admin/listener.ora
$ lsnrctl start

$ export ORACLE_SID=MISCDEV
$ sqlplus / as sysdba
SQL>startup
ORACLE instance started.

Total System Global Area  263049216 bytes
Fixed Size                  2168896 bytes
Variable Size             104859584 bytes
Database Buffers          150994944 bytes
Redo Buffers                5025792 bytes
Database mounted.
Database opened.
SQL>select dbid,open_mode from v$database;

      DBID OPEN_MODE
---------- --------------------
2725577770 READ WRITE

SQL>

Oracle RDBMS : DROP DATABASE - ORA-01586: database must be mounted EXCLUSIVE and not open for this operation

Following is an example where I deleted the entire database using 'DROP DATABASE' command.

Database SID : ORANGE
Version: 11.2.0.4
OS : HP UX Itanium

The database is in OPEN mode.

SYS@ORANGE SQL>drop database;
drop database
*
ERROR at line 1:
ORA-01586: database must be mounted EXCLUSIVE and not open for this operation


Solution:

SYS@ORANGE SQL>shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@ORANGE SQL>startup mount exclusive restrict;
ORACLE instance started.

Total System Global Area 2121183232 bytes
Fixed Size                  2207208 bytes
Variable Size            1275068952 bytes
Database Buffers          838860800 bytes
Redo Buffers                5046272 bytes
Database mounted.
SYS@ORANGE SQL>drop database;

Database dropped.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@ORANGE SQL>