我是oracle dba的新手,所以需要帮助才能满足我的想法。我已经在OS OEL 5.7的虚拟机上安装了我的oracle 11gr2数据库,并希望将此远程数据库与toad32bit连接。所以我确实关注了一些有用的链接,并在OS Windows 7 64bit 上下载并安装了 win32_11gR2_client。除了尽力按照说明我的客户端无法连接我的远程oracle数据库。在客户端使用cmd for tnsping sidname总是得到没有tns监听器错误,如上所述
简要说明 LINUX MACHINE:
的listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = testhost.testdomain.com)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
的tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testhost.testdomain.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.testdomain.com)
)
)
SQLNET.ORA
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
ADR_BASE = /u01/app/oracle
lsnrctl状态监听器
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 03-FEB-2014 15:08:43
Uptime 0 days 1 hr. 32 min. 59 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/testhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testhost.testdomain.com)(PORT=1521)))
Services Summary...
Service "orcl.testdomain.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.testdomain.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
lsnrctl服务侦听器
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl.testdomain.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "orclXDB.testdomain.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: testhost.testdomain.com, pid: 5349>
(ADDRESS=(PROTOCOL=tcp)(HOST=testhost.testdomain.com)(PORT=13094))
The command completed successfully
WINDOWS 7客户端描述 C:\ ORACLE \产品\ 11.2.0 \ Client_1与\网络\ ADMIN ENV TNS_ADMIN = C:\ oracle \ product \ 11.2.0 \ client_1 \ network \ admin
注意:WINDOWS服务中不存在任何与ORACLE相关的服务(不存在)
我的客户端tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testhost.testdomain.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.testdomain.com)
)
)
C:\ Users \ farhan&gt; tnsping orcl(结果是)
Used parameter files:
C:\oracle\product\11.2.0\client_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDTESS_LIST = (ADDRESS - (PROTOCOL = TCP (HOST =
testhost.testdomain.com)(PORT = 1521))) (CONNECT_DATA= (SERVER = DEDICATIED) (SERVICE_NAME
= orcl) (INSCTANCE_NAME = orcl) (GLOBAL_NAME = orcl.testdomain.com)(RDB_DATABSE = orcl)) (TYPE_OF_SERVICE = dedicaated))
TNS-12541 : TNS:no listener
cat / etc / hosts(结果是)
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1 testhost.testdomain.com testhost localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost
#10.10.1.114 testhost.testdomain.com testhost
192.168.0.103 testhost.testdomain.com testhost
::1 localhost6.localdomain6 localhost6
我要求发布的进一步行为
# netstat -an | grep 1521 | grep tcp | grep LISTEN
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN
[root@testhost ~]# grep testhost /etc/hosts
#127.0.0.1 testhost.testdomain.com testhost localhost.localdomain localhost
#10.10.1.114 testhost.testdomain.com testhost
192.168.0.103 testhost.testdomain.com testhost
[root@testhost ~]# dig +short testhost.testdomain.com
174.137.125.92
答案 0 :(得分:2)
经过搜索后得到了一个简单的方法来解决它。只需按照以下步骤操作: -
检查听众的状态
打开命令提示符并键入lsnrctl status
你将没有听众。
所以,现在打开下面出现的listener.ora文件 目录C:\ oraclexe \ app \ oracle \ product \ 11.2.0 \ server \ network \ ADMIN
打开该文件并使用您的计算机名更改主机参数 ii}右键单击“我的电脑”,即可获得计算机名称 检查您的计算机名称,并将您的主机参数替换为您的 计算机名称如下。
LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS =(PROTOCOL = IPC)(KEY = EXTPROC1))(ADDRESS =(PROTOCOL = TCP)(HOST = Electron-PC)(PORT = 1521))))
所以在这里你可以观察HOST = Electron-P
,这是我的电脑名称
这将启动OracleTNSListner,您可以在服务中检查它 通过打开taskmanager的服务选项卡。如果没有自动启动你 可以启动它。
就是这么多,你准备再次在oracle上工作了。最好的 运气。
答案 1 :(得分:0)
我曾经遇到过同样的问题。我能够连接
将我的计算机名称添加到:/etc/hosts "ip_address computer_name"
。
答案 2 :(得分:0)
我遇到了同样的问题。以下对我有用。
如果有,请从计算机上卸载所有oracle文件 以前安装过它。通过前往停止所有服务 cmd中的services.msc。
如果您尚未安装oracle,请安装oracle。
然后转到cmd
告诉我它是否有帮助。