Monday 24 June 2013


Steps for finding password of a User in Oracle Apps R12

THIS WORKS WITH ORACLE R12


Here is a wonderful oracle seeded Procedure fnd_web_sec.get_guest_username_pwd which will help us to find out user password.

Please use with this care and don't misuse this.
Kindly Follow the below mentioned steps:

Login to Apps user

Step 1:

--Package Specification
CREATE OR REPLACE PACKAGE get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2;
END get_pwd;
/

Step 2:
--Package Body
CREATE OR REPLACE PACKAGE BODY get_pwd
AS
   FUNCTION decrypt (KEY IN VARCHAR2, VALUE IN VARCHAR2)
      RETURN VARCHAR2
   AS
      LANGUAGE JAVA
      NAME 'oracle.apps.fnd.security.WebSessionManagerProc.decrypt(java.lang.String,java.lang.String) return java.lang.String';
END get_pwd;
/

Step 3:
Query to get password for apps user.

SELECT
(SELECT get_pwd.decrypt (UPPER ((SELECT UPPER (fnd_profile.VALUE ('GUEST_USER_PWD')) FROM DUAL)), usertable.encrypted_foundation_password) FROM DUAL) AS apps_password
 FROM fnd_user usertable
WHERE usertable.user_name LIKE UPPER ((SELECT SUBSTR (fnd_profile.VALUE ('GUEST_USER_PWD') ,1 , INSTR (fnd_profile.VALUE ('GUEST_USER_PWD'), '/') - 1 ) FROM DUAL))
Step 4:
 --Query for finding any application user
SELECT usr.user_name,
       get_pwd.decrypt
          ((SELECT (SELECT get_pwd.decrypt
                              (fnd_web_sec.get_guest_username_pwd,
                               usertable.encrypted_foundation_password
                              )
                      FROM DUAL) AS apps_password
              FROM fnd_user usertable
             WHERE usertable.user_name =
                      (SELECT SUBSTR
                                  (fnd_web_sec.get_guest_username_pwd,
                                   1,
                                     INSTR
                                          (fnd_web_sec.get_guest_username_pwd,
                                           '/'
                                          )
                                   - 1
                                  )
                         FROM DUAL)),
           usr.encrypted_user_password
          ) PASSWORD
  FROM fnd_user usr
 WHERE usr.user_name = '&USER_NAME';
Workflow Structure in R12



How to apply patch while you are in the middle of patching

Sometimes when you are in the middle of applying a patch you may get adworkers errors or you can find out that a patch is missing. So you need to apply a second patch (which solves the problem) in the middle of a running patch.

1. Use adctrl (option 3) to tell all the existing workers to QUIT

2. Use adctrl (option 5) to tell managers that all workers have QUIT. (Adpatch session ends!)

3. Backup tables applsys.ad_deferred_jobs and applsys.fnd_install_processes.


Login as APPLSYS user and execute:

ALTER "TABLE" applsys.ad_deferred_jobs "RENAME" TO ad_deferred_jobs_old;

ALTER "TABLE" applsys.fnd_install_processes "RENAME" TO fnd_install_processes_old;

ALTER "INDEX" applsys.ad_deferred_jobs_u1 "RENAME" TO ad_deferred_jobs_u1_old;

ALTER "INDEX" applsys.fnd_install_processes_u1 "RENAME" TO fnd_install_processes_u1_old;


4. Go to $APPL_TOP/admin/SID/ for example $APPL_TOP/admin/TEST/ and rename the existing directory "restart"

$mv restart restart.old


5. Use adpatch to apply the second/other patch.


6. Login as APPLSYS and revert back to the original tables, ad_deferred_jobs and fnd_install_processes

ALTER "TABLE" applsys.ad_deferred_jobs_old "RENAME" TO ad_deferred_jobs;

ALTER "TABLE" applsys.fnd_install_processes_old "RENAME" TO fnd_install_processes;

ALTER "INDEX" applsys.ad_deferred_jobs_u1_old "RENAME" TO ad_deferred_jobs_u1;

ALTER "INDEX" applsys.fnd_install_processes_u1_old "RENAME" TO fnd_install_processes_u1;


7. Replace the original restart directory:

cd $APPL_TOP/admin/SID/ for example $APPL_TOP/admin/TEST/

mv restart restart_new

mv restart.old restart


8. Run adpatch to continue the first patch (with continue session?Yes)


9. Use adctrl (option 2, will change status to “Fixed/Restart”) to restart the failed workers for first patch

Thursday 13 June 2013

Cloning Steps in Oracle Applications

Hello all,

Troubleshooting RapidClone issues with Oracle Applications 11i [ID 364565.1]

The above ID will be more helpful for Depth process of cloning.

As per the request and with experience I am again returning to Cloning of Oracle Application. I know most of them know what exactly happens in cloning but still here I am trying to touch the depths.

Before starting I want to ask question. Why you need to do cloning ? Why we need to duplicate Oracle Application.

We need cloning for various of reasons. suppose I have got production instance and want to test some application. Now here I want to test the application, need to apply some product specific patches which might affect whole application then I have to give downtime which will affect business. So if I had the same this on which I can play and test my application or code or say I can apply some patches and at the same time business also run then nothing like it. This can be achieved by cloning or duplicating the application.

Duplicating the application is not easy or its just not simply copy the application, it wont work in any case. Logically it sounds fine just to copy the file system and re-link it and start the application but its not that easy.

Basically for cloning Oracle Application it can be categorized into three major categories.

-Preparing the Source System
-Copy the file System
-Preparing or say Configuring the Target System

You can achieve first and third steps using a Rapid Clone utility which Oracle provides for cloning

There can be many ways and methods to clone Oracle Application which many organisations follows but the only supported method provided by Oracle is using Rapid clone.

Rapid Clone is the new cloning utility introduced in Release 11.5.8. Rapid Clone leverages the new installation and configuration technology utilized by Rapid Install.

Basically there are two cloning methodology using Autoconfig and without using autoconfig. First one that is using autoconfig is completely replaced by Rapidclone.

Non-autocofig cloning methodology was generally used before 11.5.5 that is non autoconfig enabled system.

Here I will discuss Rapid Clone method of cloning and also throw some light on cloning 11.0.3 oracle application as some users are still using that.

So first about the Rapid clone method.

In Category 1 that is first you need to make source for clone. You need to dress up Source system so that only configuration files and not the whole file system is copied.

Pre-requisite Steps

To start with cloning you need to first check about some pre-requisites some utilities should be of required version

Here are they,

Oracle Universal Installer should be of 2.2.0.19 version
Perl should be of 5.005 version minimum
JRE 1.1.8 and 1.3.1
JDK 1.3.1
Zip utility of version 2.3 minimum
Latest Autoconfig Templates patches are applied. TXK-O is the latest till date.
Latest Rapid Clone patches should be applied. Latest is ADX.F till date.

After checking the pre-requisites now your system is ready to clone.

Preparing the Source system:

After checking the above mentioned pre-requisites now you have to prepare the source system which need to be cloned.

In a broad way what this step will do is this will create the staged clone directory which will be having the driver files and configuration file of the source.

So what exactly is going to happen in this step. Lets get in more details

Basically you have to run the adpreclone.pl script once for Application tier and one for the datbase (even if you are on single node ! )

Lets first check for the Database tier

On Source system, run following as ORACLE user

cd <RDBMS Oracle_Home/appsutil/scripts/context_name/
perl adpreclone.pl dbTier

After running this it goes in two stages

dbTechstack and Database

What exactly it will do is
It will create stage cloned area at $ORACLE_HOME/appsutil/clone This clone directory has got following main directories
data,jre,bin,db,html,context

It will prepare datbase techstack at dbTechStack stage. Major activities it will take care of at this stage.

-Creates template files at $ORACLE_HOME/appsutil/template
-Creates driver files at $ORACLE_HOME/appsutil/driver/instconf.drv
-Converts inventory from binary to xml

It will prepare datbase at the database stage. Major activities includes

-Create datbase control file script
$Oracle_Home/appsutil/clone/context/data/stage/addbhomsrc.xml
$Oracle_Home/appsutil/clone/context/data/stage/adcrdb.zip
adcrdbclone.sql

-Generates database creation driver file
$Oracle_Home/appsutil/clone/context/data/driver/data.drv

-Copy JDBC Libraries
$Oracle_Home/appsutil/clone /clone/jlib/classes111.zip

So all this happens on database side

Now lets concentrate on Application tier side. Again it goes almost in the same way that is in two stages.

As a APPLMGR user on application tier this script is run
cd $COMMON_TOP/admin/scripts/_perl ./adpreclone.pl appsTier

It will also create the staged clone directory at $COMMON_TOP/clone
It goes in two stages. Lets see one by one

atTechStack that is Application tier techstack.

- Creates template files for
Oracle_iAS_Home/appsutil/template
Oracle_806_Home/appsutil/template

-Creates Techstack driver files for
Oracle_iAS_Home/appsutil/driver/instconf.drv
Oracle_806_Home/appsutil/driver/instconf.drv

appltop preparation

-It will create application top driver file
$COMMON_TOP/clone/appl/driver/appl.drv

-Copy JDBC libraries
$COMMON_TOP/clone/jlib/classes111.zip

So this all happens in dressing the source system

After then we need to copy the files.

Copy following files

APPL_TOP
OA_HTML ($COMMON_TOP/html)
JAVA_TOP
COMMON_TOP/util
COMMON_TOP/clone
8.0.6 ORACLE_HOME
iAS ORACLE_HOME
DB ORACLE_HOME
dbf files

After this stage now you need to configure the Target node. Basically you will run adcfgclone.pl same for databse tier and for application tier.
Let go in bit more detail:

First we will see for the database tier

On the target node you will run
ORACLE_DB_HOME/appsutil/clone/bin/perl adcfgclone.pl dbTier

Again there are two stages :

First will look at dbTechstack
It will use the driver files and templates which were created at source and has been copied to target.

Following scripts are run
-adchkutl.sh
-adclonectx.pl
-runInstallConfigDriver —- located in $Oracle_Home/appsutil/driver/instconf.drv
-Relinking $Oracle_Home/appsutil/install/adlnkoh.sh

Now for database
-Driver file
$Oracle_Home/appsutil/clone/context/data/driver/data.drv
-Create database adcrdb.zip
-Autoconfig is run
-Control file creation adcrdbclone.sql

Now on application tier
from COMMON_TOP/clone/bin/perl adcfgclone.pl appsTier

Stage at TechStack
-Creates context file for target adclonectx.pl
-Run driver files
$Oracle_806_Home/appsutil/driver/instconf.drv
$Oracle_iAS_Home/appsutil/driver/instconf.drv

Relinking of Oracle Home
$Oracle_806_Home/bin/adlnk806.sh
$Oracle_iAS_Home/bin/adlnkiAS.sh

at the end for ApplTop stage
It runs driver and then autoconfig

So this will totally configure your application which has been copied.

At the end you have to some finishing tasks

-Update Printer settings
-Update Workflow Configuration settings
-Update Profile options

This completes you application cloning completely.

So Happy reading folks !!!!


Ref : http://onlineappsdba.com/index.php/2008/04/10/back-to-basics-of-cloning/

Database Recovery using Logfile without taking backup

SQL> startup
ORACLE instance started.

Total System Global Area 1068937216 bytes
Fixed Size                  2166536 bytes
Variable Size             457179384 bytes
Database Buffers          595591168 bytes
Redo Buffers               14000128 bytes
Database mounted.
ORA-01113: file 181 needs media recovery
ORA-01110: data file 181: '/sr12/d02/oracle/sr12/db/apps_st/data/tx_data51.dbf'

