I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-05-21 06:21:46.432373-07 by abrock
DBI->connect Hangs
Connection to remote Oracle database hangs forever and never returns an error. This was working fine for several months and suddenly stopped working on one of my machines. I can connect to the database using the same perl script on other machines and with sqlplus from the problem machine, so I have ruled out a problem on the database side. The machine I have the problem on is Linux x86_64. The perl code I am using is given belong along with a DBI trace showing exactly where the connection attempt hangs. Any help is appreciated. Thanks, Aaron The Perl code:
#!/app/oracle/product/10.2.0.4.0/db10g/perl/bin/perl use DBI; my $dbh = DBI->connect( "dbi:Oracle:host=hostname;port=1521;sid=DBNAME", "user", "pword" ); #Ha +ngs here $dbh->disconnect; exit 0;
The DBI Trace:
-> DBI->connect(dbi:Oracle:host=hostname;port=1521;sid=DBNAME, user, ****) -> DBI->install_driver(Oracle) for linux perl=5.008003 pid=23472 ruid=7775 euid=7775 install_driver: DBD::Oracle version 1.15 loaded from /app/oracle/product/10.2.0.4.0/db10g/pe +rl/lib/site_perl/5.8.3/i686-linux-thread-multi/DBD/Oracle.pm New DBI::dr (for DBD::Oracle::dr, parent=, id=) dbih_setup_handle(DBI::dr=HASH(0x9974958)=>DBI::dr=HASH(0x9a06100), DBD::Oracle::dr, 0, Null!) dbih_make_com(Null!, 0, DBD::Oracle::dr, 108, 0) thr#9872008 dbih_setup_attrib(DBI::dr=HASH(0x9a06100), Err, Null!) SCALAR(0x993683c) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x9a06100), State, Null!) SCALAR(0x9974b44) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x9a06100), Errstr, Null!) SCALAR(0x9936884) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x9a06100), TraceLevel, Null!) 0 (already defined) dbih_setup_attrib(DBI::dr=HASH(0x9a06100), FetchHashKeyName, Null!) 'NAME' (already defined) -> STORE in DBD::_::common for DBD::Oracle::dr (DBI::dr=HASH(0x9974958)~0x9a06100 'ShowErrorSta +tement' 1) thr#9872008 STORE DBI::dr=HASH(0x9a06100) 'ShowErrorStatement' => 1 <- STORE= 1 at /app/oracle/product/10.2.0.4.0/db10g/perl/lib/site_perl/5.8.3/i686-linux-thread- +multi/DBD/Oracle.pm line 68 <- install_driver= DBI::dr=HASH(0x9974958) -> connect for DBD::Oracle::dr (DBI::dr=HASH(0x9974958)~0x9a06100 'host=ojrtldb12;port=1521;sid +=MNMSD' 'drsi' **** HASH(0x9a07528)) thr#9872008 connect using '(DESCRIPTION=(ADDRESS=(HOST=HOSTNAME)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=DB +NAME)))' New DBI::db (for DBD::Oracle::db, parent=DBI::dr=HASH(0x9a06100), id=) dbih_setup_handle(DBI::db=HASH(0x9a060d0)=>DBI::db=HASH(0x9a07e88), DBD::Oracle::db, 99718a0, N +ull!) dbih_make_com(DBI::dr=HASH(0x9a06100), 9937a78, DBD::Oracle::db, 144, 0) thr#9872008 dbih_setup_attrib(DBI::db=HASH(0x9a07e88), Err, DBI::dr=HASH(0x9a06100)) SCALAR(0x9978260) (alr +eady defined) dbih_setup_attrib(DBI::db=HASH(0x9a07e88), State, DBI::dr=HASH(0x9a06100)) SCALAR(0x99782c0) (a +lready defined) dbih_setup_attrib(DBI::db=HASH(0x9a07e88), Errstr, DBI::dr=HASH(0x9a06100)) SCALAR(0x9978290) ( +already defined) dbih_setup_attrib(DBI::db=HASH(0x9a07e88), TraceLevel, DBI::dr=HASH(0x9a06100)) 0 (already defi +ned) dbih_setup_attrib(DBI::db=HASH(0x9a07e88), FetchHashKeyName, DBI::dr=HASH(0x9a06100)) 'NAME' (a +lready defined) dbih_setup_attrib(DBI::db=HASH(0x9a07e88), HandleSetErr, DBI::dr=HASH(0x9a06100)) undef (not de +fined) dbih_setup_attrib(DBI::db=HASH(0x9a07e88), HandleError, DBI::dr=HASH(0x9a06100)) undef (not def +ined) OCIInitialize(3,0,0,0,0)=SUCCESS # Hangs here
Direct Responses: 12714 | Write a response
Posted on 2010-05-21 11:16:13.574873-07 by abrock in response to 12713
Re: DBI->connect Hangs
I reinstalled my Oracle client and things are working now. Not sure what caused it to break.
Direct Responses: Write a response