invite friends  Invite Friends RECRUITER : Login | Register | Post Job | Search Resume   
Forum
Home >> Shell Script Usage in Oracle Applications
Add New  
Shell Script Usage in Oracle Applications
Replies
Author
Last Post
concurrent programs in oracle apps

For Beginners - http://getappstraining.blogspot.com.

Lets first discuss the below scenario



Being a developer, you have just developed a SQL script or a PL/SQL package procedure. The end user wants to be able to run this script ad-hoc or they wish to schedule this to run every night.



Question : How can an end-user be given control to run a script developed by a developer, given that an end user will never have access to apps password(and rightly so)?

Answer: This script can be attached to a Concurrent Program via a concurrent program executable. The user will then be given access to this Concurrent Program.



Question : But how will the end user or Oracle Apps make this script run every 10hours daily?

Answer : A concurrent program can be scheduled to run at desired intervals. The schedule is defined at the time of submission.



Question: What are the different types of scripts/programs that can be attached to concurrent programs?

Answer :

A sql script

A Sql*Loader program

Java program

Oracle Report

Pl/SQL program ( or call it a stored procedure/package procedure)

Host script, like a unix shell script

Pro*C/Spawned

Perl



Question: What are the basic steps when defining a concurrent program.

Answer: Broadly speaking there are three steps when developing a concurrent program in Oracle Apps

Step 1. Make Oracle Apps identify the executable

Step 2. Provide a handle to the executable by means of defining a concurrent program

Step 3. Make this concurrent program accesible to selected users via their responsibility.



Question: Please can you describe the above steps in detail

Answer:

Step 1. Make Oracle Apps identify the executable

In Oracle Apps we have something called as concurrent program executable. Concurrent program executable is defined to register a script or a procedure for its usage within oracle apps.

Step 2. Provide a handle to the executable by means of defining a Concurrent Program.

We need to define a concurrent program and attach that to the executable defined in above step.

Step 3. Make this concurrent program accesible to selected users via their responsibility.

We do this by adding the concurrent program to something called as request group. The request group is either associated with a responsibility or is passed in as a parameter to the function request form function. Don't worry if you do not understand this step, I will be writing a dedicated article to explain this step.



Question : Please explain the steps for defining a pl/sql concurrent program, with screenshots and with almost real life example?

refer - http://oracle.anilpassi.com/concurrent-programs-in-oracle-apps.html
1 William Hill William Hill
Mon Aug 02, 2010
migrating tables

Hi,

I am using Export Import for migrating tables of Oracle 11.0.3 to Oracle 11.5.9. The problem that I am facing is that when I am calling the Shell Script from Oracle Apps Environment I am getting the error:-
2 William Hill William Hill
Mon Aug 02, 2010
Scripts

SQL script to generate Item Cross References -


http://www.sap-img.com/oracle-database/sql-script-to-generate-item-cross-references.htm



SQL query to display Items in a multi-org setup which have been created or modified within the past 30 days, or which will be made effective at some future date -


http://www.sap-img.com/oracle-database/sql-query-to-display-items-in-a-multi-org-setup.htm



Script to load or convert Notes/Attachments associtaed with items -


http://www.sap-img.com/oracle-database/script-to-load-convert-notes-attachments-associtaed-with-items.htm
1 William Hill William Hill
Mon Aug 02, 2010
Script to change check numbers at the table level

http://www.sap-img.com/oracle-database/script-to-change-check-numbers.htm
1 William Hill William Hill
Mon Aug 02, 2010
Oracle Purchasing

Script to enable attachments for a custom Form in PO - http://www.sap-img.com/oracle-database/script-to-enable-attachments-for-custom-form-in-po.htm

Example of Extract Query - http://www.sap-img.com/oracle-database/example-of-extract-query.htm
1 William Hill William Hill
Mon Aug 02, 2010
How to register shell script as concurrent program?

Below is the step by step process of registering shell script as a host program or concurrent program in Oracle Applications.









1. Create a shell script ( say xyz) and move it to the appropriate BIN directory in Oracle Application.




2. The parameters in the shell scripts should start with $5 , $6 Onwards.




3. Rename the shell script to *.prog' target='_blank'>*.prog ( xyz.prog).




4. Change Permissions to 755 for the *.prog' target='_blank'>*.prog file.




5. Create Link to the shell Script ( ln -s $FND_TOP/bin/fndcpesr/xyz.prog) to create xyz file.




6. Now Register this executable in the application as a host executable (Using System Administrator Responsibility).









While registering the shell script as a concurrent program make sure that the first parameter in the concurrent program is passed as the Fifth parameter in the shell scripts because the first four parameters are allocated to userid,request_id,resp_id,resp_appl_id.




source :http://www.aboutoracleapps.com/2009/01/how-to-register-shell-script-as.html
1 William Hill William Hill
Mon Aug 02, 2010
Shell Script Tutorial for Oracle Applications

http://knoworacle.wordpress.com/2009/06/12/shell-script-tutorial-for-oracle-applications/
1 William Hill William Hill
Mon Aug 02, 2010
Oracle Applications Steps To Register Shell Script As A Concurrent Program

There are two methods to handle, one with symbolic link another without symbolic link.





step 1: Place the .prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog script under the bin directory for your applications top directory.For example, call the script SHELLDEMO.prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog and place it under $XXCUS/bin





