Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connection without tnsnames.ora

Status
Not open for further replies.

sirron

Programmer
Mar 11, 2004
139
0
0
US
Our database is on an Unix Server

I am able to connect to the database without having an tnsnames.ora file.

I'm not sure how I am connecting to the database. I thought that you must have a tnsnames.ora file to connect to the database.

And for some reason I can without having a tnsnames.ora file.

Does any one now how you can connect without a tnsnames.ora file.

Are these parameters setup in a different file or are there variables set that does this function?

please help
 
Sirron,

When you connect "<username>/<password>@<instance_alias>", then Oracle looks in your tnsnames.ora to resolve "<instance_alias>". If it successfully resolves the reference, it then uses the "host" entry of that alias to proceed with a connection attempt, which depends upon a successful connection and SID/SERVICE_NAME resolution via the Listener on the "host" in your tnsnames.ora reference.

If, instead, you connect with "<username>/<password>", then Oracle presumes you are attempting a connection to an Oracle database on the same machine from which you are attempting the connect. To be successful, however, Oracle needs valid values in your system variables $ORACLE_SID and $ORACLE_HOME, which point to the instance name and ORACLE_HOME path of a working database instance on the same machine from which you are attempting the connection.

To confirm the values of those two variables (and to explain why your connection was successful), you can issue the following Unix commands:
Code:
echo $ORACLE_SID
echo $ORACLE_HOME

Let us know your findings.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 00:30 (18Nov04) UTC (aka "GMT" and "Zulu"),
@ 17:30 (17Nov04) Mountain Time
 
Yes these variables are setup and it points to ORACLE_HOME and the SID.

But how does that tell me how its connecting without a tnsnames.ora file?
 
Sirron,

As I mention in my post above, if you do not use the "@<alias>" connection convention, Oracle's default behaviour is to ignore the tnsnames.ora file.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
@ 01:27 (18Nov04) UTC (aka "GMT" and "Zulu"),
@ 18:27 (17Nov04) Mountain Time
 
then what does it use for the connection

just username and password
and the environment variables
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top