SQL> recover database using backup controlfile until cancel;
ORA-00279: change 10132238055147 generated at 06/13/2013 11:32:44 needed for
thread 1
ORA-00289: suggestion :
/sr12/d02/oracle/sr12/db/apps_st/data/archive/1_483_776833270.dbf
ORA-00280: change 10132238055147 for thread 1 is in sequence #483

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00308: cannot open archived log
'/sr12/d02/oracle/sr12/db/apps_st/data/archive/1_483_776833270.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

ORA-00308: cannot open archived log
'/sr12/d02/oracle/sr12/db/apps_st/data/archive/1_483_776833270.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/sr12/d02/oracle/sr12/db/apps_st/data/sys1.dbf'

SQL> recover database using backup controlfile until cancel;
ORA-00279: change 10132238055147 generated at 06/13/2013 11:32:44 needed for
thread 1
ORA-00289: suggestion :
/sr12/d02/oracle/sr12/db/apps_st/data/archive/1_483_776833270.dbf
ORA-00280: change 10132238055147 for thread 1 is in sequence #483

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/sr12/d02/oracle/sr12/db/apps_st/data/log1.dbf
ORA-00279: change 10132238085255 generated at 06/13/2013 11:39:47 needed for
thread 1
ORA-00289: suggestion :
/sr12/d02/oracle/sr12/db/apps_st/data/archive/1_484_776833270.dbf
ORA-00280: change 10132238085255 for thread 1 is in sequence #484
ORA-00278: log file '/sr12/d02/oracle/sr12/db/apps_st/data/log1.dbf' no longer
needed for this recovery

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/sr12/d02/oracle/sr12/db/apps_st/data/log2.dbf
ORA-00310: archived log contains sequence 482; sequence 484 required
ORA-00334: archived log: '/sr12/d02/oracle/sr12/db/apps_st/data/log2.dbf'

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/sr12/d02/oracle/sr12/db/apps_st/data/sys1.dbf'

SQL> recover database using backup controlfile until cancel;
ORA-00279: change 10132238085255 generated at 06/13/2013 11:39:47 needed for
thread 1
ORA-00289: suggestion :
/sr12/d02/oracle/sr12/db/apps_st/data/archive/1_484_776833270.dbf
ORA-00280: change 10132238085255 for thread 1 is in sequence #484

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
/sr12/d02/oracle/sr12/db/apps_st/data/log3.dbf
Log applied.
Media recovery complete.

SQL> alter database open resetlogs;

Database altered.

SQL>

Wednesday 12 June 2013



LOGFILE REMOVAL SCRIPT FOR 30 DAYS

find $LOG_HOME/ora/10.1.3/Apache -name "*.log" -mtime +30 -exec rm -f {} \;
find $LOG_HOME/ora/10.1.2/reports/cache -name "o*.txt" -mtime +30 -exec rm -f {} \;
find $LOG_HOME/ora/10.1.2/reports/cache -name "o*.eps" -mtime +30 -exec rm -f {} \;
find $LOG_HOME/ora/10.1.2/reports/cache -name "o*.xml" -mtime +30 -exec rm -f {} \;
find $LOG_HOME/ora/10.1.2/forms -name "em_*.rti" -mtime +30 -exec rm -f {} \;
find $LOG_HOME/ora/10.1.2/forms -name "frmweb_dump" -mtime +30 -exec rm -f {} \;
find $APPLTMP -name "OF*.t" -mtime +30 -exec rm -f {} \;

UNWANTED LOG FILE REMOVAL
http://dbataj.blogspot.in/2011/07/housekeeping-of-r12-application.html

Important Apps DBA Scripts

Finding Apps Version :
------------------------------

#!/bin/ksh
sqlplus apps/ezdtst321 << EOF
spool find_apps_version.log
SELECT substr(a.application_short_name, 1, 5) code,
       substr(t.application_name, 1, 50) application_name,
       p.product_version version
FROM   fnd_application a,
       fnd_application_tl t,
       fnd_product_installations p
WHERE  a.application_id = p.application_id
AND    a.application_id = t.application_id
AND    t.language = USERENV('LANG');
spool off;
exit
EOF

Checking Patch Number :
-----------------------------------

#!/bin/ksh
echo " "
echo "Starting the Database" $TWO_TASK
echo " "
echo "Enter the patch number:"
read number
sqlplus apps/ezdtst321 << EOF
spool patch_checking.log
select '-------------------------------------' from dual;
select '--------------AD_BUGS----------------' from dual;
select '-------------------------------------' from dual;
SELECT BUG_ID,BUG_NUMBER,CREATION_DATE,LAST_UPDATE_DATE FROM AD_BUGS WHERE BUG_NUMBER LIKE '$number';
select '-------------------------------------' from dual;
select '------------AD_APPLIED_PATCHES-------' from dual;
select '-------------------------------------' from dual;
SELECT APPLIED_PATCH_ID,PATCH_NAME,CREATION_DATE,LAST_UPDATE_DATE FROM AD_APPLIED_PATCHES WHERE PATCH_NAME = '$number';
spool off;
exit
EOF

Reducing Patching Time :
-----------------------------------


#!/bin/sh
#
# adpatch_auto a.k.a aa
#
# Ver Date Author Description
# --- --------- ---------- ---------------------------
# 1.0 30-OCT-00 G. Roberts Created
# 1.1 09-MAY-07 G. Roberts Extended for zip files
#
# Only use for patches you've already done manually, or in non-PROD environments
# Notes: You must have your environment set correctly
# You must have precreated defaults.txt
# Patch must be in PT (see config below)
# Patch driver number must be same as patch number

if [ "$#" != "2" -a "$#" != "3" -a "$#" != "4" -a "$#" != "5" ]; then
echo "Usage: aa PATCH_NUM DRIVERFILE_PREFIX [RESTART=YN [INTERACTIVE=YN]]"
echo " Simple e.g: aa 123456 u"
echo " Restart e.g: aa 123456 u Y Y"
exit 1
fi

