RE: problem with DBD::Oracle
Thanks to everyone who tried to help. In the end I solved the problem by searching on google and finding the answer. The problem is specific to mod_perl2 which is what we are running. I'm not sure I really understood the explanation but it has to do with the fact that you can't set environment variables in the script but it should be done at startup time in the startup.pl script which is what we did and now things are working properly. Malka Cymbalista Webmaster, Weizmann Institute of Science [EMAIL PROTECTED] 08-934-3036 Reidy, Ron [EMAIL PROTECTED] 31/05/2005 17:49 This error message looks hinkey. Are you printing the value of DBI::errstr? If so, there is definitely something wrong with your environment. In any case, if you are making a connection to a remote server, your connection string is wrong. AFAIK, it should read DBI-connect(dbi:Oracle:your_oracle_sid - Ron Reidy Lead DBA Array BioPharma, Inc. -Original Message- From: Malka Cymbalista [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 31, 2005 1:45 AM To: Reidy, Ron Subject: RE: problem with DBD::Oracle Thanks for your reply. Unfortunately, I still cannot find the problem. The error message I get back is ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc.). However, ORACLE_HOME is printed properly from the script the NLS setrtings also look OK. All the files in ORACLE_HOME/lib are readable by the world so I don't think there's a problem with permissions. What's strange is that when I run it from the command line using the same user that runs the web serve, everything works fine. Anyway, thanks again for your response and for trying to help. Malka Cymbalista Webmaster, Weizmann Institute of Science [EMAIL PROTECTED] 08-934-3036 Reidy, Ron [EMAIL PROTECTED] 25/05/2005 17:21 Well, to start, you should **always** print the Oracle error message ($DBI-errstr). This will tell you more than we on this list could even hope to guess. Next, if it runs from the command line, then you most likely have a permissions issue with either the Perl script itself, or the Oracle.so library. - Ron Reidy Lead DBA Array BioPharma, Inc. -Original Message- From: Malka Cymbalista [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 25, 2005 5:47 AM To: dbi-users@perl.org Subject: problem with DBD::Oracle Our web server is running Apache 2.0.48 with mod_perl 1.99_12 on a Sun machine running Solaris 9. We are running perl 5.8.1, DBI 1.39 and DBD-Oracle 1.16. We are trying to connect from our web server to an Oracle database that is on a different machine. The script that we wrote to do this runs perfectly well when we run it from the command line as a plain user. However, when we try running it from the web, we cannot connect to the database. When running from the web, the following environment variables are printed properly: TWO_TASK ORACLE_SID LIBPATH LD_LIBRARY_PATH ORACLE_HOME SHLIB_PATH I use the following code to connect to the database: if ( ! ($dbh = DBI-connect(dbi:Oracle:, $dbuser, '', { PrintError = 0, AutoCommit = 0 }))) { print Error: cannot connect to DBbr\n; exit(0); } $dbuser is defined as $dbuser = 'userid/password'; After all the environment variables are printed out, I get the message Error: cannot connect to DB As I said at the start, the script works perfectly well from the command line even when it is run from the same userid that the web runs under. Any suggestions to get this working from the web will be greatly appreciated. Thanks in advance. Malka Cymbalista Webmaster, Weizmann Institute of Science [EMAIL PROTECTED] 08-934-3036 This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution 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. This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution 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: problem with DBD::Oracle
On 06/01/2005 04:33 AM, Malka Cymbalista said: Thanks to everyone who tried to help. In the end I solved the problem by searching on google and finding the answer. The problem is specific to mod_perl2 which is what we are running. I'm not sure I really understood the explanation but it has to do with the fact that you can't set environment variables in the script but it should be done at startup time in the startup.pl script which is what we did and now things are working properly. I think I can explain further. The shared library loader runs in the context of the web server, not your script. That means that environment variable changes that occur in the script are too late to affect shared library loading. -- Mac :}) ** I usually forward private questions to the appropriate mail list. ** Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age.
DSN's
Hi, I'm trying to debug an install for my DBD::ODBC module, and since this is my first experiment with the DBI, I have a question on format/syntax. But first, here's some background info that may/not help: Environment is Linux I've already installed/tested Perl5, DBI, unixODBC (manager) Now, I'm trying to install the ODBC driver In order to install the ODBC driver, environment variables: DBI_DSN, DBI_USER, DBI_PASS, ODBCHOME, LD_LIBRARY_PATH, and LANG all had to be added to .bashrc I'm installing the DBD::ODBC module from CPAN. It comes with a series of connectivity tests that you can run after running 'make' by doing 'make test'. I'm trying to narrow down my list of things that could be wrong. Almost all of the errors seem to be complaining about my 'DSN not found or my driver not specified'. Can someone tell me if the following syntax is ok or if any other major no-no's jump out at you? export DBI_DSN='dbi:ODBC:host=something.something.something;port=1521;dbname=na me' I'm very new to all this and would appreciate as much detailed help as possible. Thanks for any info
Re: Trying to install DBI module for perl5.8.0 on sun solaris8 E10k
Your perl was compiled with the solaris compilers by sun with the -KPIC option. This is not recognized by gcc. Since when you compile DBI it tries to use the same flags as what perl -V reports, the compile exlpodes. If you compile and install your own perl first using gcc you should have no problems compiling DBI. Marc Slagle Online-Rewards Evans, Drexter B (Drex) wrote: I am using gcc for my c-compiler. Any help would be appreciated. The output of perl -V and perl Makefile.PL and make are below. If you need anymore information just email me. The output is also in the text file attached. The DBI version is 1.48. My cc compiler is linked to /usr/local/bin/gcc from /usr/ucb/cc. Thanks Drex (lines cut) Creating DBI::PurePerltest variant: t/zvpp_01basics.t Creating DBI::PurePerltest variant: t/zvpp_02dbidrv.t Creating DBI::PurePerltest variant: t/zvpp_03handle.t Creating DBI::PurePerltest variant: t/zvpp_04mods.t Creating DBI::PurePerltest variant: t/zvpp_05thrclone.t (use threads) Creating DBI::PurePerltest variant: t/zvpp_06attrs.t Creating DBI::PurePerltest variant: t/zvpp_07kids.t Creating DBI::PurePerltest variant: t/zvpp_08keeperr.t Creating DBI::PurePerltest variant: t/zvpp_09trace.t Creating DBI::PurePerltest variant: t/zvpp_10examp.t Creating DBI::PurePerltest variant: t/zvpp_11fetch.t Creating DBI::PurePerltest variant: t/zvpp_14utf8.t Creating DBI::PurePerltest variant: t/zvpp_15array.t Creating DBI::PurePerltest variant: t/zvpp_20meta.t Creating DBI::PurePerltest variant: t/zvpp_30subclass.t Creating DBI::PurePerltest variant: t/zvpp_40profile.t Creating DBI::PurePerltest variant: t/zvpp_41prof_dump.t Creating DBI::PurePerltest variant: t/zvpp_42prof_data.t Creating DBI::PurePerltest variant: t/zvpp_50dbm.t Creating DBI::PurePerltest variant: t/zvpp_60preparse.t Creating DBI::PurePerltest variant: t/zvpp_80proxy.t Checking if your kit is complete... Looks good I see you're using perl 5.008 on sun4-solaris-thread-multi, okay. Remember to actually *read* the README file! Use 'make' to build the software (dmake or nmake on Windows). Then 'make test' to execute self tests. Then 'make install' to install the DBI and then delete this working directory before unpacking and building any DBD::* drivers. Writing Makefile for DBI Not sure why the above states i am using perl 5.008 below perl -V # perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=solaris, osvers=2.8, archname=sun4-solaris-thread-multi uname='sunos 5.8 generic_108528-15 sun4u sparc sunw,ultra-60 ' config_args='' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc -xtarget=ultra -xarch=v9 -xcode=pic32', ccflags ='-D_REENTRANT -I/usr/local/include -xarch=v9 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-D_REENTRANT -I/usr/local/include' ccversion='Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09', gccversion='', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc -xtarget=ultra -xarch=v9 -xcode=pic32', ldflags =' -L/usr/local/lib -L/opt/SUNWspro/WS6U2/lib -xarch=v9 ' libpth=/usr/local/lib /opt/SUNWspro/WS6U2/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldb -ldl -lm -lrt -lpthread -lc perllibs=-lsocket -lnsl -ldl -lm -lrt -lpthread -lc libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-KPIC', lddlflags=' -G -xarch=v9 -L/usr/local/lib -L/opt/SUNWspro/WS6U2/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under solaris Compiled at Nov 3 2002 23:07:14 @INC: /usr/local/lib/perl5/5.8.0/sun4-solaris-thread-multi /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris-thread-multi /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl Below is where the problem starts### (lines cut) /usr/local/bin/perl -p -e s/~DRIVER~/Perl/g
Question about DBI
Hi Tim, I am getting an error ora-12660 while trying to connect to the database using DBI/DBD. I am using the command dbi:Oracle:host=xyz;sid=abc in order to connect to database abc. This error indicates that there is some encryption problem . I have tried to disable the encryption from mandatory to optional and the same scripts work well. But we want to keep all the client connection encrypted. Could you suggest any solution that i am able to connect to the database with the encryption on. Are there any specific parameters to use in DBI module which will let the encryption enable and let me connect to the database. I am always getting error ora-12660 while encryption is enabled.Any help would be appreciated. Thanks Puneet
RE: Question about DBI
First, this clearly is not a DBI issue, but a setup/options issue wit Oracle. AFAIK, encryption is an extra cost option for Advanced Security. If you want/need encryption and can't/won't pony up the magna to Oracle for this, use SSH tunneling (Google is your friend here: http://www.google.com/search?q=ssh+tunnel+%2Boraclesourceid=mozilla-searchstart=0start=0ie=utf-8oe=utf-8client=firefox-arls=org.mozilla:en-US:official). - Ron Reidy Lead DBA Array BioPharma, Inc. -Original Message- From: Puneet [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 01, 2005 3:32 PM To: dbi-users@perl.org Subject: Question about DBI Hi Tim, I am getting an error ora-12660 while trying to connect to the database using DBI/DBD. I am using the command dbi:Oracle:host=xyz;sid=abc in order to connect to database abc. This error indicates that there is some encryption problem . I have tried to disable the encryption from mandatory to optional and the same scripts work well. But we want to keep all the client connection encrypted. Could you suggest any solution that i am able to connect to the database with the encryption on. Are there any specific parameters to use in DBI module which will let the encryption enable and let me connect to the database. I am always getting error ora-12660 while encryption is enabled.Any help would be appreciated. Thanks Puneet This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution 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: Question about DBI
I'm sure someone will correct me if I'm wrong, but I don't think DBI supports encrypted connections to Oracle via Oracle Advanced Security. -Original Message- From: Puneet [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 01, 2005 3:32 PM To: dbi-users@perl.org Subject: Question about DBI Hi Tim, I am getting an error ora-12660 while trying to connect to the database using DBI/DBD. I am using the command dbi:Oracle:host=xyz;sid=abc in order to connect to database abc. This error indicates that there is some encryption problem . I have tried to disable the encryption from mandatory to optional and the same scripts work well. But we want to keep all the client connection encrypted. Could you suggest any solution that i am able to connect to the database with the encryption on. Are there any specific parameters to use in DBI module which will let the encryption enable and let me connect to the database. I am always getting error ora-12660 while encryption is enabled.Any help would be appreciated. Thanks Puneet
ANNOUNCE: SQL-Routine 0.63
2005-06-01 Darren Duncan [EMAIL PROTECTED] -- Version 0.63 of SQL::Routine (SRT), a fully atomic and portable abstract syntax tree to define any database tasks, has been uploaded to CPAN; it should appear on your favorite mirror within the next few hours. http://search.cpan.org/dist/SQL-Routine/ In summary, this release primarily serves to improve the ease of use and reliability of the build_*() methods, such that their allowed argument options are now more consistent and predictable. The allowed argument formats are now more terse and user-friendly than before. The get_all_properties() methods will now return the more terse format as well. Finally, the number of static error messages has been greatly reduced, replaced with a much smaller number of dynamic ones, so the total is easier to work with. A side effect of the build_*() method changes is that subsequent porting of this module to Perl 6 will be easier, as I remove the need for a multitude of multi-methods. Aside from the build_*() methods being more restrictive, there are no other significant API changes. Moreover, if you used the build_*() methods in the manner that the SYNOPSIS detailed, then nothing will break at all. The verbose API (doing everything without 'build') is also unchanged. This input example worked before and still works now: $schema-build_child_node_tree( 'table', { 'si_name' = 'person', 'row_data_type' = 'person', }, [ ( map { [ 'table_field', $_ ] } ( { 'si_row_field' = 'person_id', 'mandatory' = 1, 'default_val' = 1, 'auto_inc' = 1, }, { 'si_row_field' = 'name' , 'mandatory' = 1, }, ) ), ( map { [ 'table_index', $_-[0], [ [ 'table_index_field', $_-[1] ] ] ] } ( [ { 'si_name' = 'primary', 'index_type' = 'UNIQUE', }, 'person_id'], [ { 'si_name' = 'ak_alternate_id', 'index_type' = 'UNIQUE', }, 'alternate_id' ], [ { 'si_name' = 'fk_father', 'index_type' = 'FOREIGN', 'f_table' = 'person', }, { 'si_field' = 'father_id', 'f_field' = 'person_id' } ], [ { 'si_name' = 'fk_mother', 'index_type' = 'FOREIGN', 'f_table' = 'person', }, { 'si_field' = 'mother_id', 'f_field' = 'person_id' } ], ) ), ] ); This otherwise identical example used to work and now doesn't: $schema-build_child_node_tree( { 'NODE_TYPE' = 'table', 'ATTRS' = { 'si_name' = 'person', 'row_data_type' = 'person', }, 'CHILDREN' = [ ( map { { 'NODE_TYPE' = 'table_field', 'ATTRS' = $_ } } ( { 'si_row_field' = 'person_id', 'mandatory' = 1, 'default_val' = 1, 'auto_inc' = 1, }, { 'si_row_field' = 'name' , 'mandatory' = 1, }, ) ), ( map { { 'NODE_TYPE' = 'table_index', 'ATTRS' = $_-[0], 'CHILDREN' = { 'NODE_TYPE' = 'table_index_field', 'ATTRS' = $_-[1] } } } ( [ { 'si_name' = 'primary', 'index_type' = 'UNIQUE', }, 'person_id'], [ { 'si_name' = 'ak_alternate_id', 'index_type' = 'UNIQUE', }, 'alternate_id' ], [ { 'si_name' = 'fk_father', 'index_type' = 'FOREIGN', 'f_table' = 'person', }, { 'si_field' = 'father_id', 'f_field' = 'person_id' } ], [ { 'si_name' = 'fk_mother', 'index_type' = 'FOREIGN', 'f_table' = 'person', }, { 'si_field' = 'mother_id', 'f_field' = 'person_id' } ], ) ), ] } ); That summarizes the most significant API changes. The Changes file for this release contains a lot more details than are shown in this announcement email; the Changes does not contain any before/after code, however. Any questions, feedback, requests, or offers of assistence with the module are welcome and appreciated. Thank you and have a good day. -- Darren Duncan