Sponsored Content
Top Forums Shell Programming and Scripting Executing multiple Oracle procedures concurrently Post 88464 by jim mcnamara on Friday 4th of November 2005 09:41:15 AM
Old 11-04-2005
try something like this -

Code:
stty echo
clear

#----------------------------------------------------------------------
# Function: execute_inst
# Description: Execute the stored procedure
#
# Called with: No arguments
# Returns: No arguments
#----------------------------------------------------------------------
RC1=${nohup sqlplus $ORACLE_UID/$ORACLE_PWD <<EOF 
WHENEVER SQLERROR EXIT 1
DECLARE
ln_return_code NUMBER;
BEGIN
HSD_AUROMATED_SCRIPTS.SP_AUTOMATED_SCRIPTS_CTRL_INST(ln_return_code);
IF ln_return_code = -1 THEN
RAISE_APPLICATION_ERROR (-20001, 'Institutional Script Automation Process Terminated with Errors. Please check the logs for specific error');
END IF;
END;
/
EOF} &

#----------------------------------------------------------------------
# Function: execute_prof
# Description: Execute the stored procedure
#
# Called with: No arguments
# Returns: No arguments
#----------------------------------------------------------------------
RC2=${nohup sqlplus $ORACLE_UID/$ORACLE_PWD <<EOF 
WHENEVER SQLERROR EXIT 1
DECLARE
ln_return_code NUMBER;
BEGIN
HSD_AUROMATED_SCRIPTS.SP_AUTOMATED_SCRIPTS_CTRL_PROF(ln_return_code);
IF ln_return_code = -1 THEN
RAISE_APPLICATION_ERROR (-20001, 'Professional Script Automation Process Terminated with Errors. Please check the logs for specific error');
END IF;
END;
/
EOF} 

wait

retval=0
if [ $RC1 -ne 0 ] 
then
   echo " \n Error occurred ...."
   echo " \n INstitutional process failed ...."
   retval=1
else
   echo " \n INstitutional process Completed with return code 0"
fi

if [ $RC2 -ne 0 ] 
then
echo " \n Error occurred ...."
echo " \n Professional process failed ...."
retval=1
else
echo " \n Professional process Completed with return code 0"
fi
exit $retval

 

8 More Discussions You Might Find Interesting

1. Solaris

Calling Oracle Stored Procedures in UNIx(sun solaris)

I have created 3 Procedures all similar to this one: I then created 3 shell sripts which will call the sql? finally created a calling script to call the procedure. I am a bit unsure how to this all works, can someone check my code and I am doing this right? Also could I add my procedure (first... (0 Replies)
Discussion started by: etravels
0 Replies

2. Solaris

Executing MS-SQL stored procedures from Unix/C Program?

All, We are contemplating a port of an existing software product and would like to expend as little effort as possible. Our new database would be MS-SQL, and we would write stored procedures to perform common db operations. We'd like to call these stored procedures from C or C++ code running... (3 Replies)
Discussion started by: mparks
3 Replies

3. Shell Programming and Scripting

Running same script multiple times concurrently...

Hi, I was hoping someone would be able to help me out. I've got a Python script that I need to run 60 times concurrently (with the number added as an argument each time) via nightly cron. I figured that this would work: 30 1 * * * for i in $(seq 0 59); do $i \&; done However, it seems to... (4 Replies)
Discussion started by: ckhowe
4 Replies

4. Shell Programming and Scripting

Oracle procedure is not executing in uix

Hi Guys, I am trying to tun a oracle proedure throgh unix shell script but it is not running i dont know why ? i have tested this procedure in sqlplus and it was working fine. can you see the script and sql file and let me know where is my mistake. script:bm_chart_table_loading.sh ... (3 Replies)
Discussion started by: shary
3 Replies

5. Shell Programming and Scripting

Executing a Oracle SQL statement in a UNIX script

Hi All, I need to select one column from a table based upon the passed in parameter. I tried this: sqlplus -silent $MISP_USER << EOF set feedback off; set verify off; set sqlprompt "" SELECT mail_flag FROM dailyjobs WHERE job_name = '$1'; exit 0 EOF exit... (1 Reply)
Discussion started by: ganga.dharan
1 Replies

6. Solaris

Help with executing multiple remote commands after multiple hops

Hi SSHers, I have embedded this below code in my shell script.. /usr/bin/ssh -t $USER@$SERVER1 /usr/bin/ssh $USER2@S$SERVER2 echo uptime:`/opt/OV/bin/snmpget -r 0 -t 60 $nodeName system.3.0 | cut -d: -f3-5` SSH to both these servers are public-key authenticated, so things run... (13 Replies)
Discussion started by: LinuxUser2008
13 Replies

7. Shell Programming and Scripting

Executing oracle procedure using cronjob

Hi, Below is the code to execute the procedure "dbms_job.broken" from the shell script. on executing manually, it works properly without any error. but it is not working when scheduled using the cronjob. #!/usr/bin/bash user_name="oracdb" password="ora123" tns="localdb"... (2 Replies)
Discussion started by: milink
2 Replies

8. Shell Programming and Scripting

Run multiple procedures from shell script parallely

Hi, I need to write a Shell Script wherein i will connect to a DB2 Database and run multiple DB procedures. I know how to do in a way where procedures will be called one after the other, like when first procedure finishes, second will be executed. But what i want is to run them at the same time... (11 Replies)
Discussion started by: Neelkanth
11 Replies
NOHUP(1)						    BSD General Commands Manual 						  NOHUP(1)

NAME
nohup -- invoke a utility immune to hangups SYNOPSIS
nohup [--] utility [arguments] DESCRIPTION
The nohup utility invokes utility with its arguments and at this time sets the signal SIGHUP to be ignored. If the standard output is a ter- minal, the standard output is appended to the file nohup.out in the current directory. If standard error is a terminal, it is directed to the same place as the standard output. Some shells may provide a builtin nohup command which is similar or identical to this utility. Consult the builtin(1) manual page. ENVIRONMENT
The following variables are utilized by nohup: HOME If the output file nohup.out cannot be created in the current directory, the nohup utility uses the directory named by HOME to create the file. PATH Used to locate the requested utility if the name contains no '/' characters. DIAGNOSTICS
The nohup utility exits with one of the following values: 126 The utility was found, but could not be invoked. 127 The utility could not be found or an error occurred in nohup. Otherwise, the exit status of nohup will be that of utility. SEE ALSO
builtin(1), csh(1), signal(3) STANDARDS
The nohup utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. BUGS
Two or more instances of nohup can append to the same file, which makes for a confusing output. BSD
July 19, 2001 BSD
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy