473,394 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Perl script that cannot receive respond from Oracle stored procedure

I had a Perl script that called a sql file calling the stored procedure in Oracle database. The stored procedure ran for a long time (more than 1.5 hrs) and did not return the result code to the perl script. (I could see from the job log of the stored procedure that the stored procedure was successfully completed)
Expand|Select|Wrap|Line Numbers
  1. my $sql = "sqlplus -s userid/password $jobId";
  2. $rtnCode = system($sql);
  3.  
I had other similar jobs that ran shorter time (e.g. 10 mins). That job could successfully got the result code.

Is the connection lost between the database server and the application server ?Is there any parameter that can control the timeout ?

Please help.
Feb 11 '10 #1
7 2663
chaarmann
785 Expert 512MB
I am pretty sure the connection timeout was hit.
And it's not a good idea to stay connected that long. A connection should be returned as fast as possible to the connection pool for usage of other processes.
So instead of fiddling with the timeout-parameters of your computer, your firewall and your oracle server, you could approach the problem another way:
make a temporary table "temp" with columns for your expected result and execute "insert into temp select my_stored_procedure(...) from dual" with autocommit. Don't wait for results, just close the connection.
Then you can poll the table after an hour to see if the result is already arrived. if yes, then just make a small sql on this temp table to grab it.
Feb 12 '10 #2
Dear chaarmann,

I searched the internet and found that a setting of "KeepAliveTime" under "\\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Ser vices\Tcpip\Parameters" in the windows registry may help the issue.

But it may require the application program to use this setting. May I have more information how to use this setting in batch file (.bat) or the Perl program (.pl) ?
Feb 24 '10 #3
If I set the value of "KeepAliveTime" to 300000, do I need to specify in my Perl code to use this feature ? Or I can leave it to the OS to handle ?
Feb 25 '10 #4
Does anyone have any idea if I set the value of "KeepAliveTime" to 300000 in the windows registry "\\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Ser vices\Tcpip\Parameters", do I need to specify in my Perl code/bat file to use this feature ? Or I can leave it to the OS to handle ?
Feb 26 '10 #5
Would anyone please give me some idea if I set the value of "KeepAliveTime" to 300000 in the windows registry "\\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet \Ser vices\Tcpip\Parameters", do I need to specify in my Perl code/bat file to use this feature ? Or I can leave it to the OS to handle ?

I tried to search for the information in the internet, but could not find any information.

Thanks in advanced.
Mar 1 '10 #6
I tried to set the value of KeepAliveTime in the windows registry and not changed anything in the Perl code/batch file, but it still did not get the return code.

The system was just transferred to our site. The program logic and system settings were new to us. We tried to keep the changes minimal to the system. And the database server and the application server was in trusted zone and DMZ respectively.

Is there any other ways to tackle the problem ?
Mar 2 '10 #7
RonB
589 Expert Mod 512MB
Have you tried using Perl's DBI module instead of shelling out to sqlplus?

DBI - Database independent interface for Perl
http://search.cpan.org/~timb/DBI-1.609/DBI.pm

DBD::Oracle - Oracle database driver for the DBI module
http://search.cpan.org/~pythian/DBD-....24a/Oracle.pm
Mar 2 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Jeff Lambert | last post by:
We have a Windows client application written in delphi that connects to Oracle 8i w/ ADO. We accumulate a lot of SQL statements in a loop and finally send the strings list to be executed. What I...
6
by: Richard Trahan | last post by:
I want a js function to call a Perl script residing on a server. The Perl script will return a string, to be used by the js. Pseudo code: <script> stringvar = perlfunc_on_server(stringarg)...
8
by: Wonderinguy | last post by:
Hi everybody , I have been trying to execute a simple DB2 stored Procedure from perl. But it doesn't work. Could anybody please help me find out why this is happening : here is my perl script...
3
by: Samarth | last post by:
Folks, I am calling a DB2 stored procedure through Perl using the DBI:ODBC module. I am not sure if I can do this or not because I have been able to connect to and also issue select statements...
1
by: newhaven_lad | last post by:
Please could someone help, I have a Perl cgi script which works perfectly when run in a dos prompt, it connects to a database on my laptop and inserts a record. But when I use the internet browser...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
0
by: crawfordr | last post by:
Hello, I have created a perl script that connects to a specific socket (Ip address/port) using protocall of TCP. It is the server socket script. There is also coding to manage multiple handles by...
3
by: andrewkl | last post by:
hi, I have the following Perl code that inserts a string to an Oracle DB via a stored procedure: #!/usr/local/bin/perl ## Perl v5.8.6 built for sun4-solaris use strict; BEGIN...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
Saii
by: Saii | last post by:
How can we pass a perl array to stored procedure in Oracle. The parameter I am using in Oracle is type of table of varchar(500). I am using the system command in perl to execute the procedure ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.