Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle-DB-Client 11R2 with perl-DBD: Eating Signal CTRL-C

Ulrich WeissApr 15 2011 — edited May 4 2011
Hello!

I'm a bit diffused of this current behaviour, we have observed:
The oracle-client 11R2 used with perl-DBD obviously redirects the CTRL-C signal from the terminal to... something else.
This is very very very unfortunate, because a sleep-loop can not be exited by CTRL-C. And this, I have (as DBA) a lot of!

I think you can understand: a lot of utils I have written in perl, are acting like:
{
  db_connect;
  while(1)
  {
    do_something;
   compare_with_previouse_state;
   sleep(1);
  }
} 
The "feature" is, that I can exit the programm by pressing CTRL-C.
Until I have installed client 11R2. Now a can NOT exit the programm by pressing CTRL-C. I have to switch to another terminal, fetching the PID and execute kill <PID>. Very funny ;(

Test Case:
$ cat sleep.pl
#!/usr/bin/perl
use strict;
use DBI;

sub main
{
  # Open Connection
  my $dbh = DBI->connect("dbi:Oracle:XXXXX", "YYYYY", "ZZZZZZZZ");
  die "Could not connect to database: ".$DBI::errstr."\n" if(!$dbh);
  
        while(1)
        {
                printf("Sleeping...\n");
                sleep(3);
        }
}

main();
$ ./sleep.pl
Sleeping...
^CSleeping...
^CSleeping...
^CSleeping...
^CSleeping...
^CSleeping...
Sleeping...
Sleeping...
Sleeping...
Sleeping...
Terminated
$
As you can see, at pressing CTRL-C, only "^C" appears in the terminal, but the loop continues. The problem does not exist, if the db-connection is not opened previousely.
I think, that the CTRL-C signal is redirected at the open-command, but not restored, if the open-command returns.
On another test machine, I have reproduced this behaviour.
First, I thought of a bug in DBD-Oracle, or DBI. But after some tries, I recognized the solution: Deinstall Client 11R2, and install client 11R1. Voila!
Searching in My Oracle Support (formerly OracleMetaLink) does not help, also a patch for client is a mysterious thing at oracle....

Does anyone of you have a similar problem?
(Is this the right forum for this task?)

I have summarized all detail information, for download: http://www.ulite.de/oracle_client_bug.txt
For short:
Installation:
Fedora 14
uname -a: Linux gd2987 2.6.35.12-88.fc14.i686 #1 SMP Thu Mar 31 22:12:38 UTC 2011 i686 i686 i386 GNU/Linux
Oracle-Installation: 11R2 Client (Full!) 11.2.0.1.0
perl-DBI-1.613-1.fc14.i686
perl-DBD-Oracle: 1.28
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 1 2011
Added on Apr 15 2011
9 comments
1,032 views