?
Solved

ORA-12560: TNS:protocol adapter error

Posted on 2005-04-26
25
Medium Priority
?
14,267 Views
Last Modified: 2012-06-21
Hi all,
        I have just recently installed Oracle 9i. I am a very novice level user... When I installed it and opened Oracle SQL*Plus and entered the default user name and password (scott tiger) I was able to Log into Oracle. After the weekend (Restarted the system) and now I get this ORA-12560 TNS:protocol adapter error. How can I resolve this problem?Will I need to give some "Host String" or what? The most amazing thing is that 2 days back it was running and now suddenly it is not working... I hope someone will give me the method to come out of this problem.... Note that I am/will not be using any feature related to Internet or Network or anything else. I will use Oracle as a Storage device(Back End) with my VB6 application frontend....

OS: Windows XP SP1
Firewall : ZoneAlarm installed (If it helps)

Imran
0
Comment
Question by:imarshad
  • 11
  • 5
  • 2
  • +4
25 Comments
 
LVL 13

Author Comment

by:imarshad
ID: 13865052
I have installed Oracle in "C:\Oracle" directory....

Imran
0
 
LVL 5

Assisted Solution

by:adrian_ang
adrian_ang earned 200 total points
ID: 13865108
0
 
LVL 13

Author Comment

by:imarshad
ID: 13865147
I have already tried that option..... I donot have developer installed So I have only one home... and it(tnsnames.ora) is in the Oracle\Network\ADMIN directory which is the default directory??? Anyways I have created the TNS_ADMIN and given the correct path of tnsnames.ora but still no success.....

Imran
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 13

Author Comment

by:imarshad
ID: 13865164
and when I tried to run Oracle Home Selector I gte this message that "There is only one(1) Oracle home defined......" So this means I am not having problem with the Home address thing.....

Imran
0
 
LVL 5

Assisted Solution

by:helpneed
helpneed earned 400 total points
ID: 13865269
hi
Cause:
Oracle classify this as a ‘generic protocol adapter error’. In my experience it indicates that Oracle client does not know what instance to connect to or what TNS alias to use.

Possible Remedies:
If running on the server (or workstation) that is running the database (i.e. if the database is local to the machine) then try explicitly setting ‘ORACLE_SID’. e.g.

set ORACLE_SID=<sid>

and then try again. If this works then consider whether to make the change permanent by specifying it as a system variable.

(Possibly 8.1.5 and later:) If running on the server (or workstation) that is running the database then check that the service name ‘OracleService<SID>’ ties up with the actual database SID. If the database SID is changed without recreating the service then this can lead to this error. To recreate the service:

oradimxx -delete -sid <old-sid>

oradimxx -new -sid <SID> -intpwd <internal-password> AUTO -pfile <full-init-ora-filename>

Try setting the environment variable ‘LOCAL’ to the required connection alias (typically the database SID) and then try again. Do be sure that the application that is being used picks up the new environment variable setting. Setting this to an invalid connection alias will typically produce ORA-12154: TNS:could not resolve service name.

Ignore the error and try connecting by specifying explicitly which connection alias to use.

Check that the network connection between the client computer and the server has not failed. From the client try pinging the server. (For general guidance on troubleshooting general network connectivity problems click here.)

Brian Brooks (Encorus Technologies, USA) has highlighted a problem with DHCP. If the database server has its IP address dynamically allocated by DHCP then its IP address may change. This is not likely to be a problem on a local network where DNS will take care of name resolution issues, but where the database server is on a remote network and its IP address needs to be explicitly specified in the client's lmhosts file then this can be a problem because it requires periodic updates to the client's lmhosts file. If faced with this scenario then push to get the database server allocated a permanent IP address.

Pls. check if sql net products are installed properly and database entries made in tnsnames.ora


regards

0
 
LVL 22

Expert Comment

by:earth man2
ID: 13865276
What is the result of

ipconfig /all

Is your server IP address the same as it was when you installed Oracle ?  Oracle has to be installed on a machine that has a fixed ip address.

On the server.
set ORACLE_SID=youroraclesid
sqlplus scott/tiger

On the client
ping the.ip.addre.ss
tnsping your_oracle_tns_name
tnsping your_oracle_tns_name.WORLD
sqlplus scott/tiger@your_oracle_tns_name

What is the server output of
lsnrctl status
0
 
LVL 11

Assisted Solution

by:sujit_kumar
sujit_kumar earned 200 total points
ID: 13865330
Have you created the TNS entry for your server properly? if not then create it through "Net Configuration Assistant" From the Start Menu. Try TNSPING <str_name> from command prompt andd post the messsage/error you are getting.  
0
 
LVL 13

Author Comment

by:imarshad
ID: 13865398
>>If running on the server (or workstation) that is running the database (i.e. if the database is local to the machine) then try explicitly setting ‘ORACLE_SID’. e.g.

>>set ORACLE_SID=<sid>

As stated earlier I have no experience what so ever with Oracle.... THis is the first time I have installed Oracle..... I dont know what SID is and how to set it? Can you guide me with more detail??

and I have installed Oracle on my local system and I will access it onyl from this system i.e no clients will connect to the Database except my VB6 application that will reside on the Server.....

>>On the server.
>>set ORACLE_SID=youroraclesid
>>sqlplus scott/tiger

Again where should I enter these values and what will be youroraclesid???? and where to find it?

Imran
0
 
LVL 13

Author Comment

by:imarshad
ID: 13865419
Sujit what is <str_name>? and where to find it?

Imran
0
 
LVL 13

Author Comment

by:imarshad
ID: 13865441
This is my file

# TNSNAMES.ORA Network Configuration File: C:\Oracle\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

INST1_HTTP =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = imran)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = SHARED)
      (SERVICE_NAME = MODOSE)
      (PRESENTATION = http://HRService)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

ORACLET =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = imran)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = OracleT)
    )
  )


and this is what I got by the ping command

D:\Documents and Settings\Imran12>tnsping OracleT

TNS Ping Utility for 32-bit Windows: Version 9.0.1.1.1 - Production on 26-APR-20
05 16:12:34

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
C:\Oracle\network\admin\sqlnet.ora
C:\Oracle\network\admin\tnsnames.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = imran)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = OracleT)))
OK (4920 msec)

D:\Documents and Settings\Imran12>

Imran Arshad
0
 
LVL 5

Assisted Solution

by:helpneed
helpneed earned 400 total points
ID: 13865468
hi

The SID is a site identifier.  It plus the Oracle_home are hashed together in
Unix to create a unique key name for attaching an SGA.  If your Oracle_sid or
Oracle_home is not set correctly, you'll get "oracle not available" since we
cannot attach to a shared memory segment that is identified by magic key.  On
NT, we don't use shared memory but the SID is still important.  We can have more
then 1 database on the same oracle home so we need a way to id them.


Find the sid -- select instance from v$thread will do that


PURPOSE
  This entry describes how to find and change the "db_name" for a database, or  
the ORACLE_SID for an instance, without recreating the database.  
 
SCOPE & APPLICATION
  For DBAs requiring to either find or change the db_name or ORACLE_SID.


To find the current DB_NAME and ORACLE_SID:
===========================================

Query the views v$database and v$thread.

    V$DATABASE gives DB_NAME
    V$THREAD gives ORACLE_SID

If ORACLE_SID = DB_SID and db_name = DBNAME:

To find the current value of ORACLE_SID:

    SVRMGR> select instance from v$thread;

    INSTANCE
    ----------------
    DB_SID

To find the current value of DB_NAME:

    SVRMGR> select name from v$database;

    NAME
    ---------
    DBNAME

set this sid and connect it

regards
0
 
LVL 7

Assisted Solution

by:Mehul Shah
Mehul Shah earned 400 total points
ID: 13865812
As per your TNS file "ORACLET" is your database SID / Service_Name.

From the command prompt can you fire the below command and post the output.

lsnrctl status
0
 
LVL 4

Accepted Solution

by:
schubach earned 400 total points
ID: 13865821
Since you are running in Windows XP, the way to set the ORACLE_SID is as a Windows environment variable namely:
  1. Start/Settings/Control Panel
  2. System (you may need to go to Classic View to find this)
  3. Advanced
  4. Environment Variables
  5. Name of variable is ORACLE_SID
  6. Value of variable is OracleT
0
 
LVL 22

Assisted Solution

by:earth man2
earth man2 earned 400 total points
ID: 13866019
Since tnsping seems to work there should be no reason why yaou can't connect with your client.

Check the connect string being used !

scott/tiger@ORACLET

or

scott/tiger@ORACLET.WORLD

where WORLD is the
NAMES.DEFAULT_DOMAIN
defined in your clients sqlnet.ora file
0
 
LVL 11

Expert Comment

by:sujit_kumar
ID: 13866049
So that means you can easily connect to your server using OracleT as your connection string. There should be no problem.

user user/password@tns_str to connect to your database,

Like,

sqlplus scott/tiger@OracleT


This will do.

Sujit
0
 
LVL 4

Expert Comment

by:schubach
ID: 13866102
Furthermore, if you set the environment variable LOCAL to OracleT, then you can connect without a connect string:

  sqlplus scott/tiger
0
 
LVL 7

Assisted Solution

by:Mehul Shah
Mehul Shah earned 400 total points
ID: 13866133
Yes using oracle tools you will be able to connect to the db without using the HOST String but if you need to connect to the DB from the front end tools like VB than you will need to create an ODBC connect using the HOST String ORACLET and than you should be able to connect to the database from VB.
0
 
LVL 13

Author Comment

by:imarshad
ID: 13874004
I have been able to connect to my database now..... I am using scott/tiger@OracleT and it is working....
And after setting the environment variable I can now simply connect using scott/tiger.

Thanks a lot to all of you for your help.....

Imran
0
 
LVL 13

Author Comment

by:imarshad
ID: 13874013
>>Furthermore, if you set the environment variable LOCAL to OracleT...
How?
0
 
LVL 4

Expert Comment

by:schubach
ID: 13874089
Hi Imran,
You can set the environment variable LOCAL in the same place as indicated in the accepted answer above.
0
 
LVL 13

Author Comment

by:imarshad
ID: 13874155
I cant see it.... The only options are New, Edit, Delete

Imran
0
 
LVL 13

Author Comment

by:imarshad
ID: 13874161
Maybe someone from you can help me in this other question.....

http://www.experts-exchange.com/Databases/Oracle/Q_21403950.html

Imran
0
 
LVL 4

Expert Comment

by:schubach
ID: 13874173
If you click 'New', there will be options for Variable Name and Variable Value.
0
 
LVL 13

Author Comment

by:imarshad
ID: 13883648
>>If you click 'New', there will be options for Variable Name and Variable Value.

How can I set the variable to be local to OracleT from there? Still dont know how to do it....

Imran
0
 
LVL 4

Expert Comment

by:schubach
ID: 13884024
Hi Imran,

I was suggesting that you set a variable with the
  variable name: Local
  variable value: OracleT

If you are already able to connect without specifying the host string, however, then this is not necessary.
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
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 Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

840 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