Search This Blog

Thursday, February 8, 2007

ORA-12505

Reason When ORACLE_SID <> SERVICE_NAMES

My ORACLE_SID = db01
My SERVICE_NAMES = taj

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
db01

SQL> show parameter service_names

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string Taj
SQL>

Take a look on my tnsnames.ora file
SQL> host type C:\oracle\product\10.1.0\Db_1\NETWORK\ADMIN\tnsnames.ora
# tnsnames.ora Network Configuration File: C:\oracle\product\10.1.0\Db_1\network
\admin\tnsnames.ora
# Generated by Oracle configuration tools.

TAJ =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = taj.domainname.local)(PORT = 1521
))
(CONNECT_DATA =
(SERVER = DEDICATED)
[B](SID = Taj)[/B]
)
)
SQL> conn system/oracle@taj
ERROR:
ORA-12505: TNS:listener does not currently know of SID given in connect
descriptor


Warning: You are no longer connected to ORACLE.
SQL> --edit my tnsnames.ora file from SID to SERVICE_NAME.
SQL> host type C:\oracle\product\10.1.0\Db_1\NETWORK\ADMIN\tnsnames.ora
# tnsnames.ora Network Configuration File: C:\oracle\product\10.1.0\Db_1\network
\admin\tnsnames.ora
# Generated by Oracle configuration tools.

TAJ =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = taj.domainname.local)(PORT = 1521
))
(CONNECT_DATA =
(SERVER = DEDICATED)
[B](SERVICE_NAME = Taj)[/B]
)
)

SQL> conn system/oracle@taj
Connected.

2 comments:

Anonymous said...

Mr Taj, I m new to this Oracle world and was trying to connect my Jdeveloper to my Oracle 10g express edition and was failing with Ora-12505. The reason was the standard jdeveloper was taking SID as ORCL and the SID on 10g express was XE. Your blog was helpful in solving my problem. Regards.
anand_manchala@hotmail.com

Mohammed Taj said...

Hi,
Thank You !!!

regards
Taj