- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Windows 服务器上运行 Oracle 11,并且我登录到同一台服务器上尝试使用 SQL Plus。当我尝试连接时,即使 TNSPING 和其他各种诊断看起来正常,我也会收到 ORA-12154。
谁能建议为什么?下面详细介绍。
如果我使用 ,我可以使用 sqlplus易通像这样 ..
sqlplus EST/EST@192.168.10.15/ORCL
sqlplus EST/EST@ORCL
ORA-12154: TNS:could not resolve the connect identifier specified
C:\Documents and Settings\user1>tnsping ORCL
TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 12-NOV-2013 12:41:14
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
E:\app\Administrator\product\11.2.0\dbhome_2\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.15)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL))
)
OK (20 msec)
C:\Documents and Settings\user1>lsnrctl services
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 14-NOV-2013 12:02:59
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:55 refused:0 state:ready
LOCAL SERVER
Service "orclXDB" 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: MARIEL, pid: 2400>
(ADDRESS=(PROTOCOL=tcp)(HOST=mariel)(PORT=1045))
The command completed successfully
C:\Documents and Settings\user1>lsnrctl status
LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 14-NOV-2013 12:29:21
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
Start Date 14-NOV-2013 11:41:10
Uptime 0 days 0 hr. 48 min. 11 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File E:\app\Administrator\product\11.2.0\dbhome_2\network\admin\listener.ora
Listener Log File e:\app\administrator\diag\tnslsnr\mariel\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.15)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
# listener.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_2\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E:\app\Administrator\product\11.2.0\dbhome_2)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:E:\app\Administrator\product\11.2.0\dbhome_2\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.15)(PORT = 1521))
)
)
ADR_BASE_LISTENER = E:\app\Administrator
# tnsnames.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_2\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.15)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
)
)
# sqlnet.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_2\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
最佳答案
创建一个指向 tnsnames.ora 文件所在目录的环境变量 TNS_ADMIN。然后尝试用sqlplus连接。
如果可行,那么我猜您可能也安装了 Oracle 客户端软件,并且当您运行 sqlplus 时,它会在您的客户端主页中查找 tnsnames.ora 文件。
-- windows下添加环境变量TNS_ADMIN的说明
1.进入控制面板/系统
2.选择高级系统设置
3. 选择“高级”选项卡,最下方是环境变量按钮。
4. 创建新变量 TNS_ADMIN 并给出 .ora 文件的存储路径。例如C:\app\oracle\product\11.2.0\client_1\network\admin
关于oracle - TNSPING 确定,但 sqlplus 给出 ORA-12154?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19966848/
我有数据库 TNSEntries 的详细信息。我需要用 Java 编写代码来检查 TNSPING。有办法吗? 示例 TNSENtry: orcldb= (DESCRIPTION = (ADDRESS
是否可以通过编程方式在 Oracle 数据库上执行 TNSPing? 我知道我可能会调用 TNSPing 程序并解析生成的任何输出,但我正在寻找一种更强大的方法来处理数据库 TNS Ping。 看过P
在尝试建立从我的工作站(实际上,我在 WinXP32 和 Win764 工作站上看到相同的行为)到 Oracle 服务器的连接时,我总是尝试的第一件事是 tnsping。当我这样做时,这就是我得到的:
我刚刚在 Windows 7 64 位上安装了 Oracle 11g,当我尝试使用 tnsping ping 时我遇到了这个错误 TNS-12541: TNS:no listener . 因此,我尝试
我使用 Bitvise Tunnelier 通过 SQL Developer 连接到一系列 Oracle 数据库;连接到本地主机和特定的端口号,这工作正常。我想通过其他方式(例如 .NET)进行连接,
我在 Windows 服务器上运行 Oracle 11,并且我登录到同一台服务器上尝试使用 SQL Plus。当我尝试连接时,即使 TNSPING 和其他各种诊断看起来正常,我也会收到 ORA-121
我已在 Windows XP 计算机上安装了 Oracle 客户端 v. 11.2.0.1,并设置了 TNS_ADMIN 和 ORACLE_HOME 环境变量。 使用 sqlplus 通过 TNS 别
我想从 AIX 中的 tnsping 输出中获取 10.2.0.4.0,所以我写了 tnsping tucson | grep 版本 | awk '{print $9}',但有时在 Linux 等其他
最后几天,我面对着一个奇怪的先知问题。我已经在tnsnames.ora中定义了数据库。Oracle客户端已安装,已将客户端和客户端/bin添加到PATH。。Ping工作,tnsping工作,我可以连接
我是一名优秀的程序员,十分优秀!