ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
linux下:
tnsnames.ora文件内容:
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
MGW_AGENT =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS = (PROTOCOL = PIC)(KEY = EXTPROC)))
(CONNECT_DATA = (SID = mgwextproc)))
listener.ora内容:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = mgwextproc)
(ENVS = "LD_LIBRARY_PATH =/u01/app/oracle/product/11.2.0/dbhome_1/jdk/jre/lib/i386:/u01/app/oracle/product/11.2.0/dbhome_1/jdk/jre/lib/i386/server:/u01/app/oracle/product/11.2.0/dbhome_1/lib")
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = extproc))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
注:两系统可以相互ping的
$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 01-DEC-2011 13:25:24
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 01-DEC-2011 13:24:18
Uptime 0 days 0 hr. 1 min. 5 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/William-PC/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "mgwextproc" has 1 instance(s).
Instance "mgwextproc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
win7下报错:
>tnsping orcl
-----------------------------
已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0
.0.1)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl)))
TNS-12541: TNS: 无监听程序
plsql连接:
报ORA-12541:TNS:无监听程序
各位大师,求助怎么解决,新手。
11 个解决方案
#1
windows下修改tnsnames.ora文件,增加:
linuxorcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 这里替换成linux主机ip地址)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
同时在linux上执行
netstat -ant|grep 1521
看看1521端口有没有在侦听,侦听的ip地址对不对(不能是在127.0.0.1上侦听)
linuxorcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 这里替换成linux主机ip地址)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
同时在linux上执行
netstat -ant|grep 1521
看看1521端口有没有在侦听,侦听的ip地址对不对(不能是在127.0.0.1上侦听)
#2
windows下执行:
telnet linux主机ip地址 1521
看看能不能连上数据库端口
telnet linux主机ip地址 1521
看看能不能连上数据库端口
#3
再有一点忘了说了,如果照我贴的设置,那么在windows下是:
tnsping linuxorcl
这样来测试
tnsping linuxorcl
这样来测试
#4
连接超时。telnet也是超时。
tcp 0 0 : : : 1521 : : :*
LINTEN
tcp 0 0 : :1:1521 : :1:49925
TIME WAIT
还请您帮助。
#5
你在windows下ping过linux虚拟机的ip没?
#6
前面没看仔细,
但是你贴的netstat信息好像没有在ipv4地址上侦听啊
但是你贴的netstat信息好像没有在ipv4地址上侦听啊
#7
service iptables stop关闭防火墙
#8
win7下ping虚拟机是通的。那netstat信息我看不懂,安装到现在,都想吐了。能加您QQ吗?我QQ:715468506
#9
我不用msn和qq的,sorry
正常情况下应该会看到大概像这样的信息,1521应该会在0.0.0.0或者某个具体的ip地址上侦听,如果这都没看到那好像就不太正常啊。
[root@RHEL6A ~]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:35219 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
正常情况下应该会看到大概像这样的信息,1521应该会在0.0.0.0或者某个具体的ip地址上侦听,如果这都没看到那好像就不太正常啊。
[root@RHEL6A ~]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:35219 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
#10
呵呵,没关系。现在出现个新的问题,实例起不来了。报这个错误:
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ORCL'
之前都多次netca删除和添加listener,但是不知道哪里冒出来LISTENER_ORCL,我那listener。ora和tn....文件里没这个东西啊。网上看了下是什么pfile之类的,不知何解。
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ORCL'
之前都多次netca删除和添加listener,但是不知道哪里冒出来LISTENER_ORCL,我那listener。ora和tn....文件里没这个东西啊。网上看了下是什么pfile之类的,不知何解。
#11
我觉得你先解决启动侦听器的问题吧。即使实例不启动也可以测侦听器启动的。
我昨晚在rhel6上装了下oracle 11g,步骤跟10g差不多的,只是有些内核参数稍微不同而已。
你看看主机的hosts文件是不是这样?
[root@RHEL6B ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
如果是这样在lsnrctl start时会比较慢,但是能够启动,检查端口时会发现:
[oracle@RHEL6B admin]$ netstat -ant|grep 1521
tcp 0 0 127.0.0.1:1521 0.0.0.0:* LISTEN
把/etc/hosts改成这样:
[root@RHEL6B ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.88.129 RHEL6B
上面最后一行加上这台主机的ip和主机名对应行
然后oracle用户修改文件:
[oracle@RHEL6B admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL6B)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
HOST = RHEL6B这里改成主机名词,RHEL6B是我的虚拟机linux的主机名。
这样修改后lsnrctl start就非常快了,不到1秒就启动好了。
然后再检查端口:
[oracle@RHEL6B admin]$ netstat -ant|grep 1521
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN
tcp 0 0 192.168.88.129:36332 192.168.88.129:1521 TIME_WAIT
这样就是正常的了。
我试过了,sqlplus进去select * from scott.emp之类的都没问题。
我昨晚在rhel6上装了下oracle 11g,步骤跟10g差不多的,只是有些内核参数稍微不同而已。
你看看主机的hosts文件是不是这样?
[root@RHEL6B ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
如果是这样在lsnrctl start时会比较慢,但是能够启动,检查端口时会发现:
[oracle@RHEL6B admin]$ netstat -ant|grep 1521
tcp 0 0 127.0.0.1:1521 0.0.0.0:* LISTEN
把/etc/hosts改成这样:
[root@RHEL6B ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.88.129 RHEL6B
上面最后一行加上这台主机的ip和主机名对应行
然后oracle用户修改文件:
[oracle@RHEL6B admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL6B)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
HOST = RHEL6B这里改成主机名词,RHEL6B是我的虚拟机linux的主机名。
这样修改后lsnrctl start就非常快了,不到1秒就启动好了。
然后再检查端口:
[oracle@RHEL6B admin]$ netstat -ant|grep 1521
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN
tcp 0 0 192.168.88.129:36332 192.168.88.129:1521 TIME_WAIT
这样就是正常的了。
我试过了,sqlplus进去select * from scott.emp之类的都没问题。
#1
windows下修改tnsnames.ora文件,增加:
linuxorcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 这里替换成linux主机ip地址)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
同时在linux上执行
netstat -ant|grep 1521
看看1521端口有没有在侦听,侦听的ip地址对不对(不能是在127.0.0.1上侦听)
linuxorcl =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 这里替换成linux主机ip地址)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
同时在linux上执行
netstat -ant|grep 1521
看看1521端口有没有在侦听,侦听的ip地址对不对(不能是在127.0.0.1上侦听)
#2
windows下执行:
telnet linux主机ip地址 1521
看看能不能连上数据库端口
telnet linux主机ip地址 1521
看看能不能连上数据库端口
#3
再有一点忘了说了,如果照我贴的设置,那么在windows下是:
tnsping linuxorcl
这样来测试
tnsping linuxorcl
这样来测试
#4
连接超时。telnet也是超时。
tcp 0 0 : : : 1521 : : :*
LINTEN
tcp 0 0 : :1:1521 : :1:49925
TIME WAIT
还请您帮助。
#5
你在windows下ping过linux虚拟机的ip没?
#6
前面没看仔细,
但是你贴的netstat信息好像没有在ipv4地址上侦听啊
但是你贴的netstat信息好像没有在ipv4地址上侦听啊
#7
service iptables stop关闭防火墙
#8
win7下ping虚拟机是通的。那netstat信息我看不懂,安装到现在,都想吐了。能加您QQ吗?我QQ:715468506
#9
我不用msn和qq的,sorry
正常情况下应该会看到大概像这样的信息,1521应该会在0.0.0.0或者某个具体的ip地址上侦听,如果这都没看到那好像就不太正常啊。
[root@RHEL6A ~]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:35219 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
正常情况下应该会看到大概像这样的信息,1521应该会在0.0.0.0或者某个具体的ip地址上侦听,如果这都没看到那好像就不太正常啊。
[root@RHEL6A ~]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:35219 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN
#10
呵呵,没关系。现在出现个新的问题,实例起不来了。报这个错误:
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ORCL'
之前都多次netca删除和添加listener,但是不知道哪里冒出来LISTENER_ORCL,我那listener。ora和tn....文件里没这个东西啊。网上看了下是什么pfile之类的,不知何解。
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_ORCL'
之前都多次netca删除和添加listener,但是不知道哪里冒出来LISTENER_ORCL,我那listener。ora和tn....文件里没这个东西啊。网上看了下是什么pfile之类的,不知何解。
#11
我觉得你先解决启动侦听器的问题吧。即使实例不启动也可以测侦听器启动的。
我昨晚在rhel6上装了下oracle 11g,步骤跟10g差不多的,只是有些内核参数稍微不同而已。
你看看主机的hosts文件是不是这样?
[root@RHEL6B ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
如果是这样在lsnrctl start时会比较慢,但是能够启动,检查端口时会发现:
[oracle@RHEL6B admin]$ netstat -ant|grep 1521
tcp 0 0 127.0.0.1:1521 0.0.0.0:* LISTEN
把/etc/hosts改成这样:
[root@RHEL6B ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.88.129 RHEL6B
上面最后一行加上这台主机的ip和主机名对应行
然后oracle用户修改文件:
[oracle@RHEL6B admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL6B)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
HOST = RHEL6B这里改成主机名词,RHEL6B是我的虚拟机linux的主机名。
这样修改后lsnrctl start就非常快了,不到1秒就启动好了。
然后再检查端口:
[oracle@RHEL6B admin]$ netstat -ant|grep 1521
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN
tcp 0 0 192.168.88.129:36332 192.168.88.129:1521 TIME_WAIT
这样就是正常的了。
我试过了,sqlplus进去select * from scott.emp之类的都没问题。
我昨晚在rhel6上装了下oracle 11g,步骤跟10g差不多的,只是有些内核参数稍微不同而已。
你看看主机的hosts文件是不是这样?
[root@RHEL6B ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
如果是这样在lsnrctl start时会比较慢,但是能够启动,检查端口时会发现:
[oracle@RHEL6B admin]$ netstat -ant|grep 1521
tcp 0 0 127.0.0.1:1521 0.0.0.0:* LISTEN
把/etc/hosts改成这样:
[root@RHEL6B ~]# more /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.88.129 RHEL6B
上面最后一行加上这台主机的ip和主机名对应行
然后oracle用户修改文件:
[oracle@RHEL6B admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = RHEL6B)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
HOST = RHEL6B这里改成主机名词,RHEL6B是我的虚拟机linux的主机名。
这样修改后lsnrctl start就非常快了,不到1秒就启动好了。
然后再检查端口:
[oracle@RHEL6B admin]$ netstat -ant|grep 1521
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN
tcp 0 0 192.168.88.129:36332 192.168.88.129:1521 TIME_WAIT
这样就是正常的了。
我试过了,sqlplus进去select * from scott.emp之类的都没问题。