ORA-12505, TNS: Oracle 11g连接问题!求助啊!~
用Oracle 11g 自带的 SQL Develpoer 连接本地机上的Oracle 11g数据库!~
下面是我的情况,请耐心的看完,谢谢。
SQL Develpoer 连oracle 有3种连接方式,
1.Basic
2.TNS
3.Advanced
我全都试过了,说说各种方式的结果
1.Basic
分别填写
Hostname:localhost;
Port:1521;
SID:orcl
结果是 ORA-12505
2.TNS
选择Network Alias
结果是 The Network Adapter could not establish the connection
选择Connection Identifier
结果是连接成功,这是也唯一的能连接成功
3.Advanced
Custom JDBC URL:
jdbc:oracle:thin:@localhost:1521:orcl
结果是 ORA-12505
PS:JDK 1.6, ORACLE 11g
监听和服务也都运行了。
本身用JDBC代码连接Oracle数据库也出问题,异常提示为:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl
帮帮我啊,都困扰我几天了,一直都没有找到办法
以下为$ORACLE_HOME/network/admin下
listener.ora,tnsnames.ora,sqlnet.ora三个文件的的内容
# listener.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
-----------------------
# tnsnames.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
-------------------------
# sqlnet.ora Network Configuration File: F:\app\Administrator\product\11.1.0\db_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)