ORA-12505:TNS:监听器当前不知道连接描述符中给出的SID(DBD ERROR:OCIServerAttach)

时间:2010-07-16 18:34:53

标签: oracle10g windows-server-2003 virtualbox

我创建了一个在VirtualBox上运行的Windows 2003 R2虚拟机,我安装了Oracle(10201_database_win32)。

我也在虚拟以太网上分配了静态IP。

安装后一切都很顺利。

我列出了(lsnrctl services)安装后听众知道的服务,结果是:

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 15-JUL-2010 23:02
:19

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:39 refused:0 state:ready
         LOCAL SERVER
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1002 state:ready
         DISPATCHER <machine: ORACLE10GVM, pid: 760>
         (ADDRESS=(PROTOCOL=tcp)(HOST=oracle10gvm)(PORT=1035))
Service "orcl_XPT" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:39 refused:0 state:ready
         LOCAL SERVER
The command completed successfully

所以我重新启动,没有任何工作了。我执行了同样的命令,这就是我得到的:

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 16-JUL-2010 21:29:20

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
The command completed successfully

我unistalled /重新安装5-6次,没有。所以我不太明白这是什么问题。 在我检查的情况下,这些服务都已启动并运行。

我在这里缺乏想法和时间。

有什么建议吗?我检查了很多论坛等没有具体的答案或解决方案。

我希望有人可以提供帮助!

这是listener.log文件:

TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production on 15-JUL-2010 21:56:27

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

System parameter file is C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
Log messages written to C:\oracle\product\10.2.0\db_1\network\log\listener.log
Trace information written to C:\oracle\product\10.2.0\db_1\network\trace\listener.trc
Trace level is currently 0

Started with pid=372
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle10gvm)(PORT=1521)))
Listener completed notification to CRS on start

TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
15-JUL-2010 21:56:30 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=Administrator))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169869568)) * status * 0
15-JUL-2010 21:56:35 * service_register * orcl * 0
15-JUL-2010 21:57:15 * service_update * orcl * 0
15-JUL-2010 21:57:17 * service_died * orcl * 12537
15-JUL-2010 21:57:19 * service_register * orcl * 0
15-JUL-2010 21:57:22 * service_update * orcl * 0
15-JUL-2010 21:57:25 * service_update * orcl * 0
15-JUL-2010 21:57:46 * service_update * orcl * 0
15-JUL-2010 21:57:55 * service_update * orcl * 0
15-JUL-2010 21:58:14 * service_update * orcl * 0
15-JUL-2010 21:58:17 * service_update * orcl * 0
15-JUL-2010 21:58:23 * service_update * orcl * 0
15-JUL-2010 21:58:26 * service_died * orcl * 12537
15-JUL-2010 21:58:28 * service_register * orcl * 0
15-JUL-2010 21:58:33 * service_update * orcl * 0
15-JUL-2010 21:58:36 * service_update * orcl * 0
15-JUL-2010 21:58:39 * service_update * orcl * 0
15-JUL-2010 21:58:45 * service_update * orcl * 0
15-JUL-2010 21:58:56 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1037)) * establish * orcl * 0
15-JUL-2010 21:58:57 * service_update * orcl * 0
15-JUL-2010 21:58:57 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1038)) * establish * orcl * 0
15-JUL-2010 21:58:57 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1039)) * establish * orcl * 0
15-JUL-2010 21:58:57 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1040)) * establish * orcl * 0
15-JUL-2010 21:59:00 * service_update * orcl * 0
15-JUL-2010 21:59:06 * service_update * orcl * 0
15-JUL-2010 21:59:39 * service_update * orcl * 0
15-JUL-2010 22:00:12 * service_update * orcl * 0
15-JUL-2010 22:00:20 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1046)) * establish * orcl * 0
15-JUL-2010 22:00:21 * service_update * orcl * 0
15-JUL-2010 22:00:23 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\emagent.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1047)) * establish * orcl * 0
15-JUL-2010 22:00:25 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\emagent.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1048)) * establish * orcl * 0
15-JUL-2010 22:00:26 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1050)) * establish * orcl * 0
15-JUL-2010 22:00:28 * ping * 0
15-JUL-2010 22:00:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:00:38 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1054)) * establish * orcl * 0
15-JUL-2010 22:00:39 * log_status * 0
15-JUL-2010 22:00:42 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169869568)) * status * 0
15-JUL-2010 22:00:45 * service_update * orcl * 0
15-JUL-2010 22:01:08 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1068)) * establish * orcl * 0
15-JUL-2010 22:01:18 * service_update * orcl * 0
15-JUL-2010 22:01:51 * service_update * orcl * 0
15-JUL-2010 22:02:04 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 22:02:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:05:28 * ping * 0
15-JUL-2010 22:05:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:05:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1102)) * establish * orcl * 0
15-JUL-2010 22:07:01 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1111)) * establish * orcl * 0
15-JUL-2010 22:07:02 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1112)) * establish * orcl * 0
15-JUL-2010 22:07:03 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1113)) * establish * orcl * 0
15-JUL-2010 22:07:03 * service_update * orcl * 0
15-JUL-2010 22:07:55 * service_update * orcl * 0
15-JUL-2010 22:08:58 * service_update * orcl * 0
15-JUL-2010 22:10:28 * ping * 0
15-JUL-2010 22:10:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:10:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1137)) * establish * orcl * 0
15-JUL-2010 22:11:31 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1141)) * establish * orcl * 0
15-JUL-2010 22:12:31 * service_update * orcl * 0
15-JUL-2010 22:12:56 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1150)) * establish * orcl * 0
15-JUL-2010 22:15:28 * ping * 0
15-JUL-2010 22:15:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:15:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1170)) * establish * orcl * 0
15-JUL-2010 22:16:07 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1173)) * establish * orcl * 0
15-JUL-2010 22:16:53 * service_update * orcl * 0
15-JUL-2010 22:17:04 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 22:17:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:19:02 * service_update * orcl * 0
15-JUL-2010 22:20:20 * service_update * orcl * 0
15-JUL-2010 22:20:28 * ping * 0
15-JUL-2010 22:20:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:20:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1199)) * establish * orcl * 0
15-JUL-2010 22:21:14 * service_update * orcl * 0
15-JUL-2010 22:25:28 * ping * 0
15-JUL-2010 22:25:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:25:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1227)) * establish * orcl * 0
15-JUL-2010 22:26:33 * service_update * orcl * 0
15-JUL-2010 22:27:01 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1236)) * establish * orcl * 0
15-JUL-2010 22:27:03 * service_update * orcl * 0
15-JUL-2010 22:30:28 * ping * 0
15-JUL-2010 22:30:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:30:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1259)) * establish * orcl * 0
15-JUL-2010 22:31:07 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1262)) * establish * orcl * 0
15-JUL-2010 22:31:09 * service_update * orcl * 0
15-JUL-2010 22:32:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 22:32:06 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:35:22 * service_update * orcl * 0
15-JUL-2010 22:35:28 * ping * 0
15-JUL-2010 22:35:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:35:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1288)) * establish * orcl * 0
15-JUL-2010 22:40:28 * ping * 0
15-JUL-2010 22:40:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:40:34 * service_update * orcl * 0
15-JUL-2010 22:40:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1316)) * establish * orcl * 0
15-JUL-2010 22:42:56 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1329)) * establish * orcl * 0
15-JUL-2010 22:44:56 * service_update * orcl * 0
15-JUL-2010 22:45:28 * ping * 0
15-JUL-2010 22:45:29 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:45:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1345)) * establish * orcl * 0
15-JUL-2010 22:46:08 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1348)) * establish * orcl * 0
15-JUL-2010 22:46:08 * service_update * orcl * 0
15-JUL-2010 22:47:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 22:47:06 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:50:20 * service_update * orcl * 0
15-JUL-2010 22:50:28 * ping * 0
15-JUL-2010 22:50:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:50:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1376)) * establish * orcl * 0
15-JUL-2010 22:55:28 * ping * 0
15-JUL-2010 22:55:28 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 22:55:36 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1404)) * establish * orcl * 0
15-JUL-2010 22:55:39 * service_update * orcl * 0
15-JUL-2010 22:58:32 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1423)) * establish * orcl * 0
15-JUL-2010 22:58:32 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1424)) * establish * orcl * 0
15-JUL-2010 22:58:33 * service_update * orcl * 0
15-JUL-2010 22:58:36 * service_update * orcl * 0
15-JUL-2010 22:58:37 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1425)) * establish * orcl * 0
15-JUL-2010 22:58:37 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SID=orcl)(SERVER=DEDICATED)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1426)) * establish * orcl * 0
15-JUL-2010 22:58:37 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1427)) * establish * orcl * 0
15-JUL-2010 22:58:39 * service_update * orcl * 0
15-JUL-2010 22:59:09 * service_update * orcl * 0
15-JUL-2010 22:59:43 * service_update * orcl * 0
15-JUL-2010 23:00:26 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1439)) * establish * orcl * 0
15-JUL-2010 23:00:29 * ping * 0
15-JUL-2010 23:00:29 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 23:00:37 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1445)) * establish * orcl * 0
15-JUL-2010 23:01:07 * service_update * orcl * 0
15-JUL-2010 23:01:08 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe)(HOST=ORACLE10GVM)(USER=SYSTEM))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1448)) * establish * orcl * 0
15-JUL-2010 23:02:04 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=services)(ARGUMENTS=64)(SERVICE=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521))))(VERSION=169869568)) * services * 0
15-JUL-2010 23:02:05 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=SYSTEM))(COMMAND=status)(ARGUMENTS=64)(SERVICE=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10gvm)(PORT=1521)))(VERSION=169869568)) * status * 0
15-JUL-2010 23:02:20 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=)(USER=Administrator))(COMMAND=services)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=169869568)) * services * 0
15-JUL-2010 23:03:07 * service_update * orcl * 0
15-JUL-2010 23:03:07 * service_died * orcl * 12547
TNS-12547: TNS:lost contact
15-JUL-2010 23:03:08 * (CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_1\bin\emagent.exe)(HOST=ORACLE10GVM)(USER=OraUser))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1459)) * establish * orcl * 12505
TNS-12505: TNS:listener does not currently know of SID given in connect descriptor

TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production on 15-JUL-2010 23:07:58

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

System parameter file is C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
Log messages written to C:\oracle\product\10.2.0\db_1\network\log\listener.log
Trace information written to C:\oracle\product\10.2.0\db_1\network\trace\listener.trc
Trace level is currently 0

Started with pid=1552
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle10gvm)(PORT=1521)))
Listener completed notification to CRS on start

TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
15-JUL-2010 23:08:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1030)) * establish * orcl * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
15-JUL-2010 23:08:18 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=orcl)) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1032)) * establish * orcl * 12514
TNS-12514: TNS:listener does not currently know of service requested in connect descriptor

6 个答案:

答案 0 :(得分:14)

在安装数据库后第一次重启时,我对Oracle数据库有一些模糊的回忆需要一些摆弄。但是,您还没有给我们足够的信息来处理。首先:

  • 您使用什么代码连接数据库?
  • 目前尚不清楚数据库实例是否已启动。您可以使用VM中的sqlplus / as sysdba连接到数据库吗?
  • 自上次重启以来写入listener.log文件(%ORACLE_HOME%\network\log)的内容是什么?

编辑:我现在能够提出一个生成相同错误消息的方案。在我看来,您尝试连接的数据库尚未启动。我在下面介绍的示例在Linux上使用Oracle XE,但我认为这不会产生显着差异。

首先,让我们确认数据库已关闭:

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 17 18:16:43 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

文本Connected to an idle instance告诉我们数据库已关闭。

使用sqlplus / as sysdba将我们作为SYS连接到数据库而不需要密码,但它只能在与数据库本身相同的机器上运行。在您的情况下,您需要在虚拟机内运行它。 SYS有权启动和关闭数据库,并在关闭时连接到数据库,但普通用户没有这些权限。

现在让我们断开连接并尝试重新连接为普通用户,一个没有启动/关闭数据库权限的用户,也不会在数据库关闭时连接到该用户:

SQL> exit
Disconnected

$ sqlplus -L "user/pw@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))"

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 17 18:16:47 2010                                                                                                               

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

ERROR:
ORA-12505: TNS:listener does not currently know of SID given in connect
descriptor                                                             


SP2-0751: Unable to connect to Oracle.  Exiting SQL*Plus

这是你得到的错误信息。

现在,让我们启动数据库:

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 17 18:17:00 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  805306368 bytes
Fixed Size                  1261444 bytes
Variable Size             209715324 bytes
Database Buffers          591396864 bytes
Redo Buffers                2932736 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

现在数据库已启动,让我们尝试以普通用户身份登录:

$ sqlplus -L "user/pw@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))"

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Jul 17 18:17:11 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

SQL> 

我们在。

之前我没有看到过ORA-12505错误,因为我通常不会通过在命令行输入整个连接字符串来连接到Oracle数据库。这可能与您尝试连接数据库的方式类似。通常,我要么连接到本地数据库,要么使用TNS名称连接到远程数据库(这些名称在%ORACLE_HOME%\network\admin中的tnsnames.ora文件中列出)。在这两种情况下,如果您尝试连接到已关闭的数据库,则会收到不同的错误消息。

如果以上内容对您没有帮助(特别是,如果数据库已经启动,或者启动数据库时出错),请告诉我们。

编辑2:看来您遇到的问题确实是因为数据库尚未启动。您的数据库似乎也未配置为在服务启动时启动。可以在启动服务时启动数据库,并在服务停止时关闭。要执行此操作,请使用Oracle Administration Assistant for Windows,请参阅here

答案 1 :(得分:2)

你可以试试这个。

在Windows中,转到“管理工具” - >“服务”并查看向下滚动到Oracle [instanceNameHere]的位置,并查看侦听器和服务本身是否正在运行。你可能要开始它。您也可以将其设置为右键单击它并转到属性时自动启动。

答案 2 :(得分:1)

hibernate.connection.url作为"jdbc:oracle:thin:@127.0.0.1:1521:xe",然后您可以解决上述问题。因为oracle的默认SID是“xe”所以我们应该这样给出。当我给出这样的数据时,数据已被插入数据库而没有任何SQL异常,这是我的实时经验。

答案 3 :(得分:1)

以下对我有用(Windows 7):

oradim -shutdown -sid enter_sid_here
oradim -startup -sid enter_sid_here

(将enter_sid_here替换为SID)

答案 4 :(得分:1)

  1. 启动oracleserviceorcl服务。 (来自任务管理器中的服务)
  2. 使用ORACLE_SID值设置orcl变量。 (在环境变量中)

答案 5 :(得分:0)

我将Sid值更改为orcl,它可以正常工作并建立了连接