Wednesday, January 28, 2009

Concurrent Manager-1

Hi All.
We all are using concurrent programs ..but might have never put much thought into concurrent manager details....
We know that there are concurrent managers running in background which will be processing the concurrent programs submitted.
Basically they are three managers
1.Internal Manager
2.Standard Manager
3.Conflict manager
First let us see few scenarios..
1.In a instance when ever we are submitting multiple request only few are running.. why?
2.I have some reports which need to be run only in month end .how should I design this??
3.If two modules are submitting programs..and one is submitting more..provison should be made to make others are also submit program and they are get processed.
One user of GL submitted 100 reports…which takes time.. at the same time user2 need a few of reports also processed…How to setup so that both can run their reports

For developer point of view the most concerned one should be standard manager and Defining New Manager
First look at standard manager options..then i will come to how to handle the above scenarios..


Let see what is cache size..it is the number of concurrent programs it will select and keep in the queue.that means even you submit a program with higer priority it will be queues after the cache sized program only…
Press the workshift button which will say when the concurrent manager will be running…
In this note the number of process, it will be decide how many concurren program will be running at a time..dont increase number substantially high it depends on lot of parameters
Like server size and number of nodes…check with you DBA before changing to very high value…


Press the specialization rules button to see the programs which need to be excluded or included in the concurrent manager queue..by default all the custom concurrent programs will be running under standard manager;….

Tuesday, January 27, 2009

Concurrent Program LOCKs..

Hi All,

Now a days i am developing a concurrent program...while developing in some scenarios the concurrent program is not completingso i want to terminate,make some corrections and resubmit my program..even i terminate, the lock on my object are not getting releasedso i need to find the locked session and terminate the session...i thought of getting the information of session which i am currently using from oracle applications GUI itself but no information of session is available in front end...then i figured out that oraclesession and oracle_process_id are two columns in fnd_concurrent requests.
query1:select concurrent_program_name,fcr.REQUESTED_START_DATE, oracle_process_id,oracle_Session_id from FND_CONCURRENT_REQUESTS fcr,fnd_concurrent_programs fcp,fnd_logins fl,fnd_user fuwhere fcr.CONCURRENT_PROGRAM_ID=fcp.CONCURRENT_PROGRAM_ID and fcr.CONC_LOGIN_ID=fl.login_idand fl.user_id=fu.user_id--and fcr.request_id=441792and fu.user_name='MGANJAM'order by fl.start_time desc
query2select sql_text, sid, SERIAL# from v$session vs,v$sqltext vsql,applsys.fnd_concurrent_requests fcrwhere vs.sql_hash_value=vsql.hash_valueand fcr.ORACLE_SESSION_ID=vs.AUDSIDand fcr.request_id = '442686'
This query will give the the sql it is running and the SID and serial#
Select * from v$locked_objects
check where any lock exists for the session
then use the alter system kill session to kill the session and the lock will be release
Now you will be able to compile the object...

Thursday, January 22, 2009

SQL Loader in Oracle Applications(Draft)

SQL Loader in Oracle Applications…

Step1:create a Sqlloader file.(the ctl file)

Step2:Create a executable with Execution method type as SQLLOADER

Step3:move .ctl file to executable application top bin folder
For example for GL it is GL_TOP/bin
Step4.Create a program for the executable with paramertes like file name..

Step6:Attach the concurrent program to a request group and the run the program..

The one point that comes in mind how to acess the concurrent program parameters in sqlloader..it is using %1


LOAD DATA
INFILE '%1'
BADFILE '%1.bad'
DISCARDFILE '%1.dis'
TRUNCATE
INTO TABLE GL_DOW_TRANS
(
VOTE POSITION(01:16) INTEGER EXTERNAL,
AMOUNT POSITION(18:30) INTEGER EXTERNAL,
PERIOD POSITION(35:38) INTEGER EXTERNAL
)

Copying Files using PLSQL

Hi all
Most of the time we have requirement of moving files….we normally use the Shell script to move the files…
It is not mandatory we need to use shell scripts.
There are plsql api’s which can move files from one location to other location..

I think every one is aware of UTL_FILE .even it has some limitations…like the directory strucuture used by it should be in the UTL_FILE_PATH in init.ora …or Directory object should exist for that path…

For copying the file..
Utl_File.Fcopy ( src_location => p_file_location
,src_filename => p_file_name
, dest_location => p_arch_location,
dest_filename => p_arch_file );

For removing the file..:

UTL_FILE.Fremove(p_file_location,lc_datafile_name);

We can use this package when the directories are fixed and only file movement should happen..if you want to create directories at run time
I think shell scripting is a better option…

Tuesday, January 20, 2009

FND_GLOBAL PACKAGE

Recently i come accross a requirement to capture the requestidof the concurrent with in the concurrent program session...Even i am aware of the FND_GLOBAL package...But it didnt strike'at first go.....so i am writing this article for people who are not even awarethat this package exists..
FND_GLOBAL package gives the most of the enviroment values
THis package should be used in database side only...use FND_PROFILE package to get these values in Forms.
1.FND_GLOBAL.USERID --Returns userid

2.FND_GLOBAL.APPS_INTIALIZEprocedure APPS_INITIALIZE(user_id in number,resp_id in number,resp_appl_id in number);
This is used to set the values userid and responsibilityid for a session
3.FND_GLOBAL.LOGIN_ID -Gives login id
4.FND_GLOBAL.CONC_LOGIN_ID--Not sure how to use this
5.FND_GLOBAL.PROG_APPL_ID--Concurrent program application id
6.FND_GLOBAL.CONC_PROGRAM_ID--Concurrent program id
7.FND_GLOBAL.CONC_REQUEST_ID (Server)This will give the concurrent request id of the program which is calling the plsql package..

ln_Request_id:=FND_GLOBAL.CONC_REQUEST_ID;

How to Register a shell script in oracle Applications???

I am putting this basics for people like me who are poor in unix…and not confident in doing shell scripting..:)
we dont need to develop huge scripts in apps..most of the times it will be moving files between servers or deleting files after completion…
Recently I developed a few scripts for moving files after program completion like output to some other folder…

$1 connect String
$2 Userid
$3-
$4 Concurrent request id


Step1:
Create a shell script .If the shell script is supposed to get values from the concurrent program parameters defined ,they can be accessed using $5,$6 onwards

Step2:Create a executable in application
With execution method as host

Step3:Create the concurrent program for this executable

Step 4:Attach the Program to a request group
Step5:Now move the shell script to the bin folder for the corresponding application top of the executable..make sure that file type is .prog not .sh
For example : General ledger application executable.. then GL_TOP/bin

Step6:Change the permission on the file..
Chmod 775 file if it doesn’t work chmod 777 XX_TEST.prog

Step7: Create a soft link between the shell the shell script and the concurrent manager

ln -s $FND_TOP/bin/fndcpesr XX_TEST

Step7:Run the concurrent program


One more thing if you want the message to seen for debugging it can be done using
Echo command….
echo $MONTH