狮子的雄心,骆驼的耐力,孩子的执著!
分类: Oracle
2012-02-23 17:00:01
sql plus登陆提示 --- TSN: 解析客户端字符串失败
1.先检查监听器
cmd的命令行窗口下,输入lsnrctl 回车。进入提示符:
LSNRCTL>status
#检查监听器状态
LSNRCTL>status
关闭监听器
LSNRCTL>stop
启动监听器
LSNRCTL>start
2.如果一切正常,编辑下面的文件,默认内容大概为:
# listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PL***tProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = uay-gbxubir3v86)(PORT = 1521))
)
)
文件修改后结果为:
# listener.ora Network Configuration File: /oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PL***tProc)
(ORACLE_HOME = /oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /oracle/product/10.2.0/db_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
ADR_BASE_LISTENER = /oracle
3.保存文件,重起监听器。
4.sqlplus /nolog
conn sys as sysdba
Enter password:
startup
另一种情况是如下图:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test) 服务名
(ORACLE_HOME = /oracle/product/11.2.0/db_1) db_home
(SID_NAME = ORCL) ###这个是你要添加的服务
)
(SID_DESC =
(PROGRAM = extproc)
(SID_NAME = PL***tProc)
(ORACLE_HOME = /oracle/product/11.2.0/db_1) ##这个服务保证你可以使用外部过程,如C程序
)
)