Link to home
Start Free TrialLog in
Avatar of imarshad
imarshadFlag for Pakistan

asked on

ORA-12560: TNS:protocol adapter error

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
Avatar of imarshad
imarshad
Flag of Pakistan image

ASKER

I have installed Oracle in "C:\Oracle" directory....

Imran
SOLUTION
Avatar of adrian_ang
adrian_ang
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of earth man2
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>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
Sujit what is <str_name>? and where to find it?

Imran
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of schubach
schubach

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

  sqlplus scott/tiger
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
>>Furthermore, if you set the environment variable LOCAL to OracleT...
How?
Hi Imran,
You can set the environment variable LOCAL in the same place as indicated in the accepted answer above.
I cant see it.... The only options are New, Edit, Delete

Imran
Maybe someone from you can help me in this other question.....

https://www.experts-exchange.com/questions/21403950/Conversion-from-Access-to-Oracle.html

Imran
If you click 'New', there will be options for Variable Name and Variable Value.
>>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
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.