# CONFIGURATION ITEMS
# Set PT to where your base patch directory is
PT=/patch; export PT
# LOGFILE is a file keeping track of aa run history
LOGFILE=$APPL_TOP/admin/p.log; export LOGFILE
# DEFFILE is your defaults.txt probably defaults.txt or adalldefaults.txt
DEFFILE=$APPL_TOP/admin/${TWO_TASK}/adalldefaults.txt
# Set DOUNZIP to Y if you want aa to search for and unzip p*.zip
DOUNZIP=Y; export DOUNZIP
# Set SETMAINT to Y to automatically switch on and off maintenance mode
# Only needed for late'ish versions 11.5.10 or higher
SETMAINT=Y; export SETMAINT
# Date format for logging
DF="+%y%m%d %H:%M:%S"

# Check CONTEXT_NAME is set
if [ -z "${CONTEXT_NAME}" ]; then
echo "CONTEXT_NAME is not set!"
exit 1
else
CTXT=${CONTEXT_NAME}; export CTXT
fi

ORIGDIR="`pwd`"

PNUM=$1; export PNUM
DRIV=$2; export DRIV
PATCH=$PNUM; export PATCH
if [ ! -z "$3" ]; then
if [ "$3" = "N" ]; then
REST="restart=no"; export REST
else
REST="restart=yes"; export REST
fi
fi
if [ "$#" = "4" ]; then
if [ "$4" = "Y" ]; then
INTERACT=yes; export INTERACT
else
INTERACT=no; export INTERACT
fi
else
INTERACT=no; export INTERACT
fi

echo "Patch number set to $PNUM"
echo "Driver set to $DRIV"
echo "Restart set to $REST"
echo "Interactive set to $INTERACT"
echo
echo `date "$DF"`" Starting $DRIV $PNUM $REST $INTERACT"
echo `date "$DF"`" Starting $DRIV $PNUM $REST $INTERACT" >> $LOGFILE

cd $PT
if [ "$DOUNZIP" = "Y" ]; then
if [ ! -d "$PNUM" ]; then
echo `date "$DF"`" Looking for zip files to unzip"
ZFILE=`ls -tr *$PNUM*.zip awk '{print $1}'`; export ZFILE
if [ -n "$ZFILE" ]; then
if [ -f "$ZFILE" ]; then
echo `date "$DF"`" Unzipping $ZFILE"
echo `date "$DF"`" Unzipping $ZFILE" >> $LOGFILE
unzip "$ZFILE"
else
echo `date "$DF"`" ERROR: File $PT/*$PNUM*.zip does not exist."
echo `date "$DF"`" ERROR: File $PT/*$PNUM*.zip does not exist." >> $LOGFILE
exit 1
fi
else
echo `date "$DF"`" ERROR: File $PT/*$PNUM*.zip does not exist."
echo `date "$DF"`" ERROR: File $PT/*$PNUM*.zip does not exist." >> $LOGFILE
exit 1
fi
fi
fi

if [ ! -d $PNUM ]; then
echo `date "$DF"`" ERROR: Directory $PT/$PNUM does not exist."
echo `date "$DF"`" ERROR: Directory $PT/$PNUM does not exist." >> $LOGFILE
exit 1
fi

if [ "$SETMAINT" = "Y" ]; then
echo `date "$DF"`" Enable maintenance mode"
echo `date "$DF"`" Enable maintenance mode" >> $LOGFILE
sqlplus -s apps/`get_pw db apps` @$AD_TOP/patch/115/sql/adsetmmd.sql ENABLE
fi

echo `date "$DF"`" Calling adpatch"
echo `date "$DF"`" Calling adpatch" >> $LOGFILE
adpatch \
defaultsfile=$DEFFILE \
logfile=${DRIV}${PNUM}_$CTXT.log \
patchtop=$PT/$PATCH \
driver=${DRIV}${PNUM}.drv \
workers=6 interactive=$INTERACT options=novalidate $REST
#workers=6 interactive=$INTERACT options=novalidate,nocheckfile $REST

if [ -d $PT/$PATCH/backup ]; then
echo `date "$DF"`" mv $PT/$PATCH/backup to $PT/$PATCH/backup_$CTXT"
echo `date "$DF"`" mv $PT/$PATCH/backup to $PT/$PATCH/backup_$CTXT" >>$LOGFILE
mv $PT/$PATCH/backup $PT/$PATCH/backup_$CTXT
fi

if [ "$SETMAINT" = "Y" ]; then
echo `date "$DF"`" Disable maintenance mode"
echo `date "$DF"`" Disable maintenance mode" >> $LOGFILE
sqlplus -s apps/`get_pw db apps` @$AD_TOP/patch/115/sql/adsetmmd.sql DISABLE
fi

cd "$ORIGDIR"

echo `date "$DF"`" Finished applying $DRIV $PNUM $INTERACT"
echo `date "$DF"`" Finished applying $DRIV $PNUM $INTERACT" >> $LOGFILE

Checking How many times driver file gets applied in bug :
------------------------------------------------------------------------------

