[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Perl DBI ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc.)

Posted on 2007-11-28
12
Medium Priority
?
10,307 Views
Last Modified: 2013-12-19
I'm moving some stuff to a new server and I'm getting this error:

DBI connect('okcdev00','xxxx',...) failed: ERROR OCIEnvNlsCreate (check ORACLE_HOME and NLS settings etc.) at /u/unilocal/apache2/cgi-bin/test.cgi line 22

Test script attached...

What other information do I need to provide to help solve this problem?

Thank you!
#!/usr/bin/perl
 
use strict;
use DBI;
 
print "Content-type: text/html\n\n";
print "Connecting ... <p>";
 
# Oracle Path
$ENV{ORACLE_HOME} = "/u/spool/oracle/product/8.1.7";
$ENV{NLS_LANG} = "AMERICAN_AMERICA.UTF8";
 
my $db = "okcdev00";
my $user = "xxxx";
my $passwd = "xxxx";
my $dbh;
 
eval
{
        print "ORACLE_HOME: '$ENV{ORACLE_HOME}' <br />";
        print "NLS: '$ENV{NLS_LANG}' <hr>";
   $dbh = DBI->connect("dbi:Oracle:$db", $user, $passwd, {RaiseError => 1, AutoCommit => 1});
};
 
if ($@)
{
        print $@;
}
else
{
        print 'No Error...';
        print ' dbh returned' if ($dbh);
}

Open in new window

0
Comment
Question by:jasonsbytes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
12 Comments
 
LVL 39

Expert Comment

by:Adam314
ID: 20367819
On your old server, look at the values of the environment variables ORACLE_HOME and NLS.  You will have to set those the same on this new server.
0
 
LVL 17

Author Comment

by:jasonsbytes
ID: 20368063
Hey Adam... I've done that as far as I can tell:
OLD
PATH=/u/spool/oracle/product/8.1.7/bin:/u/local/binaries:/u/local/bin:/usr/local/bin:/u/local/:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/spool/uucppublic/bin:/usr/bin/X11:/sbin.
ORACLE_BASE=/u/spool/oracle
ORACLE_SID=okcprd01
ORACLE_TERM=vt100
ORACLE_HOME=/u/spool/oracle/product/8.1.7
LIBPATH=/u/spool/oracle/product/8.1.7/lib:/usr/lib
 
 
NEW
PATH=/u/spool/oracle/product/8.1.7/bin:/u/local/binaries:/u/local/bin:/usr/local/bin:/u/local/:/usr/bin:/etc:/usr/sbin:/usr/ucb:/u/home/uniclaim/bin:/usr/bin/X11:/sbin.
ORACLE_BASE=/u/spool/oracle
ORACLE_SID=okcprd01
ORACLE_TERM=vt100
ORACLE_HOME=/u/spool/oracle/product/8.1.7
LIBPATH=/u/spool/oracle/product/8.1.7/lib:/usr/lib

Open in new window

0
 
LVL 39

Expert Comment

by:Adam314
ID: 20368533
Do both computers have version 8.1.7 of oracle on them?
Are the data in /u/spool/oracle/product/8.1.7 the same on both computers?
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 17

Author Comment

by:jasonsbytes
ID: 20368839
yep, it all looks the same... :|
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20368930
Are permissions on all relavant files/directories the same?
0
 
LVL 17

Author Comment

by:jasonsbytes
ID: 20369127
Yes, I've checked the permissions...  Someone else helping just emailed me the attached errors.  Looks like it could be that something isn't compiled correctly...  Any ideas based on this???
install_driver(Oracle) failed: Can't load '/u/unilocal/perl-5.8.0-site/lib/aix/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle:       
0509-130 Symbol resolution failed for /u/unilocal/perl-5.8.0-site/lib/aix/auto/DBD/Oracle/Oracle.so because:
 
        0509-136   Symbol OCIEnvNlsCreate (number 140) is not exported from dependent module /u/spool/oracle/product/8.1.7/lib/libclntsh.a(shr.o).
        0509-136   Symbol OCINlsEnvironmentVariableGet (number 141) is not exported from dependent module /u/spool/oracle/product/8.1.7/lib/libclntsh.a(shr.o).
        0509-136   Symbol OCINlsCharSetNameToId (number 142) is not exported from dependent module /u/spool/oracle/product/8.1.7/lib/libclntsh.a(shr.o).
        0509-022 Cannot load module /u/unilocal/perl-5.8.0-site/lib/aix/auto/DBD/Oracle/Oracle.so.
        0509-026 System error: Cannot run a file that does not have a valid format.
        0509-192 Examine .loader section symbols with the 'dump -Tv' command. at /u/unilocal/perl-5.8.0/lib/aix/DynaLoader.pm line 229. at (eval 2) line 3
 
Compilation failed in require at (eval 2) line 3.
Perhaps a required shared library or dll isn't installed where expected at ./testdb.pl line 32

Open in new window

0
 
LVL 39

Expert Comment

by:Adam314
ID: 20369265
I'm not sure...
Are all of the files in /u/spool/oracle identical on the old and new server?
0
 
LVL 17

Author Comment

by:jasonsbytes
ID: 20369546
Yes, they are identical -- and that may be the problem, because the old OS is an older version of AIX and the new system I believe is running AIX 5.3.  So probably we will have to recompile some stuff...
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20370135
I don't know.  Did you compile on the previous system?
How did you install it on this system?
0
 
LVL 17

Author Comment

by:jasonsbytes
ID: 20370198
I believe the storage guys just did a restore from tape from the previous system...  Someone is checking on it.

I guess we just need to close this question...  Umm, I'm do you want the points or should we just request it be closed since it won't really help anyone else...  Sorry to waste your time, but I appreciate your asstance.
0
 
LVL 39

Accepted Solution

by:
Adam314 earned 1500 total points
ID: 20370397
I think you'll want to install DBI and DBD::Oracle using the recommended install method - probably CPAN.
Doing a restore with other files are different could be causing the problem.

No objections if you want this question deleted.
0
 
LVL 17

Author Comment

by:jasonsbytes
ID: 20449860
This turned out to be a problem with incompatible client/server versions.  We tried using the 9i client and it worked fine.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to recover a database from a user managed backup

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question