step 2: Make a symbolic link from your script to $FND_TOP/bin/fndcpesr. For example, if the script is called SHELLDEMO.prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog use this:





ln -s $FND_TOP/bin/fndcpesr SHELLDEMO





This link should be named the same as your script without the .prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog extension.





Put the link for your script in the same directory where the script is located.





step 3: Register the concurrent program, using an execution method of ‘Host’. Use the name of your script without the .prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog extensionas the name of the executable.





For the example above: Use SHELLDEMO





step 4: Your script will be passed at least 4 parameters, from $1 to $4.





$1 = orauser/pwd





$2 = userid(apps)





$3 = username,





$4 = request_id





Any other parameters you define will be passed in as $5 and higher. Make sure your script returns an exit status also.





Sample Shell Script: - http://www.notesbit.com/index.php/scripts-oracle/oracle-applications-steps-to-register-shell-script-as-a-concurrent-program/
1 William Hill William Hill
Mon Aug 02, 2010
Shell Script Tutorial for Oracle Apps

1.






Steps to Register Shell Script as a concurrent program






2.






Sample Shell Script to copy the file from source to destination






3.






Basic Shell Script Commands













Steps to Register Shell Script as a concurrent program













step 1:






=======






Place the .prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog script under the bin directory for your






applications top directory.













For example, call the script ERPS_DEMO.prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog and place it under






$CUSTOM_TOP/bin













step 2:






=======






Make a symbolic link from your script to $FND_TOP/bin/fndcpesr






For example, if the script is called ERPS_DEMO.prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog use this:













ln -s $FND_TOP/bin/fndcpesr ERPS_DEMO













This link should be named the same as your script without the






.prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog extension.













Put the link for your script in the same directory where the






script is located.













step 3:






=======






Register the concurrent program, using an execution method of






'Host'. Use the name of your script without the .prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog extension






as the name of the executable.













For the example above:






Use ERPS_DEMO













step 4:






=======






Your script will be passed at least 4 parameters, from $1 to $4.













$1 = orauser/pwd






$2 = userid(apps)






$3 = username,






$4 = request_id













Any other parameters you define will be passed in as $5 and higher.






Make sure your script returns an exit status also.













Sample Shell Script to copy the file from source to destination













#Note: If you see # in front of any line it means that its a comment line not the actual code






#** ********************************************************************






# Created By : Suresh Veluru






# Creation Date : 05-JUL-2009






# Script Name : ORACLEAREA51.prog' target='_blank'>.prog' target='_blank'>.prog' target='_blank'>.prog






# Description : This Script accepts three parameters






# 1)Data File Name 2)Source Directory Path 3)Target Directory Path






# Then copy the file from source location to target location.






# If copy fails send the error status/message to concurrent program so that user can see status.






#






#






# ========






# History






# ========






# Version 1 Suresh Veluru 05-JUL-2009 Created for oraclearea51.com users






#






#** ********************************************************************






#Parameters from 1 to 4 i.e $1 $2 $3 $4 are standard parameters






# $1 : username/password of the database






# $2 : userid






# $3 : USERNAME






# $4 : Concurrent Request ID






DataFileName=$5






SourceDirectory=$6






TargetDirectory=$7






echo "--------------------------------------------------"






echo "Parameters received from concurrent program .."






echo " Time : "`date`






echo "--------------------------------------------------"






echo "Arguments : "






echo " Data File Name : "${DataFileName}






echo " SourceDirectory : "${SourceDirectory}






echo " TargetDirectory : "${TargetDirectory}






echo "--------------------------------------------------"






echo " Copying the file from source directory to target directory..."






cp ${SourceDirectory}/${DataFileName} ${TargetDirectory}






if [ $? -ne 0 ]






# the $? will contain the result of previously executed statement.






#It will be 0 if success and 1 if fail in many cases






# -ne represents not "equal to"






then






echo "Entered Exception"






exit 1






# exit 1 represents concurrent program status. 1 for error, 2 for warning 0 for success






else






echo "File Successfully copied from source to destination"






exit 0






fi






echo "****************************************************************"













Basic Shell Script Commands













# Create Directory






mkdir






# Remove Directory






rmdir






#remove folder with files






rm -r -f






# Change Directory






cd






# Create new file






vi






#insert data into file






vi






esc i






#Save file






esc :wq enter






# exit with out saving changes






esc :q! enter






# open existing file






vi






#remove file






rm






# copy file with same name






cp /






# copy file with new name






cp / /






# Move file with same name






mv /






# move file with data appended to filename in the front






mv / /`date+%H%M%d%m%y`






#print line






echo "your text here to print"






#print date






echo `date`
2 William Hill William Hill
Mon Aug 02, 2010
shell script

A shell script is a script written for the shell, or command line interpreter, of an operating system. It is often considered a simple domain-specific programming language. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.

Many shell script interpreters double as command line interface, such as the various Unix shells, Windows PowerShell or the MS-DOS COMMAND.COM. Others, such as AppleScript or the graphical Windows Script Host (WScript.exe), add scripting capability to computing environments without requiring a command line interface. Other examples of programming languages primarily intended for shell scripting include DCL and JCL.
1 William Hill William Hill
Mon Aug 02, 2010