Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Connecting to oracle database

Posted on 2006-06-28
5
Medium Priority
?
1,241 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 1500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
Six Sigma Control Plans

926 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