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

x
?
Solved

ORA-12560: TNS:protocol adapter error - Want to "connect scott/tiger"

Posted on 2004-09-29
6
Medium Priority
?
2,775 Views
Last Modified: 2007-12-19
When I do this:

SQL> connect scott/tiger
ERROR:
ORA-12560: TNS:protocol adapter error

However this works:

SQL> connect scott/tiger@svrmargus
Connected.
SQL>

I would like to know why "connect scott/tiger" is not working and how to fix it ?
0
Comment
Question by:MargusLehiste
6 Comments
 
LVL 10

Expert Comment

by:Jay Toops
ID: 12182237
normally you would say
connect {Servername}

then it would prompt for
userid and password

there is not "Default" dabase in the interactive sql tool

connect scott/tiger doesn't work because you havent told it what server that userid/password is on

Jay
0
 
LVL 7

Expert Comment

by:Bigfam5
ID: 12182491
If you are loging-in from the Client you must have the @Service Name
From the DB Server, it depends on how the SQLNET.ora file parameters are setup

0
 
LVL 1

Author Comment

by:MargusLehiste
ID: 12182719
Show how would i set up this parameter,

Im using SQL*Plus on the same machine as DB is located @
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
baonguyen1 earned 1200 total points
ID: 12182781
simple say that the sqlplus session does not know where it should connect to, so a connection string that specify the connection in the TNSNAMES.ORA should be specify:

If you are on the same machine of the database, just set the SID environment variable, say you are on NT:

C:\set ORACLE_SID=xyz
C:\sqlplus /nolog
SQL>connect scott/tiger
connected
SQL>
0
 
LVL 8

Expert Comment

by:annamalai77
ID: 12187530
hi there

the connectino string in oracle is like a human ear, which is used to listen to the oracle database.

the connection string is created and stored in the tnsnames.ora file using the net8 easy config menu option which asks for the host or the server name, the database name, the protocol and the connection string name.

regards
annamalai
0
 

Expert Comment

by:TheGoToGuy
ID: 12194384
Baonguyen1 has the gist of it.  If the database and client are on the same server, then set the ORACLE_SID parameter.
In Unix(using Korn shell) it would be:  export ORACLE_SID=abc1
In Windows 2000/NT/XP it would be : set ORACLE_SID=abc1

Additionally, depending on the version of Oracle you are using, you can set the environment variable of LOCAL=YES which would indicate that the connection is to occur on the server you are currently on.
You do not have to specify the connect name or database name unless the database is on a different machine than the one you are currently own or if you want to use SQLNet to connect to a database even though you are on the same server as the database.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

886 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