echo "-----------------To get information related to how many time driver file is applied for bugs---------------"
#---------------------script Executing Syntax-------------------------------
#---------------------<script_file_name>.sh <patch_number>------------------
sqlplus apps/<apps_passwd> << EOF
select * from AD_PATCH_RUN_BUGS where BUG_ID in (select BUG_ID from AD_BUGS where BUG_NUMBER = '$1';
exit
EOF

Finding applied patches and drivers :
--------------------------------------------------

--------Script Running Syntax-----
#--------<script filename>.sh <patch name>-------
echo "Query to find out if any patch except localisation patch is applied or not, if applied, that what all drivers it contain and time of it's application"
sqlplus apps/ezdtst321 << EOF
select A.APPLIED_PATCH_ID, A.PATCH_NAME, A.PATCH_TYPE, B.PATCH_DRIVER_ID, B.DRIVER_FILE_NAME, B.ORIG_PATCH_NAME, B.CREATION_DATE, B.PLATFORM, B.SOURCE_CODE, B.CREATION_DATE, B.FILE_SIZE, B.MERGED_DRIVER_FLAG, B.MERGE_DATE from AD_APPLIED_PATCHES A, AD_PATCH_DRIVERS B where A.APPLIED_PATCH_ID = B.APPLIED_PATCH_ID and A.PATCH_NAME = '$1';
exit
EOF

Finding Patching History :
------------------------------------

echo " To know that if the patch is applied successfully, applied on both node or not, start time of patch application and end time of patch application, patch top location , session id ... patch run id"
#----------------------Syntax for this Script--------------------
#---------------------<Script_name>.sh patch_name---------------
sqlplus apps/ezdtst321 << EOF
select D.PATCH_NAME, B.APPLICATIONS_SYSTEM_NAME, B.NAME, C.DRIVER_FILE_NAME, A.PATCH_DRIVER_ID, A.PATCH_RUN_ID, A.SESSION_ID, A.PATCH_TOP, A.START_DATE, A.END_DATE, A.SUCCESS_FLAG, A.FAILURE_COMMENTS from AD_PATCH_RUNS A, AD_APPL_TOPS B, AD_PATCH_DRIVERS C, AD_APPLIED_PATCHES D where A.APPL_TOP_ID = B.APPL_TOP_ID AND A.PATCH_DRIVER_ID = C.PATCH_DRIVER_ID and C.APPLIED_PATCH_ID = D.APPLIED_PATCH_ID and A.PATCH_DRIVER_ID in (select PATCH_DRIVER_ID from AD_PATCH_DRIVERS where APPLIED_PATCH_ID in (select APPLIED_PATCH_ID from AD_APPLIED_PATCHES where PATCH_NAME = '$1')) ORDER BY 3;
exit
EOF

Finding Merged Patch Information :
--------------------------------------------------

echo "-------------------------------find Merged patch Information---------------------------------------"
#---------------- To find Merged patch Information from database in Oracle Applications------------------
#-----------------Script Syntax <Script_file_name>.sh <applied_patch_id>---------------------------------
sqlplus apps/<apps_passwd> << EOF
select bug_number from ad_bugs where bug_id in ( select bug_id from ad_comprising_patches where patch_driver_id =(select patch_driver_id from ad_patch_drivers where applied_patch_id =$1) );
exit
EOF

Finding Base Application Version :
------------------------------------------------

echo " find the base application version"
sqlplus apps/ezdtst321 << EOF
select ARU_RELEASE_NAME||'.'||MINOR_VERSION||'.'||TAPE_VERSION version, START_DATE_ACTIVE "when updated", ROW_SOURCE_COMMENTS "how it is done" from AD_RELEASES where BASE_RELEASE_FLAG = 'Y';
exit
EOF

Finding Latest Application Version :
-------------------------------------------------


echo "----------- To find the latest application version-----------"
sqlplus apps/ezdtst321 << EOF
select ARU_RELEASE_NAME||'.'||MINOR_VERSION||'.'||TAPE_VERSION version, START_DATE_ACTIVE updated,ROW_SOURCE_COMMENTS "how it is done",BASE_RELEASE_FLAG "Base version" FROM AD_RELEASES where END_DATE_ACTIVE IS NULL;
exit
EOF


Finding What is being done by the patch :
---------------------------------------------------------


echo "------------------------To find what is being done by the patch--------------------------------------------"
sqlplus apps/<apps_passwd> << EOF
select A.BUG_NUMBER "Patch Number", B. PATCh_RUN_BUG_ID "Run Id",D.APP_SHORT_NAME appl_top, D.SUBDIR, D.FILENAME, max(F.VERSION) latest, E.ACTION_CODE action from AD_BUGS A, AD_PATCH_RUN_BUGS B, AD_PATCH_RUN_BUG_ACTIONS C, AD_FILES D, AD_PATCH_COMMON_ACTIONS E, AD_FILE_VERSIONS F where A.BUG_ID = B.BUG_ID and B.PATCH_RUN_BUG_ID = C.PATCH_RUN_BUG_ID and C.FILE_ID = D.FILE_ID and E.COMMON_ACTION_ID = C.COMMON_ACTION_ID and D.FILE_ID = F.FILE_ID and A.BUG_NUMBER = '$1' and B.PATCH_RUN_BUG_ID = ' < > ' and C.EXECUTED_FLAG = 'Y' GROUP BY A.BUG_NUMBER, B.PATCH_RUN_BUG_ID, D. APP_SHORT_NAME, D>SUBDIR, D.FILENAME, E.ACTION_CODE;
exit
EOF



Finding What all has been done during application of patch :
----------------------------------------------------------------------------------

#--------------------------Query to know, what all has been done during application of PATCH-------------------
echo "-------------ScRIPT PROVIDES WHAT ALL HAS BEEN DONE DURING APPLICATION OF PATCH--------------------------"
sqlplus apps/<apps_passwd> << EOF
Select J.PATCh_NAME, H.APPLICATIONS_SYSTEM_NAME Instance_Name, H.NAME, I.DRIVER_FILE_NAME, D.APP_SHORT_NAME appl_top,D.SUBDIR, D.FILENAME, max(F.VERSION) latest, E.ACTION_CODE action from AD_BUGS A, AD_PATCH_RUN_BUGS B,AD_PATCH_RUN_BUG_ACTIONS C, AD_FILES D, AD_PATCH_COMMON_ACTIONS E, AD_FILE_VERSIONS F, AD_PATCH_RUNS G,
AD_APPL_TOPS H, AD_PATCH_DRIVERS I, AD_APPLIED_PATCHES J where A.BUG_ID = B.BUG_ID and
B.PATCH_RUN_BUG_ID = C.PATCH_RUN_BUG_ID and C.FILE_ID = D.FILE_ID and E.COMMON_ACTION_ID = C.COMMON_ACTION_ID
and D.FILE_ID = F.FILE_ID and G.APPL_TOP_ID = H.APPL_TOP_ID and G.PATCH_DRIVER_ID = I.PATCH_DRIVER_ID and
I.APPLIED_PATCH_ID = J.APPLIED_PATCH_ID and B.PATCH_RUN_ID = G.PATCH_RUN_ID and C.EXECUTED_FLAG = 'Y' and
G.PATCH_DRIVER_ID in (select PATCH_DRIVER_ID from AD_PATCH_DRIVERS where APPLIED_PATCH_ID
in (select APPLIED_PATCH_ID from AD_APPLIED_PATCHES where PATCH_NAME = 'merged'))
GROUP BY J.PATCH_NAME, H.APPLICATIONS_SYSTEM_NAME, H.NAME, I.DRIVER_FILE_NAME, D.APP_SHORT_NAME, D.SUBDIR,
D.FILENAME, E.ACTION_CODE;
exit
EOF

OTM Installation Steps

1. Download database software(11.2.0.1.0) from edelivery.oracle.com

[oraotm@server database]$ ./runInstaller

2.a) Install and configure database.

