Solved

Connecting to oracle database

Posted on 2006-06-28
5
1,213 Views
Last Modified: 2010-05-18
Hi

I am using rhe current code to connect to an oracle database:

#!/C/perl/bin/

use strict;
use DBI;
my $dbhost = DBI->connect("dbi:Oracle:test.world",'pass','pass') || die "Cant connect to Oracle database $DBI::errstr\n";

I am getting the following error

DBI connect('test.world',test',...) failed: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at test.pl line 6
Cant connect to Oracle database ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach)

Any ideas what is the problem?
0
Comment
Question by:gghaleb
  • 2
  • 2
5 Comments
 

Author Comment

by:gghaleb
ID: 17004442
Now I get the following error:

DBI connect('test.world','pass',...) failed: ORA-12705: invalid or unknown NLS parameter value specified (DBD ERROR: OCISessionBegin) at test.pl line 6
Cant connect to Oracle database ORA-12705: invalid or unknown NLS parameter value specified (DBD ERROR: OCISessionBegin)

any ideas
0
 
LVL 12

Expert Comment

by:stefan73
ID: 17008414
Hi gghaleb,
That does not look like a specific Perl / DBI problem. Please check if you can connect to your destination using sql*plus:

sqlplus user/pass@instance


Enjoy,

Stefan
0
 
LVL 12

Accepted Solution

by:
stefan73 earned 500 total points
ID: 17008419
gghaleb,


or in your case: sqlplus pass/pass@test.world

You might want to try:

tnsping test.world

Stefan
0
 
LVL 6

Expert Comment

by:tone28
ID: 17010854
You will need the Oracle client and the appropriate TNSNames in your C:\ORAXXX\Network\Tnsnames.txt or whatever.

Does that make sense?
0
 

Author Comment

by:gghaleb
ID: 17027065
Hi All,

I have the database already in tnsnames.ora and I can connect to it using sqlplus.
This was not the problem. The problem was related to an environment variable NLS_LANG. which needed to be set.

This is an Oracle problem rather than a perl problem. Thanks for your help anyway.

Regards

0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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