DBD::ODBC and shared library
DBD::ODBC and shared library
am 08.09.2005 17:59:00 von vassiliy.truskov
Hello,
I have a problem with the DBD::ODBC module (ODBC.sl) when ODBC driver
manager
is located in different directory, other then one was used at
compilation time.
The LD_LIBRARY_PATH, SHLIB_PATH and LD_RELOAD don't help.
The error occurs at the startup time when 'use DBD::ODBC' calls.
I removed directory with original driver manager and put a new one in
different directory
I thought LD_LIBRARY_PATH will help me to solve the problem, but it doesn't.
The ldd shows that file is trying to be accessed from the old place:
L2000> ldd -s /opt/perl/lib/site_perl/5.8.0/PA-RISC2.0/auto/DBD/ODBC/ODBC. sl
find library=/disk2/odbc/odbcsdk/lib/libiodbc.sl.3; required by
/opt/perl/lib/site_perl/5.8.0/PA-RISC2.0/auto/DBD/ODBC/ODBC. sl
/usr/lib/dld.sl: Can't open shared library:
/disk2/odbc/odbcsdk/lib/libiodbc.sl.3
/usr/lib/dld.sl: No such file or directory
L2000>
I'm on HP-UX OS, DBD::ODBC 1.12.
Any help is appreciated.
Regards,
Vassiliy
Using DBI to bounce the database
am 08.09.2005 22:04:40 von joebayerii
--0-1123562902-1126209880=:29257
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hi, group, I would like to bouce the database using DBI.
#!/usr/bin/perl -w
############################################################ #####################
# Purpose : Refresh user xxx from production
# Created : 20050907
# Author : ############################################################ #####################
use DBI;
use DBD::Oracle qw(:ora_session_modes);
$ENV{ORACLE_SID}=$target_sid[$i];
my $record_counter = 0;
my $imp_log = $ORACLE_HOME."dba/refresh/prod_$target_sid[$i].log";
$dbh = DBI->connect ( "dbi:Oracle:",
"$username[$i]",
"$passwd[$i]",{ora_session_mode => ORA_SYSDBA,
PrintError => 0,
RaiseError => 0,
AutoCommit => 1 }
) || print "$target_sid[$i] connection error\n";
my $sql = "shutdown abort";
$dbh -> do($sql);
------------------------------------------------------------ -----------------------------------------------
I can connect as sysdba, but when I do "shutdown abort", DBI just ignore my command. What I did was wrong?
Thanks for your help.
Joe
---------------------------------
Click here to donate to the Hurricane Katrina relief effort.
--0-1123562902-1126209880=:29257--
RE: Using DBI to bounce the database
am 08.09.2005 23:01:16 von Ron.Reidy
Joe,
You should set RaiseError =3D> 1 so you know what errors get thrown.
--
Ron Reidy
Lead DBA
Array BioPharma, Inc.
-----Original Message-----
From: joe bayer [mailto:joebayerii@yahoo.com]=20
Sent: Thursday, September 08, 2005 2:05 PM
To: dbi-users@perl.org
Subject: Using DBI to bounce the database
Hi, group, I would like to bouce the database using DBI.
#!/usr/bin/perl -w
############################################################ ############
#########
# Purpose : Refresh user xxx from production
# Created : 20050907
# Author :
############################################################ ############
#########
use DBI;
use DBD::Oracle qw(:ora_session_modes);
$ENV{ORACLE_SID}=3D$target_sid[$i];
my $record_counter =3D 0;
my $imp_log =3D
$ORACLE_HOME."dba/refresh/prod_$target_sid[$i].log";
$dbh =3D DBI->connect ( "dbi:Oracle:",
"$username[$i]",
"$passwd[$i]",{ora_session_mode =3D> ORA_SYSDBA,
PrintError =3D> 0,
RaiseError =3D> 0,
AutoCommit =3D> 1 }
) || print "$target_sid[$i] connection
error\n";=20
my $sql =3D "shutdown abort";
$dbh -> do($sql);
------------------------------------------------------------ ------------
-----------------------------------
I can connect as sysdba, but when I do "shutdown abort", DBI just ignore
my command. What I did was wrong?
=20
Thanks for your help.
Joe
=09
---------------------------------
Click here to donate to the Hurricane Katrina relief effort.
This electronic message transmission is a PRIVATE communication which =
contains
information which may be confidential or privileged. The information is =
intended=20
to be for the use of the individual or entity named above. If you are =
not the=20
intended recipient, please be aware that any disclosure, copying, =
distribution=20
or use of the contents of this information is prohibited. Please notify =
the
sender of the delivery error by replying to this message, or notify us =
by
telephone (877-633-2436, ext. 0), and then delete it from your system.
RE: Using DBI to bounce the database
am 08.09.2005 23:10:05 von Andy
> Hi, group, I would like to bouce the database using DBI.
AFAIK, "shutdown" and "startup" are SQL*Plus commands, therefore must be
issued through SQL*Plus (or RMAN). They are neither SQL, DDL, nor session
control statements, so cannot be issued via OCI, and therefore not through
DBI/DBD::Oracle.
> PrintError => 0,
> RaiseError => 0,
[snip]
> my $sql = "shutdown abort";
> $dbh -> do($sql);
>
> I can connect as sysdba, but when I do "shutdown abort", DBI
> just ignore my command. What I did was wrong?
DBI did not ignore your command; it processed it, but you told it to ignore
all errors by setting both PrintError and RaiseError to zero and not
checking the return value of $dbh->do($sql). Set either attribute to
non-zero, or check the return value, and you will see an error produced (the
Oracle error for "invalid SQL statement" seems a likely candidate).
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool