I have a KSH script which is kicking off an sql scripts as follows:
The problem I have is that sometimes the 10g Oracle Database spits out an error saying something along the lines of too many simultaneous logins (this is a shared account and unfortunately I don't administer the Oracle database).
My scripts then sits there for ages until, and I guessing a bit here, some kind of Oracle timeout kicks in.
Is there a way that I can alter my KSH script to only wait say 10 mins for a result, and if it doesn't get one then just exit from the sql query and continue to the next part of my script, or better still attempt the sql query again in another 10 mins?
Not very nice, but you could try and start a child process that sleeps for 10 minutes and then sends a kill signal to its parent. Probably better would be to use a Perl database interface to attempt to make the connection, and only when that's good, to send the SQL and retrieve the results, although this may still suffer from a login jam!
I would give more emphais on the contents of sql_query.sql . Does it have any commit; rollback statements. Why do you think the script sometimes take a long time. Does it keep waiting for a transactions to commit; May be you should check the other process, locking etc?
...The problem I have is that sometimes the 10g Oracle Database spits out an error saying something along the lines of too many simultaneous logins (this is a shared account and unfortunately I don't administer the Oracle database).
...
What's the exact "ORA-" error message thrown by Oracle 10g in such cases ?
Hi,
I am trying to write a script that calls an Oracle SQL file who in turns call another SQL file. This same SQL file has to be run against the same database but using different username and password at each loop.
The first SQL file is basically a connection test and it is supposed to sort... (2 Replies)
Hi all
I am writing a shell script which will run a select query from a table . If the ouput is not 500 - then send a email to the team saying there is a error . But i am not sure how to redirect this output of the select query to the log file -
#!/bin/ksh
sqlplus /nolog
conect... (1 Reply)
I need to connect sql server 2008 from korn shell script. Can you please give me the script which connects sql server 2008 from korn shell script. (2 Replies)
I probably read all the threads in almost all the forums for a solution to my need. I am a beginner in shell scripting and I dont have a perfect solution yet. Below is my code snippet.
idql -n $REPOSITORY_NAME.$cs -Udmadmin -P"" -R$DM_SCRIPTS/test.api > /dev/null 2>&1
if ; then
echo... (7 Replies)
Hi,
I am trying to call sql script from ksh job with parameters.The parameters passed from ksh job will be used in SELECT query in sql file to SPOOL the data in extract file.My questions are:
1) How to call a sql script from ksh job with parameters?
2) How to use the parameter in sql file to... (1 Reply)
Hi all,
I'm trying to run an sql inside a loop which looks like this
#!bin/ksh
while IFS=, read var1 var2
do
sqlplus -s ${USERNAME}/${PASSWORD}@${ORACLE_SID} << EOF
insert into ${TABLE}
(
appt_date
)
values
(
'${var1 }'
);
... (6 Replies)
I've got a SQL script that is executed through a UNIX ksh script. It is working fine, but I wanted to add a line to put a date/time stamp in the log file that it generates.
This is more of a SQL question, but I'm hoping someone can help me get the date/time...I've changed the script with the... (2 Replies)
any idea on how to timeout the read statement for ksh?
for bash u can use read -t option
-t timeout
Cause read to time out and return failure if a complete
line of input is not read within timeout seconds. This
option has ... (2 Replies)
I am a novice Unix scripter and need a little advice/help on a script I've written that's causing some problems. We are using Solaris 9 on a Sun box and the script is invoked with the korn shell. I have a two-part question: I wrote a shell script that calls and executes 3 separate sql scripts,... (3 Replies)