我从 Oracle DB 开始。在 Windows Server 2003 上,我安装了 Oracle Database 10g Express Edition,然后还安装了 PL SQL Developer。
我尝试通过 PL SQL Developer 登录到 XE 数据库。
我使用这个凭证:
- 用户名:system
- 密码: 密码正确:)
- 数据库:XE
我收到此错误:ORA-12528。所以我谷歌了一下并尝试了这个解决方案: http://www.dba-oracle.com/sf_ora_12528_tns_listener_all_appropriate_instances_are_blocking_new_connection_tips_bc1.htm:
SQL> conn system as sysdba
Enter password:
Connected.
SQL> $ lsnrctl
LSNRCTL> stop
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
The command completed successfully
并再次启动监听器
LSNRCTL> start
Starting tnslsnr: please wait...
TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
System parameter file is C:\oraclexe\app\oracle\product\10.2.0\server\network\ad
min\listener.ora
Log messages written to C:\oraclexe\app\oracle\product\10.2.0\server\network\log
\listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR
_XEipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jan)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
ction
Start Date 24-J┌N-2011 19:14:14
Uptime 0 days 0 hr. 0 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\a
dmin\listener.ora
Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\l
og\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jan)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
然后我再次尝试通过 PL SQL Developer 连接到 XE 数据库,但出现错误 ORA 12514。
我已检查侦听器日志文件(监听器日志),输出如下:
System parameter file is C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
Log messages written to C:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log
Trace information written to C:\oraclexe\app\oracle\product\10.2.0\server\network\trace\listener.trc
Trace level is currently 0
Started with pid=2964
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jan)(PORT=1521)))
Listener completed notification to CRS on start
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
24-JÚN-2011 19:17:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=Administrator))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169869568)) * status * 0
24-JÚN-2011 19:18:19 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)(CID=(PROGRAM=C:\Program Files\PLSQL Developer\plsqldev.exe)(HOST=JAN)(USER=Administrator))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.5.100)(PORT=2907)) * establish * XE * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
24-JÚN-2011 19:18:48 * service_register * xe * 0
我在这里放置了配置。
tnsname.ora
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = jan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
监听器
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = jan)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
我尝试在 tsname.ora 中进行了更改,并将 SERVICE_NAME 更改为 SID
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = jan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = XE)
)
)
但是我得到了错误:
**ORA-12505** TNS: listener does not currently know of SID given in connect descriptor
我删除了 tsname.ora 中的更改(SID = XE => SERVICE_NAME=XE)并最后使用命令检查了监听器的状态。
LSNRCTL> stat
结果在这里:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
ction
Start Date 24-J┌N-2011 19:30:31
Uptime 0 days 0 hr. 5 min. 57 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\a
dmin\listener.ora
Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\l
og\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=jan)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XE_XPT" has 1 instance(s).
Instance "xe", status BLOCKED, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
我试过重新启动 OracleServiceXE(控制面板 > 管理工具 > 服务>)
解决此问题的最后一次尝试是通过 cmd 连接到 XE。
SQL> conn system/jano@XE
ERROR:
ORA-12528: TNS:listener: all appropriate instances are blocking new connections
什么都不起作用。我无法连接到 XE。
这是我第一次处理 Oracle DB。问题的根源是什么以及如何解决此问题。
谢谢你的合作。
答案1
一旦禁用所有网络连接,然后重新启动您的 PC/服务器,然后尝试登录。如果成功,请启用所有网络连接。