production issue - shell sqlplus processing sometime success sometime fail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting production issue - shell sqlplus processing sometime success sometime fail
# 1  
Old 07-07-2010
production issue - shell sqlplus processing sometime success sometime fail

Hi Expert,

Below is a real production environment issue:

we are using shell script to FTP to a remote server and fetch around 150 files every day, for each file we need to keep a entry inside ORACLE DB table, before insert into table, each file has a associated logid, which need to be initialed from DB side, so in summary, for each file we need two SQLplus communication, one is to initial log and another is to keep entry.

Now the problem is sometimes all the files successfully kept entries in DB, sometimes failed with none of them been kept in DB entries.

Our shell script structure is as below:

Code:
initial some configuration items ....
sqlplus db to get the configuration for remote server information
base on the configuration to get the remote file list
call another FTP script to pull files back to a well-known diretory
for each file under this diretory, loop and keep db entries

in order to reduce the DB connection, we are using below to only open one DB connection

Code:
SQLPLUS -S user/pass@service |&

then use print -p and read -p to communicate

Now we are wondering whether it is due to the DB PROCESSES parameter or we have any other potential issues not aware yet.

Attached is the main shell script.

Hope someone can help us figure out the root cause, we have been suffering this issue on production for a long time. Even worse thing is that we can not reproduce it on testbed and even production-like testbed.
# 2  
Old 07-08-2010
Can't we (you) add the logging in the script?
There are couple of instances where conditional exit has been used. also for some cases there is no message before the exit.
Additionally, sqlplus output is also redirected to /dev/null.

It is really hard to guess what can go wrong, as it may be ftp part, may be sqlplus session etc.

AFAIK, the best way to check is to redirect the stdout and stderr to a file (before that it is good to put the message before all the exit statement and don't nullify any of the stdout/stderr inside the script ).

We can still wait for expert's replies.

Last edited by clx; 07-08-2010 at 04:19 AM.. Reason: typo
# 3  
Old 07-08-2010
Can you check if there are any env different between prod and non-prod env?

for example,run "env" to get all setting.

Second, do you run it by /bin/ksh -x your script? with that, you can know where it is stopped or where is the problem. Paste the error here

Third. "set -x" is useful in your script debug. Turn it on, and test by ksh -x again.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Production Issue in AIX Oracle RAC [errpt output : DUPLICATE IP ADDRESS DETECTED IN THE NET]

1)We have 2 node cluster RAC on AIX: ->test1 ->test3 2) After rebooting server both the node sequentailly, we are getting below error from errpt command : # errpt |more IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION FE2DEE00 0901223914 P S SYSXAIXIF DUPLICATE IP ADDRESS... (2 Replies)
Discussion started by: manjusharma128
2 Replies

2. Shell Programming and Scripting

sed commands success / fail from commandline vs ksh script

solaris 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Fire-T200 I need a sed command that tests true when presented with lines that contain either forward and backslash. input file: c:/myFile.txt c:\yourFile.txt It doesn't appear that sed (in my environment anyway) supports... (4 Replies)
Discussion started by: msutfin
4 Replies

3. Shell Programming and Scripting

Calling sqlplus from Korn shell heredoc issue

Hi, I am facing an issue wherein some temporary files (here docs) are getting created in /tmp and are not getting deleted automatically. When i check the list of open files with below command i can see one file is getting appended continuously.(In this case /tmp/sfe7h.34p) The output is... (4 Replies)
Discussion started by: Navin_Ramdhami
4 Replies

4. Programming

awk processing / Shell Script Processing to remove columns text file

Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies

5. Emergency UNIX and Linux Support

AIX: Production email issue

Hello, system generated emails sent to users from production scripts within Aix arent going out. In the errpt -a output I see: _______________________________________________________ LABEL: SRC_SVKO IDENTIFIER: BC3BE5A3 Date/Time: Tue Mar 13 16:28:07 EDT 2012 Sequence... (2 Replies)
Discussion started by: NycUnxer
2 Replies

6. BSD

Copying OpenBSD Kernel from a non production to production machine

Hi All, There are few OpenBSD 4.8 servers without compiler installed at my working place. However, sometimes there are some patches released for patching the kernel. My question is: Can I setup a non production OpenBSD 4.8 server as a test machine with compiler installed and use it to... (1 Reply)
Discussion started by: lcxpics
1 Replies

7. Solaris

SC3.2 issue - cluster transport configuration not right - resulting fail

I am trying to set up a two host cluster. trouble is with the cluster transport configuration. i'm using e1000g2 and g3 for the cluster transport. global0 and global1 are my two nodes, and I am running the scinstall from global1. i think i should be expecting, is this: The following... (19 Replies)
Discussion started by: frustin
19 Replies

8. Shell Programming and Scripting

AWK Help needed - Production Issue

Hi I have a cross reference file which contains 86000 records. The data is old number:new number. There are 100s of files where i need to search for old number and append corresponding new number (preceded by @) to the line containing old number. The files contain millions of records.... (9 Replies)
Discussion started by: diksha2207
9 Replies

9. Shell Programming and Scripting

Perl Ping Determine Success or Fail

I know how to ping in Perl. That is easy. What I am wondering is if there is a way for Perl to determine whether the ping was successful or not. Or do I need to save the results out and parse the results seperately looking for the #of tries and successful revieves. Thanks. (1 Reply)
Discussion started by: gdboling
1 Replies
Login or Register to Ask a Question