Thursday, May 31, 2012

Setup & Instructions to Run - PYUPIP HR Trace in the Applications

Metalink Note: 301343.1




---------------------------------------------------------------------------



STEP ONE - Setting up PYUPIP and HR Trace to run within the applications

---------------------------------------------------------------------------

1a. Check to see if HR TRACE is already setup as an option off of the Toolbar.

Navigate from within your HR responsibility to the screen which is throwing your error.

Once in the screen ... go to ...

Tools> HR Trace

If the 'HR Trace' function is NOT there, continue with steps 1b - 1c

else, you are done with 'STEP ONE'



1b.Create a function with the name of HR_DEBUG_TOOLS

As System Administrator responsibility navigate to

Application > Function

from the 'Description' Tab :

Function = HR_DEBUG_TOOLS

User Function Name = HR_DEBUG_TOOLS

Description = PYUPIP function

from the 'Properties' Tab :

Type = SUBFUNCTION

Maintenance Mode Support = None

Context Dependence = Responsibility



Add nothing to the other Tabs: ie Form, Web HTML, Web Host, Region

save your changes



1c.Add the 'HR_DEBUG_TOOLS' function to the navigation menu.

First find the defined Menu associated with the responsibility that the user

is using by navigating through the following steps:

As System Administrator responsibility navigate to

Security > Responsibility > Define > query the users responsibility

In the middle left of the Responsibilities form, make a note of the MENU being

called by this responsibility.



Once you know the Menu associated with the responsibility, then,

as System Administrator responsibility navigate to

Application > Menu



Query the menu that is tied to the responsibility.

Go to the last Seq (sequence) and add a new Seq (sequence) number.

Make sure you make the new Seq number much larger than the last Seq number

as HR Trace ( function HR_DEBUG_TOOLS ) should always be the last Seq number

for the menu.



Seq = your last Seq value + 200 (this should be a large enough gap)

Prompt = HR Trace

Function = HR_DEBUG_TOOLS

Description = PYUPIP



save your changes



---------------------------------------------------------------------------

STEP TWO - Running HR Trace / Trace File from within the applications

---------------------------------------------------------------------------

2a.Change responsibilities and navigate to screen where error occurs ...

and before making 'any' changes to the data ... go to ...



Tools > HR Trace > and select the following options:



HR Trace = Trace File

PL/SQL Trace = None

Bind Variable Trace = yes ( check the 'Bind Variable Trace' box )

click OK



2b.

Perform the action on the screen that throws the error, answer OK to the error,

and then stop



2c.

Go to ...

Tools > HR Trace >

click on 'Write Info' button and make note of the trace file name



2d.

The trace file should have been written to the user_dump_dest location

defined in your database.

To find your user_dump_dest location run the following script in sqlplus.



set pagesize 1000

col name for a30

col value for a42

select name, value

from v$parameter

where UPPER(name) = UPPER('user_dump_dest')

order by name;



Go to user_dump_dest location, pull the trace file

and upload the PYUPIP trace file to the tar in metalink.















The step prior to the error thrown in this trace should be the package being run

when the error occured.

The output you read will be in the format of the 'proper name' of the package.

To find the 'sql' name for the package run the following script.



Example:

If the 'proper name' of the package read from the PYUPIP trace is

' per_accrual_calc_functions.Get_Carry_Over '

then you need to know the 'sql' name for the package 'per_accrual_calc_functions'.

To find the 'sql' name, run the following script from sqlplus.



When prompted, enter the 'proper name' of the package, in this case 'per_accrual_calc_functions'.



set pagesize 1000

select name, text

from all_source

where UPPER(name) like UPPER('%&NAME%')

and owner = 'APPS'

and text like '%$Header%'

order by name;



( example of script use )

SQL> set pagesize 1000

SQL> select name, text

2 from all_source

3 where UPPER(name) like UPPER('%&NAME%')

4 and owner = 'APPS'

5 and text like '%$Header%'

6 order by name;

Enter value for name: per_accrual_calc_functions

old 3: where UPPER(name) like UPPER('%&NAME%')

new 3: where UPPER(name) like UPPER('%per_accrual_calc_functions%')

NAME

------------------------------

TEXT

----------------------------------------------------------------------

PER_ACCRUAL_CALC_FUNCTIONS

/* $Header: peaclcal.pkh 115.10 2003/01/28 16:14:05 ptitoren ship $ */

PER_ACCRUAL_CALC_FUNCTIONS



/* $Header: peaclcal.pkb 115.35 2004/02/22 23:42:08 kjagadee ship $ */



Hence, the package body throwing the error would have been peaclcal.pkb

and we would want to run a PYUPIP trace against package peaclcal.pkb

to see what part of the code was throwing the error.

--------------------------------------------------------------------------

STEP THREE - Running PYUPIP against a package

---------------------------------------------------------------------------

NOTE:

The following 'cannot be done' from the same machine and requires 2 separate desktops/laptops,

with one machine executing the PYUPIP from $PAY_TOP

and the other machine performing the application steps.



3a. From UNIX - cd to where the package that is being executed is stored.



Such as the PTO Carry Over Process - $PAY_TOP/patch/110/sql>pyusptoa.pkb

Make a back up of the package using the 'cp' Unix command



example:

cp pyusptoa.pkb pyusptoa.old



3b. After the first BEGIN statement add:

hr_utility.trace_on (null, 'enter a name')



Example

hr_utility.trace_on (null, 'ORACLE')



Compile and save the package

To compile the package, execute the package from sqlplus and commit such as



SQL> @pyusptoa.pkb

SQL> commit;



3c. From UNIX - $PAY_TOP/bin (this is where the PYUPIP utility is stored) run PYUPIP



To run PYUPIP from Unix execute the following string



PYUPIP >



Example

PYUPIP apps/apps ORACLE > PTOPYUPIP















3d. Execute whatever process that runs your package either from the application

or from sqlplus.



Watch the unix screen and you will see the package being executed.



NOTE:

Do not stop the PYUPIP utility from unix until the build completes.



3e. Be sure to turn PYUPIP off after you complete your trace OR

it will bring your database to its knees.



To turn off PYUPIP from sqlplus run the following



SQL> execute hr_utility.trace_off



3f. 'ctrl C' from the Unix prompt to kill your PYUPIP session



3g. Delete the modified PYUPIP package, rename the saved package back to the original name,

and recompile the old backed up package back to the database,

which will recompile the package with the PYUPIP trace statement now gone!!



a. delete the modified package with PYUPIP trace 'turned on' using the 'rm' command:

rm pyusptoa.pkb



b. rename your backed up package back to the original name using the 'cp' command:

cp pyusptoa.old pyusptoa.pkb



c. recompile the original package, with the PYUPIP trace statement gone, through sqlplus,

and commit:



SQL> @pyusptoa.pkb

SQL> commit;



Your PYUPIP trace output file ( from step 3c )should now tell you what section of the package code is throwing the error, and this is what needs to be looked at.



---------------------------------------------------------------------------

STEP FOUR - Running HR Trace / DBMS_PIPE from within the applications

---------------------------------------------------------------------------



4a. Enter the form you are working with.

Perform the steps necessary to cause the error, but do not do the last step

that actually causes the error.



From the Toolbar select Tools > HR Trace







Select the DBMS_PIPE button under HR Trace.

In the Pipe field, is displayed a value like PIDxx.

Make a note of the PIDxx number.



Select OK to exit the Trace form. PYUPIP is now running on this form.



4b. Open a UNIX session and from your Home Directory execute the PYUPIP command.



$PAY_TOP/bin/PYUPIP apps/ PIDXXX > output.file



Where PIDxx is the PID number recorded and output.file is whatever name you want

for the log file to be named



example:

PYUPIP apps/apps PID87 > PID87_01.txt



4c. Go back to the application and execute the error.



4d. Turn off HR Trace.

From the Tools Menu, select the HR Trace option.

Click the None button under HR Trace.

Click OK to turn off PYUPIP.



4e. Review log file to see where the error is occurring.





Friday, May 11, 2012

Oracle FNDLOAD

Oracle FNDLOAD

FNDLOAD apps/pwd 0 Y mode configfile datafile entity [ param ... ]

: The APPS schema and password in the form username/password[@connect_string].
■< 0 Y > : Concurrent program flags
■mode : UPLOAD or DOWNLOAD. UPLOAD causes the datafile to be uploaded to the database. DOWNLOAD causes the loader tofetch rows and write them to the datafile.
: The configuration file to use (usually with a suffix of .lct, but not enforced or supplied by the loader)
: The data file to write (usually with a suffix of .ldt, but not enforced or supplied by the loader). If the data file already exists, it will be overwritten.
: The entity(ies) to upload or download. When uploading, you should always upload all entities, so specify a “-” to upload all entities.
■< [param] > : Zero or more additional parameters are used to provide bind values in the access SQL (both UPLOAD and DOWNLOAD). Each parameter is in the form NAME=VALUE. NAME should not conflict with an attribute name for the entities being loaded.

Here are the FNDLOAD Scripts to Migrate 15 different AOL Entities

1.Profile Options
2.Forms
3.Functions
4.Menus
5.Responsibilities
6.Request Groups
7.Request Sets
8.Lookups
9.Valuesets
10.Descriptive Flexfields
11.Key Flexfields
12.Concurrent Programs
13.Form Personalization
14.Fnd Users
15.Alerts

1.Profile Options:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct XXPRNAME.ldt
PROFILE PROFILE_NAME=”XXPRNAME” APPLICATION_SHORT_NAME=”PN”

Target:
FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct XXPRNAME.ldt
FNDLOAD apps/apps 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/afscprof.lct XXPRNAME.ldt PROFILE PROFILE_NAME=” XXPRNAME” APPLICATION_SHORT_NAME=”PN”

2.Forms:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XXFRMNAME.ldt FORM APPLICATION_SHORT_NAME=”PN” FORM_NAME=”XXFRMNAME”

Target:
FNDLOAD apps/apps 0 Y UPLOAD @FND:patch/115/import/afsload.lct XXFRMNAME.ldt

3.Functions:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XXFUNNAME.ldt FUNCTION FUNC_APP_SHORT_NAME=”PN” FUNCTION_NAME=”XXFUNNAME”

Target:
FNDLOAD apps/apps O Y UPLOAD @FND:patch/115/import/afsload.lct XXFUNNAME.ldt

4.Menus:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct XXMNNAME.ldt MENU MENU_NAME=”XXMNNAME”

Target:
FNDLOAD apps/apps 0 Y UPLOAD @FND:patch/115/import/afsload.lct XXMNNAME.ldt

5.Responsibilities:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct XXRESNAME.ldt FND_RESPONSIBILITY RESP_KEY=”XXRESNAME”

Target:
1. FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct XXRESNAME.ldt

2.FNDLOAD apps/apps 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/afscursp.lct XXRESNAME.ldt FND_RESPONSIBILITY RESP_KEY=”XXRESNAME” APPLICATION_SHORT_NAME=”PN”

6.Request Groups:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct XXRQGNAME.ldt REQUEST_GROUP REQUEST_GROUP_NAME=”XXRQGNAME” APPLICATION_SHORT_NAME=”PN”

Target:
1. FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcpreqg.lct XXRQGNAME.ldt
2. FNDLOAD apps/apps 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/afcpreqg.lct XXRQGNAME.ldt REQUEST_GROUP REQUEST_GROUP_NAME=”XXRQGNAME” APPLICATION_SHORT_NAME=”PN”

7.Request Sets:
Source:
1. FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XXRQSNAME.ldt REQ_SET REQUEST_SET_NAME=”XXRQSNAME”

2. FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XXRQSLNAME.ldt REQ_SET_LINKS REQUEST_SET_NAME=”XXRQSNAME”

Target:
1.FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct XXRQSNAME.ldt
2.FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct XXRQSLNAME.ldt

8.Lookups:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct XXLKPNAME.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME=”PN” LOOKUP_TYPE=”XXLKPNAME”

Target:
1.FNDLOAD apps/apps 0 Y UPLOAD aflvmlu.lct XXLKPNAME.ldt
2.FNDLOAD apps/apps 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/aflvmlu.lct XXLKPNAME.ldt FND_LOOKUP_TYPE LOOKUP_TYPE=”XXLKPNAME” APPLICATION_SHORT_NAME=”PN”

9.Value sets:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XXVALSNAME.ldt VALUE_SET FLEX_VALUE_SET_NAME=”XXVALSNAME”

Target:
1.FNDLOAD apps/apps 0 Y UPLOAD afffload.lct XXVALSNAME.ldt
2.FNDLOAD apps/apps 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/afffload.lct XXVALSNAME.ldt VALUE_SET FLEX_VALUE_SET_NAME=”XXVALSNAME” APPLICATION_SHORT_NAME=”PN”

10.Descriptive Flex-fields:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XXDFFNAME.ldt DESC_FLEX P_LEVEL=’COL_ALL:REF_ALL:CTX_ONE:SEG_ALL’ APPLICATION_SHORT_NAME=”PN”

DESCRIPTIVE_FLEXFIELD_NAME=”PN_LEASE_DETAILS” P_CONTEXT_CODE=”Global Data Elements”
Target:
FNDLOAD apps/apps 0 Y UPLOAD @FND:patch/115/import/afffload.lct XXDFFNAME.ldt

11.Key Flex-fields:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct XXKFFNAME.ldt KEY_FLEX P_LEVEL=’COL_ALL:FQL_ALL:SQL_ALL:STR_ONE:WFP_ALL:SHA_ALL:CVR_ALL:SEG_ALL’
APPLICATION_SHORT_NAME=”FND” ID_FLEX_CODE=”key flex code” P_STRUCTURE_CODE=”structure name”

Target:
FNDLOAD apps/apps 0 Y UPLOAD @FND:patch/115/import/afffload.lct XXKFFNAME.ldt

12.Concurrent Programs:
Source:
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XXCPNAME.ldt PROGRAM APPLICATION_SHORT_NAME=”PN” CONCURRENT_PROGRAM_NAME=”XXCPNAME”

Target:
1.FNDLOAD apps/apps 0 Y UPLOAD @FND:patch/115/import/afcpprog.lct XXCPNAME.ldt
2.FNDLOAD apps/apps 0 Y UPLOAD_PARTIAL $FND_TOP/patch/115/import/afcpprog.lct XXCPNAME.ldt PROGRAM CONCURRENT_PROGRAM_NAME=”XXCPNAME” APPLICATION_SHORT_NAME=”PN”

13.Form Personalization:
Source:
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct XXFPNAME.ldt FND_FORM_CUSTOM_RULES function_name=”XXFPNAME”

Target:
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct XXFPNAME.ldt
14.FND Users:

Source:
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct ./XXUSERNAME.ldt FND_USER USER_NAME=’XXUSERNAME’

Target:
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct ./ XXUSERNAME.ldt

15.Alerts:
Source:
FNDLOAD apps/apps 0 Y DOWNLOAD $ALR_TOP/patch/115/import/alr.lct XXALERTNAME.ldt ALR_ALERTS APPLICATION_SHORT_NAME=PER Alert_name=”XXALERTNAME”

Target:
FNDLOAD apps/apps 0 Y UPLOAD $ALR_TOP/patch/115/import/alr.lct XXALERTNAME.ldt ALR_ALERTS APPLICATION_SHORT_NAME=PER Alert_name=”XXALERTNAME”