TNS-01153:处理字符串失败

时间:2014-03-25 06:55:02

标签: oracle11g

我在Windows 7中安装了Oracle 11g,我正在连接Oracle,但收到错误 TNS-01153:无法处理字符串...

这是我的TNSNAMES.ORA

work_prod =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST =localhost) (PORT = 1521))
    )
    (CONNECT_DATA =(SID =workprod))
  ) 

我的LISTENER.ORA

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY =workprod))
    (ADDRESS = (PROTOCOL = TCP)(HOST =localhost(PORT = 1521))
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = workprod)
      (ORACLE_HOME = C:\MY_DISK\G\Oracle_database\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = workprod)
      (ORACLE_HOME = C:\MY_DISK\G\Oracle_database\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

1 个答案:

答案 0 :(得分:0)

listener.ora之后,您在第二个localhost地址中错过了一个右括号:

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY =workprod))
    (ADDRESS = (PROTOCOL = TCP)(HOST =localhost(PORT = 1521))
  )

......应该是:

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY =workprod))
    (ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521))
  )

除了格式之外,还建议您手动编辑,而不是使用netca

您的SID列表也看起来很奇怪;我认为那应该是:

LISTENER =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = PLSExtProc))
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\MY_DISK\G\Oracle_database\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = workprod)
      (ORACLE_HOME = C:\MY_DISK\G\Oracle_database\product\11.2.0\dbhome_1)
      (PROGRAM = workprod)
    )
  )

...假设您的数据库SID和服务名称均为workprod。但DEFAULT_SERVICE_LISTENER表明您的数据库被称为XE,这意味着您正在使用Oracle 11g Express Edition,因此仍然无法完全添加。如果你从其他地方复制过它,也许那条线就不应该存在。

认为 ORA-28547可能来自TCP连接,但试图切换到extproc,混合协议;但并不完全确定。