ORA-12154:TNS:无法解析指定的连接标识符

时间:2015-04-29 21:56:07

标签: oracle-xe

我安装了Oracle Express。

在我的防火墙中打开端口1521后,我能够成功:
tnsping xe。

但是当我跑步时:
SQL>连接系统

系统用户:> sqlplus system
我得到" ORA-12154:TNS:无法解析指定的连接标识符"。

这种情况在本地发生,对于"系统"并通过TCP for" system @ xe"。

我一直在和这个战斗一天半。 似乎没有答案。

这是我原来的听众:

----------------------------------

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
  )

    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = NETEDELLLPTP-106)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)= (XE)

--------------------------------------------

我改为:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
       (SID_NAME = XE)
       (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
    )
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
  )



-------------------------------------------

这似乎并不重要。 我仍然可以ping,但不能以任何方式连接。

这是我的tnsnames.ora:

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = NETEDELLLPTP-106)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

ORACLR_CONNECTION_DATA = 
  (DESCRIPTION = 
    (ADDRESS_LIST = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) 
    ) 
    (CONNECT_DATA = 
      (SID = CLRExtProc) 
      (PRESENTATION = RO) 
    ) 
  ) 

我也重启了这两项服务:
OracleServiceXE

OracleXETNSListener
尝试过每一个建议之后的一堆次数如下:
改变陈述。 我无法让它发挥作用。

还有一件事:
当我这样做时:
lsnrctl status xe,
我希望能够像其他人一样正确地设置这个:>

Service "xe" has 1 instance(s).
  Instance "xe", status READY, has 1 handler(s) for this service...

我没有得到这个,但我认为在上面提到的listener.ora的变化后,我得到: 所以现在我有两个不同的xe实例:

Service "XE" has 2 instance(s).
  Instance "XE", status UNKNOWN, has 1 handler(s) for this service...
  Instance "xe", status READY, has 1 handler(s) for this service...

但至少小写的xe实例看起来是正确的。 我不知道大写XE实例的来源。

与正确版本不同(终点摘要:
矿:

Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=NETEDELLLPTP-106)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=NETEDELLLPTP-106)(PORT=8080))(Presen
tation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

正确:

Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Kiev-win)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Kiev-win)(PORT=8080))(Presentation=HTTP)(Session=RAW))

1 个答案:

答案 0 :(得分:1)

问题是(如你所说)密码中的@字符。 Oracle似乎不喜欢像@或!

这样的特殊字符

要解决此问题,请从"运行SQL命令行"打开SQL命令行提示符。在开始菜单中,或打开命令提示符并运行

sqlplus

然后做

connect / as sysdba
alter user system identified by <newPassword>

HTH