Link to home
Start Free TrialLog in
Avatar of Janelau
Janelau

asked on

ORA-12505: TNS:listener could not resolve SID given in connect descriptor

I encountered a problem with connecting to the Oracle databse. Here is the description of the problem.
Backgroud : I am using Win2K advance server and Oracle 8i Server. To avoid version conflict, i installed my Oracle 8i Server in OraHome01 and Oracle Enterprise Manager in OraHome02. By using 2 different oracle homes in the registry and 2 different physical path, i solve the conflict. Then, i did the following setting in the registry.
Oralce NLS_LANG
    ORACLE - SIMPLIFIED CHINESE_CHINA.ZHS16GBK
    ID0(OraHome81) - NA
    ID1(OraHome80 if available) - American_America.WE8ISO8859P1 (have to, otherwise
cannot start the service, why?)
    Home0(OraHome81) - SIMPLIFIED CHINESE_CHINA.ZHS16GBK
    Home1(OraHome80 if available) - SIMPLIFIED CHINESE_CHINA.ZHS16GBK

I got the following above error message when trying to connect to the db using Oracle Enterprise Manager's SQLPlus which NLS setting default to American. ("ORA-12505: TNS:listener could not resolve SID given in connect descriptor") This problem is solved temporarily when i reconfigured the database using the Oracle8i's database configuration assistant. But once i restart my computer, the problem resume. I totally cannot connect to the database using Oracle 8i's SQLPlus and got the error message as "ORA-12514: TNS: *****(funny funny characters)****, *** SERVICE_NAME")
A little bit of the background when i did the Oracle 8i's installation. The machine that i did the installation is a new machine and hasn't got any network installation during the 8i installation. The Wireless LAN installation only done after the 8i's installation.
Can anybody help me to resolve the problem?
Thanks.
Avatar of hani430
hani430

Have you tested the connect to the database on Net8? Perhaps there is a wrong sid written in the tnsnames.ora
Does the listener listen to your database? Control the path of the used listener.ora with lsnrctl status. In both of your oracle-homes there is one, but only one is used.
Have you testet changing the oracle-home?
ASKER CERTIFIED SOLUTION
Avatar of schwertner
schwertner
Flag of Antarctica 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
Do a search for tnsnames.ora file. Could be that when you installed into two separate homes, there are 2 tnsnames.ora files on your computer in different oracle homes. So when you are creating your new connection using sql*net or whatever, it is writing to the wrong tnsnames.ora file.

So a search might return you 2 tnsnames.ora files. Make a backup copy of both these files. Open both of them and search for the connection name you have given. It should be in one and not the other. Copy the complete connection details to the one that doesnt have it. Save and try connecting to your db again. Make sure the oracle services are running.

Other issues about NLS_LANG,

If the database is set up using a specified NLS_LANG, you can get the result if you specify Oracle Session with that NLS_LANG.
In case you're not possible to define NLS_LANG on your registry, you can define it on either environment variable or from sqlplus session using alter session command.

example:
# setenv NLS_LANG SIMPLIFIED CHINESE_CHINA.ZHS16GBK
or from sqlplus,
alter session set nls_language Chinese.

There is other issue you should learn regarding combination of NLS_LANG, NLS_TERRITORY, and others NLS_..., there is a rule to overide between them



Thanks

Wandi



Avatar of Janelau

ASKER

wandi,

This is a useful hints for the NLS settings. Thanks.


Jane
Avatar of Janelau

ASKER

schwertner,

Thanks for your answer. It is not a straight forward answer but it helps to give hints to solve this particular as well as other Oracle problems.


Jane