[oraotm@server ~]$ vi .bash_profile

export ORACLE_BASE=/otm/oracle
export ORACLE_SID=otmdb
export ORACLE_HOME=/otm/oracle/product/11.2.0
PATH=/usr/java/jdk1.6.0_38/bin:$ORACLE_HOME/bin:$PATH:$HOME/bin

[oraotm@server dbs]$ orapwd file='$ORACLE_HOME/dbs/orapwotmdb' password=sys entries=5 force=y;

Edit listener.ora and tnsnames.ora as per document "The listener supports no services"

[oraotm@server ~]$ lsnrctl start otmdb

Make sure that system user connect with manager password.

2.b) Install oracle database client software(11.2.0.1.0).

Refer this pdf : Install_OTM_on_OEL5.2_64bit.pdf

3. Install Oracle Weblogic Server(10.3.6). Don't configure(ie) uncheck quick start

[oraotm@server /]$ java -jar wls1036_generic.jar

4. Install and configure Oracle HTTP Server(11.1.1.7.0) or called as WebTier. For that refer "http://www.otmfaq.com/forums/blogs/josephliang/27-install-otm-6-3-1-windows-8.html" (or) OTM installation on RHEL5.4_64bit

[oraotm@server Disk1]$ ./runInstaller

uncheck "Associate Selected Components with WebLogic Domain" and "Web cache domain" options.

OHS Component Name : otm631

5. Install OTM(6.3.1) as per the Install_OTM_on_OEL5.2_64bit.pdf

APPS Server Installation
------------------------
[oraotm@server /]$ ./otmv631_linux.bin

Webserver External port, Webserverport -> 7777 (Must match with OHS port(OHS Installation))
Webserver External FQDN,Webserver FQDN,Appserver FQDN -> server.yantro.com
Appserver port -> 7001, DB server FQDN -> server.yantro.com, DB port -> 1525, DB connect string -> otmdb.yantro.com, DB service name -> otmdb.yantro.com
Oracle home for DB client -> /otm/oracle/product/11.2.0/dbhome_1, user prefix -> /
Weblogic BEA home path -> /otm/Middleware/wlserver_10.3
Appserver ip address -> 172.19.0.30, Appserver path -> /otm/Middleware/wlserver_10.3, Appserver memory -> 2048, APP SSL port -> 7002, App laucher port -> 32001
Weblogic system password -> manager
App-to-Web authentication password -> Welcome123
GLOGDBA password -> GLOGDBA
GLOGLOAD password -> GLOGLOAD
OTM user name -> oraotm
OTM group name -> dba
OTM user home -> /home/oraotm
Migration -> no
Integration -> oracle EBS

WEB Server Installation
-----------------------
[oraotm@server /]$ ./otmv631_linux.bin

Webserver External port, Webserverport -> 7777 (Must match with OHS port(OHS Installation))
Webserver External FQDN,Webserver FQDN,Appserver FQDN -> server.yantro.com
Appserver port -> 7001, DB server FQDN -> server.yantro.com, DB port -> 1525, DB connect string -> otmdb.yantro.com, DB service name -> otmdb.yantro.com
Oracle home for DB client -> /otm/oracle/product/11.2.0/dbhome_1, user prefix -> /
Webserver ip address -> 172.19.0.30, Web SSL port -> 443, Tomcat port -> 8009, Tomcat shutdown port -> 8007, OHS Weblogic home path -> /otm/Middleware/Oracle_WT1
Tomcat memory -> 2048, OHS Server path -> /otm/Middleware/wlserver_10.3, OHS Instance home -> /otm/Middleware/Oracle_WT1/nstances/instance1, OHS component name -> otm631, Web laucher port -> 32000
Weblogic system password -> manager
App-to-Web authentication password -> Welcome123
GLOGDBA password -> GLOGDBA
GLOGLOAD password -> GLOGLOAD
OTM user name -> oraotm
OTM group name -> dba
OTM user home -> /home/oraotm
Migration -> no
Integration -> oracle EBS

Patch for Weblogic server
-------------------------
Apply recommended patchset for weblogic server 10.3.6 using following method.

[oraotm@server /]$ cd /otm/Middleware/utils/bsu
[oraotm@server bsu]$ ./bsu.sh Then close the opening window-> This will create directory /otm/Middleware/utils/bsu/cache_dir

Login to the oracle.support.com
click patches and update -> Recommended Patch Advisor ->
In that, Product= oracle weblogic server, release= 10.3.6, platform= linux x86_64
It will show patch details -> install that patchset using readme.txt
Now that weblogic_patch.jar will present and issue resolved.

