Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-09-29
6
Medium Priority
?
2,772 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
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.

671 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