I have been getting this oracle error and not even successfull trying
to connect to the oracle database---i have tried several combinations
to connect but no luck..
Unable to connect : ORA-12705: Cannot access NLS data files or invalid
environment specified (DBD ERROR: OCISessionBegin)
my code to conect is -
use DBI;
my $dbh = DBI->connect('dbi:Oracle:', q{scott/tiger@(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=SIDNAME)
(SERVICE_NAME = bony)
)
)},"" )|| die "Unable to connect : $DBI::errstr\n";
print "connection established\n";
Please help..
Thanks..Bony
I'm not familiar with the notation you're using, above. I've set up
the connection using one of the following two ways:
1. Using ORACLE_HOME and the tnsnames.ora file (see your Oracle
manuals and tutorials for how to set up your environment), and assuming
the SID is 'bony', your connect string would look like:
my $dbh = DBI->connect('dbi:Oracle:bony', $user, $passwd) or die ...
2. But I prefer, at least for an application that is designed to work
with a specific schema, to use this format (which allows you to
dispense with the environment and having to use the tnsnames.ora file):
my $dbh = DBI->connect('dbi:Oracle:host=host.com;port=1521;sid=bony',
$user, $passwd)
or die ...
The DBI connect function allows you to add additional information, such
as attributes that control some of how the connection works, but you
should get this working before trying to add functionality.
Hope this helps.
Bob