[oraotm@server bsu]$ ./bsu.sh
[oraotm@server bsu]$ ./bsu.sh -install -patch_download_dir=/otm/Middleware/utils/bsu/cache_dir -patchlist=D33T -prod_dir=/otm/Middleware/wlserver_10.3

OTM Installation with Database Server
-------------------------------------

We need to configure database with OTM using install.pdf of OTM 6.3, Follow the below steps

alter system set Open_cursors = 4000 scope=both;

alter system set db_16k_cache_size = 104857600 scope=both;

cd <otm_install_path>/glog/oracle/script8

sqlplus '/as sysdba'

@create_gc3_tablespaces.sql

echo $ORACLE_SID -> otmdb
echo $NLS_LANG -> American_America.UTF8

cd <otm_install_path>/glog/oracle/script8

@create_glog_users.sql

This script creates following OTM users.
Script will also prompt for the password
for each user which will be used during
create user step.

ARCHIVE
GLOGDBA
GLOGOWNER
GLOGLOAD
REPORTOWNER
GLOBALREPORTUSER

Make sure that OTM tablespaces have been already created.
If not, hit Ctrl + C to exit this script
Press Enter to continue

Enter Connection ID:
Enter value for 1: otmdb

Enter user name (Other than SYS user) who can create new users(Press Enter for default of SYSTEM):
Enter value for 2: system

Enter password for this user:
Enter value for 3: manager

Enter password for user SYS to login as SYSDBA:
Enter value for 4: sys

Enter password for user ARCHIVE:
Enter value for 5: ARCHIVE

Enter password for user GLOGDBA:
Enter value for 6: GLOGDBA

Enter password for user GLOGOWNER:
Enter value for 7: GLOGOWNER

Enter password for user GLOGLOAD:
Enter value for 8: GLOGLOAD

Enter password for user REPORTOWNER:
Enter value for 9: REPORTOWNER

Enter password for user GLOBALREPORTUSER:
Enter value for 10: GLOBALREPORTUSER

Now user creation successful.....

Give 777 Permission for All the files including ORACLE_HOME,WL_HOME,GLOG_HOME
Eg : root@server # chmod -R 777 /otm

Edit the import_content.sh file from "sqlplus glogowner/glogowner@$SQLPLUS_CONN @post_import_content.sql >> $LOG_FILE" to "sqlplus GLOGOWNER/GLOGOWNER@$SQLPLUS_CONN @post_import_content.sql >> $LOG_FILE"

[oracle@server dbs]$ cd <otm_install_path>/glog/oracle/script8

./create_all.sh

First update the system and guest users with CHANGEME password.(USING 1549075.1)
Use following Query,
[oraotm5@server script8]$ java glog.util.appclass.Base64Encoding CHANGEME
<Q0hBTkdFTUU=>
[oraotm5@server script8]$ vi /otm/otm/tomcat/bin/tomcat.conf
jvm.arg=-DGC3EncodedPassword=Q0hBTkdFTUU=
jvm.arg=-DGuestEncodedPassword=Q0hBTkdFTUU=
[oraotm5@server script8]$ vi /otm/otm/weblogic/weblogic.conf
var.WL_PW=CHANGEME
jvm.arg=-DGC3EncodedPassword=Q0hBTkdFTUU=
jvm.arg=-DGuestEncodedPassword=Q0hBTkdFTUU=

./update_password.sh

Then restart Apps and Web server. Now working fine. Now OTM login page displayed.


Security settings :

Refer ID : 1549075.1
  1549020.1
  If you have doubt, Refer "OTM installation on RHEL5.4_64bit"



NLS Language Patche Installation Issues:

Issue:
--------

While running adadmin for maintain multilingual table it shows 8 workers failed.

Solution:
------------------

appljr12@server1 # vi $APPL_TOP/admin/jr12/log/adworker001.log
it shows

Issue 1

MESG
--------------------------------------------------------------------------------
LANGUAGE=AMERICAN
PACKAGE=FND_DESCR_FLEX_COL_USAGE_PKG
SQLERRM=ORA-01652: unable to extend temp segment by 16 in tablespace APPS_TS_SEED

select to_date('ERROR') * ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected
--------------------------------------------------------------------------------------

[root@server1 ~]# su - orajr12
[orajr12@server1 ~]$ sqlplus '/as sysdba'

SQL*Plus: Release 11.1.0.7.0 - Production on Sun Jul 1 02:04:37 2012
Copyright (c) 1982, 2008, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select file_name from dba_data_files where tablespace_name='APPS_TS_SEED';

FILE_NAME
--------------------------------------------------------------------------------
/jr12/d02/oracle/jr12/db/apps_st/data/reference1.dbf
/jr12/d02/oracle/jr12/db/apps_st/data/reference2.dbf
/jr12/d02/oracle/jr12/db/apps_st/data/reference3.dbf

SQL> ALTER TABLESPACE APPS_TS_SEED ADD DATAFILE '/jr12/d02/oracle/jr12/db/apps_st/data/reference4.dbf' size 1024M;

Tablespace altered.

  1. Tell worker to restart a failed job
Issue 2

MESG
--------------------------------------------------------------------------------
LANGUAGE=AMERICAN
PACKAGE=FND_DESCR_FLEX_COL_USAGE_PKG
SQLERRM=ORA-12801: error signaled in parallel query server P004
ORA-01658: unable to create INITIAL extent for segment in tablespace APPS_TS_SEED

select to_date('ERROR') * ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected

SQL> ALTER TABLESPACE APPS_TS_SEED ADD DATAFILE '/jr12/d02/oracle/jr12/db/apps_st/data/reference4.dbf' size 1024M INITIAL 128M AUTOEXTEND ON;

  1. Tell worker to restart a failed job
Issue 3

