Oracle Cloud offers a broad portfolio of software as a service applications, platform as a service, and social capabilities, all on a subscription basis. Oracle Cloud delivers instant value and productivity for end users, administrators, and developers alike through functionally rich, integrated, secure, enterprise cloud services.
 Get a Free Magzine ...Profit:The Executive's Guide to Oracle Applications

Subscribe to the OracleAppsHub to receive notifications when there are new posts:

 get RSS feed
 Oracle Fusion Applications (OFA) is a portfolio of next generation suite of software applications from Oracle Corporation. It is distributed across various product families; including financial management, human capital management, customer relationship management, supply chain management, procurement, governance, and project portfolio management
 Get a Free Magzine ...Profit:The Executive's Guide to Oracle Applications

UNIX Shell Scripting for OracleApps Techies

Posted on May 11th, 2007 by Sanjit Anand ||Email This Post Email This Post

Have you tried OracleappsHub in ipad/iphone/smart Phone? Don't wait. try it today

In Unix there are many ways to accomplish a given task. Given a problem to solve, we may be able to get to a solution in any number of ways.

dgreybarrowShell Script

A shell is an environment in which we can run our commands, programs, and shell scripts. There are different flavors of shells, just as there are different flavors of operating systems. Each flavor of shell has its own set of recognized commands and functions.

Shell scripts and functions are both interpreted. This means they are not compiled. Both shell scripts and functions are ASCII text that is read by the Korn shell command interpreter. When we execute a shell script, or function, a command interpreter goes through the ASCII text line by line, loop by loop, test by test and executes each statement, as each line is reached from the top to the bottom.

dgreybarrow Different Types of Shells to Declare

#!/usr/bin/sh OR #!/bin/sh Declares a Bourne shell
#!/usr/bin/ksh OR #!/bin/ksh Declares a Korn shell
#!/usr/bin/csh OR #!/bin/csh Declares a C shell
#!/usr/bin/bash OR #!/bin/bash Declares a Bourne-Again shell

dgreybarrow How to use ftp in a shell script

Sometimes we want to FTP a file from one machine to another. Usually, we can do the transfer interactively, but every so often, a shell script do the file transfer.

The problem we always encountered in scripting ftp transfers involved getting a password to the ftp server. Typical ftp client programs under Unix, Linux, Solaris and NetBSD all read the ftp password from /dev/tty.

Example Working Script
#!/bin/sh
HOST=’ftp.users.company.net’
USER=’yourid’
PASSWD=’yourpw’
FILE=’file.txt’

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0

Tips for you . In order to get the password to the ftp server without having the ftp client program read the password from /dev/tty requires two tricks:

  • Using the -n option on the ftp client program to prevent the ftp client from trying to log in immediately. That way, the ftp client does not ask for a user ID and password. No use of /dev/tty.
  • Use the ftp client program command quote to send user ID and password to the ftp server.

dgreybarrow How to Submit Concurrent Program Using CONCSUB:

Syntax:

CONCSUB <ORACLE ID>
<ResponsIbility Application Short Name>
<ResponsIbility Name>
<User Name>
CONCURRENT
<Concurrent Program Application Short Name>
<Concurrent Program Name>
[START=<Requested Start Date>]
[REPEAT_DAYS=<Repeat Interval>]
[REPEAT_END=<Request Resubmission End Date>]
<Concurrent Program Arguments …>

Example to shutdown the concurrent manager

CONCSUB APPLSYS/FND SYSADMIN ‘System Administrator’ SYSADMIN [WAIT={Y|N}]
CONCURRENT FND [SHUTDOWN|ABORT]

ORACLE ID: Enter the username and password of the ORACLE ID you want your concurrent program to run in. Enter the username and password without any spaces and separated by a slash (“/”).

Responsibility Application Short Name: Enter the short name of the application for your responsibility.This name, along with your responsibility name, will be used to select a responsibility for Your concurrent request to run in.

Responsibility Name: Enter the name of your responsibility. This name, along with your responsibility application short name, will be used to select a responsibility for your concurrent request to run in.

User Name: Enter the name of your Application ObjectLibrary user. This name will be used to update the Who information for any data your concurrent program changes and to create report output File name for this request.

Concurrent Program Application Short Name: Enter the short name of the application for your concurrent program. This name, along with the concurrent program name, uniquely identifies the concurrent program for your concurrent request.

Concurrent Program Name: Enter the name of your concurrent program. This name, along with the concurrent program application short name, uniquely identifies the concurrent program for your concurrent request.

Start Date: Specify the token START and enter the date you want the concurrent request to run, in DD- MON-YY HH24:MI:SS format.

Request Resubmission End Date: Specify the token REPEAT_END and enter the date you want the request resubmission to stop, in DD-MON-YY HH24:MI:SS format. This argument is used in conjunction with “Repeat Interval”.

Concurrent Program Arguments: Enter the arguments for your concurrent program.

Sample HOST File to Submit Two concurrent Programs Using CONCSUB:
########################################################################
# Set the variables for running concurrent program.
########################################################################
CONCPRG=”XXPHARC_CONC_TEST”
CONCAPP=”XXPHARC”
RESPAPP=”XXPHARC”
RESP=”XXPHARC-AR-CONC”
USERNAM=`echo $1 | cut -d ‘ ‘ -f 5 | cut -d ‘”‘ -f 2`

echo $CONCPRG
echo $CONCAPP
echo $RESPAPP
echo $RESP
echo $USERNAM
########################################################################
CONCMSG=`noarg CONCSUB $FCP_LOGIN \
$RESPAPP \
$RESP \
$USERNAM \
WAIT=10 \
CONCURRENT \
$CONCAPP \
$CONCPRG`
########################################################################
# Set the variables for running concurrent program.
########################################################################
CONCPRG=”XXPH_CONC_TEST”
########################################################################
CONCMSG=`noarg CONCSUB $FCP_LOGIN \
$RESPAPP \
$RESP \
$USERNAM \
WAIT=10 \
CONCURRENT \
$CONCAPP \
$CONCPRG`
reqid=””
reqid=`echo $CONCMSG | cut -d ” ” -f 3`
CONCMSG=`echo $CONCMSG | cut -d'”‘ -f3`
y=””
y=`echo $reqid | grep “^[0-9]”`
if [ $? -ne 0 ]
then
echo “Failed to schedule SMARCONSS thru Control-M option …\n”
exit 1
else
exit 0
fi

In the above script we have taken two concurrent programs named XXPHARC_CONC_TEST and PL/XXPH_CONC_TEST both consists simple PL/SQL code. These are assigned to “XXPHARC-AR-CONC” responsibility and its short name is “XXPHARC”. Here we have taken two CONCSUB commands to submit the concurrent programs.

Related Posts

Posted in AOL | No Comments »Email This Post Email This Post |

Have you tried OracleappsHub in ipad/iphone/smart Phone? Don't wait. try it today
Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.