windows版的TNS-12541和TNS-12560
最近弄了一个windows版的数据库在机器上.
C:\Users\git>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 7月 20 08:23:49 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> alter system register ;
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL>
SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断
开
C:\Users\git>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -2015 08:2
4:26
Copyright (c) 1991, 2010, Oracle. All rights reserved.
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
32-bit Windows Error: 61: Unknown error
C:\Users\git>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 7月 20 08:24:42 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter local_l
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断
开
C:\Users\git>lsnrctl
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -2015 08:3
3:33
Copyright (c) 1991, 2010, Oracle. All rights reserved.
欢迎来到LSNRCTL, 请键入"help"以获得信息。
LSNRCTL> START
启动tnslsnr: 请稍候...
TNS-12560: TNS: 协议适配器错误
TNS-00530: 协议适配器错误
LSNRCTL> exit
C:\Users\git>tnsping yc
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -
2015 08:34:02
Copyright (c) 1997, 2010, Oracle. All rights reserved.
已使用的参数文件:
D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST = git-PC)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = YC)))
TNS-12541: TNS: 无监听程序
C:\Users\git>hostname
git-PC
C:\Users\git>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -2015 08:3
4:19
Copyright (c) 1991, 2010, Oracle. All rights reserved.
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
32-bit Windows Error: 61: Unknown error
正在连接到 (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
32-bit Windows Error: 2: No such file or directory
C:\Users\git>
在linux里报错TNS-12541是因为没有打开监听,而TNS-12560是因为在PROTOCOL里协议写错了,大小写都尝试的去修改,TCP,tcp,Tcp,tCP...
改了半天都没有能解决这个问题.我很是焦头烂额,在linux里从没有碰到如此奇葩的问题.
后来突然意识到,一个问题,在linux里有执行权限问题,或者换句话说,就是oracle用户安装,那么oracle用户拥有最高执行权限,
好的,我们来试试用windows里的管理员执行这个东西.
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -2015 08:3
4:54
Copyright (c) 1991, 2010, Oracle. All rights reserved.
欢迎来到LSNRCTL, 请键入"help"以获得信息。
LSNRCTL> start
启动tnslsnr: 请稍候...
Failed to open service <OracleOraDb11g_home1TNSListener>, error 1060.
TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
系统参数文件为D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\listener.ora
写入d:\oracle11g\diag\tnslsnr\git-PC\listener\alert\log.xml的日志信息
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
ction
启动日期 20-7月 -2015 08:35:00
正常运行时间 0 天 0 小时 0 分 1 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
监听程序参数文件 D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\lis
tener.ora
监听程序日志文件 d:\oracle11g\diag\tnslsnr\git-PC\listener\alert\log.xm
l
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))
服务摘要..
服务 "YC" 包含 1 个实例。
实例 "YC", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
LSNRCTL> status
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
ction
启动日期 20-7月 -2015 08:35:00
正常运行时间 0 天 0 小时 0 分 9 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
监听程序参数文件 D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\lis
tener.ora
监听程序日志文件 d:\oracle11g\diag\tnslsnr\git-PC\listener\alert\log.xm
l
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))
服务摘要..
服务 "YC" 包含 1 个实例。
实例 "YC", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
LSNRCTL>
问题就是这样,在windows里也要管理员才能正常执行数据库内容.监听也不例外.
最近弄了一个windows版的数据库在机器上.
C:\Users\git>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 7月 20 08:23:49 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> alter system register ;
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL> /
系统已更改。
SQL>
SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断
开
C:\Users\git>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -2015 08:2
4:26
Copyright (c) 1991, 2010, Oracle. All rights reserved.
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
32-bit Windows Error: 61: Unknown error
C:\Users\git>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期一 7月 20 08:24:42 2015
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> show parameter local_l
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断
开
C:\Users\git>lsnrctl
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -2015 08:3
3:33
Copyright (c) 1991, 2010, Oracle. All rights reserved.
欢迎来到LSNRCTL, 请键入"help"以获得信息。
LSNRCTL> START
启动tnslsnr: 请稍候...
TNS-12560: TNS: 协议适配器错误
TNS-00530: 协议适配器错误
LSNRCTL> exit
C:\Users\git>tnsping yc
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -
2015 08:34:02
Copyright (c) 1997, 2010, Oracle. All rights reserved.
已使用的参数文件:
D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST = git-PC)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = YC)))
TNS-12541: TNS: 无监听程序
C:\Users\git>hostname
git-PC
C:\Users\git>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -2015 08:3
4:19
Copyright (c) 1991, 2010, Oracle. All rights reserved.
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
32-bit Windows Error: 61: Unknown error
正在连接到 (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
32-bit Windows Error: 2: No such file or directory
C:\Users\git>
在linux里报错TNS-12541是因为没有打开监听,而TNS-12560是因为在PROTOCOL里协议写错了,大小写都尝试的去修改,TCP,tcp,Tcp,tCP...
改了半天都没有能解决这个问题.我很是焦头烂额,在linux里从没有碰到如此奇葩的问题.
后来突然意识到,一个问题,在linux里有执行权限问题,或者换句话说,就是oracle用户安装,那么oracle用户拥有最高执行权限,
好的,我们来试试用windows里的管理员执行这个东西.
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 20-7月 -2015 08:3
4:54
Copyright (c) 1991, 2010, Oracle. All rights reserved.
欢迎来到LSNRCTL, 请键入"help"以获得信息。
LSNRCTL> start
启动tnslsnr: 请稍候...
Failed to open service <OracleOraDb11g_home1TNSListener>, error 1060.
TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
系统参数文件为D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\listener.ora
写入d:\oracle11g\diag\tnslsnr\git-PC\listener\alert\log.xml的日志信息
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
ction
启动日期 20-7月 -2015 08:35:00
正常运行时间 0 天 0 小时 0 分 1 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
监听程序参数文件 D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\lis
tener.ora
监听程序日志文件 d:\oracle11g\diag\tnslsnr\git-PC\listener\alert\log.xm
l
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))
服务摘要..
服务 "YC" 包含 1 个实例。
实例 "YC", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
LSNRCTL> status
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
ction
启动日期 20-7月 -2015 08:35:00
正常运行时间 0 天 0 小时 0 分 9 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
监听程序参数文件 D:\Oracle11g\product\11.2.0\dbhome_1\network\admin\lis
tener.ora
监听程序日志文件 d:\oracle11g\diag\tnslsnr\git-PC\listener\alert\log.xm
l
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))
服务摘要..
服务 "YC" 包含 1 个实例。
实例 "YC", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
LSNRCTL>
问题就是这样,在windows里也要管理员才能正常执行数据库内容.监听也不例外.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29505646/viewspace-1742446/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29505646/viewspace-1742446/