MESG
--------------------------------------------------------------------------------
LANGUAGE=AMERICAN
PACKAGE=WF_MESSAGE_ATTRIBUTES_PKG
SQLERRM=ORA-01654: unable to extend index APPLSYS.WF_MESSAGE_ATTRIBUTES_TL_PK by 16 in tablespace APPS_TS_SEED

select to_date('ERROR') * ERROR at line 1:
ORA-01858: a non-numeric character was found where a numeric was expected

SQL> select file_name, bytes, autoextensible, maxbytes from dba_data_files where tablespace_name='APPS_TS_SEED';

SQL> ALTER TABLESPACE APPS_TS_SEED ADD DATAFILE '/jr12/d02/oracle/jr12/db/apps_st/data/reference5.dbf' size 1024m autoextend on next 200m maxsize 1024m;

Tablespace altered.

  1. Tell worker to restart a failed job
Now applied patches successfully..........

Apache Bounce Script For R12

echo "status of the adapcctl : "
$ADMIN_SCRIPTS_HOME/adapcctl.sh status apps/apps
echo "status of the adoacorectl : "
$ADMIN_SCRIPTS_HOME/adoacorectl.sh status apps/apps
answer="$1"
echo $answer
if [ $answer ]
then
echo "Compiling the jsp : "
$COMMON_TOP/_pages
rm *$answer
cd $FND_TOP/patch/115/bin
perl ojspCompile.pl --compile -s $answer
echo "jsp compilation is done"
$ADMIN_SCRIPTS_HOME/adapcctl.sh stop apps/apps
echo "adapcctl is stopped successfully"
$ADMIN_SCRIPTS_HOME/adoacorectl.sh stop apps/apps
echo "adoacorectl is stopped successfully"
$ADMIN_SCRIPTS_HOME/adapcctl.sh start apps/apps
echo "adapcctl.sh is started successfully"
$ADMIN_SCRIPTS_HOME/adoacorectl.sh start apps/apps
echo "adoacorectl is started successfully"
else
echo "Cache not cleared and null value should not be the input for Apache_bounce"
fi

Tuesday 11 June 2013


Oracle Apps 11i / R12 Training Document

Introduction to Oracle E-business Suite

  • Oracle E-Business suite (ERP, SCM, CRM)
  • Introduction to oracle family suites
  • Oracle Applications & Oracle Applications technology stack
  • Introduction to form based and java based applications.

Introduction to Oracle E- Business Suite Architecture.

  • Concepts and Architecture ICA Two Tier/Three Tier & fusion
Architecture single node/multi node
  • Introduction to oracle Apps Tier components (Apache IAS
server, form server, concurrent processing server)
  • DB Tier component database server

Introduction to E-Business Suite 11i/ R12 File System and Directory

Structure, EBS Data Model

Oracle EBS Application Modules:

  • Business Specific Module and Technology Specific Module

Installation of Oracle E-Business Suite applications 11i/R12

  • Pre & Post Steps/Checklist of installation, Single/Multi node
Installation. Creation of Oracle E-Business Suite Stage

EBS Backup & Recovery

  • Planning, Testing and Implementing EBS Applications and
database backups and restores/recovery.

SYSADMIN MODULE

  • Creation of Users
  • Assigning Responsibilities to users
  • Creation of Custom Responsibilities
  • Creation of request group
  • Creation of data group
  • Creation of Custom Application
  • Managing Concurrent Programs & Reports
  • Administrating Concurrent Managers
  • Administrating Concurrent Managers
  • Creation of Custom Concurrent Manager
  • Managing Profiles Options
  • Structure of Profiles
  • Seeded Profiles
  • Custom Profiles
  • Managing Flex Fields (KFF, DFF)
  • Managing Printers
  • Managing the Workflows activities (Notifications/Mailer)

Oracle EBS UTILITIES

  • AD Administration (Adadmin)
  • Auto Patch (Ad patch)
  • AD Merge Patch (admrgpch)
  • AD Controller (adctrl)
  • AD File Identification (adident)
  • AD Rilink (adrelink.sh)
  • AutoConfig (adconfig.sh)
  • AD Splice
  • FNDCPASS
  • FNDLOAD

Oracle Applications Manager (OAM)

  • Oracle Applications Manager Features
  • Managing/Monitoring EBS system through OAM console

Managing EBS Application Patches

  • Introduction
  • Structure of a Patch file & Patch drivers Searching
  • Downloading & applying patches
  • Pre & Post Steps Checks
  • Patch History
  • Monitoring & Troubleshooting Patch session
  • Reducing Patching Time :- (Merging Patches, Patching Non-
  • Interactively, Patching on Shared Apps Tier Using Distributed
  • AD Features, Patching on Stage Instance)
  • Troubleshooting Scenarios of Failed Patches and Hanging
  • Patch Session.

Cloning:

  • Cloning the existing EBS System Types & Methods of
Cloning:-( Adclone, Rapidclone, OAMclone)
  • Cloning Single Node to Single Node with Refresh / Partial
Cloning
  • Single Node to Multiple Node
  • Multi Node to Single Node (With / Without Shared Apps Tier)
  • Online Cloning / Hot Cloning and Troubleshooting Cloning
Issues.

Performance Tuning:

  • Proactive Performance Management:-
  • Oracle EBS Health Management
  • Effective EBS Configuration
  • Routine/ Daily tasks
  • Proactive Monitoring Troubleshooting Performance Issues
  • Tracing forms and concurrent program session

Up gradation of Oracle E-Business Suite & Database:

  • Upgrading EBS 9i database to 10g rel2 and Upgrading EBS
11.5.10.2 to R12, Upgrade Pre and Post steps, Troubleshooting Upgrade Issues

Troubleshooting:

  • Resolving issues like Login & Connectivity Issues
  • Files Corruption/Missing
  • Performing AOL/J diagnostic test
  • Gathering Diagnostic data using RDA tool
  • Working with Oracle Support Services for raising SRs (Service
Requests)

Conclusion:

  • Resume Preparation
  • Real Time Scenarios
  • Documents