简体   繁体   English

ORA-12154:TNS:无法解析指定的连接标识符

[英]ORA-12154: TNS:could not resolve the connect identifier specified

I am trying to connect to oracle 11g installed on Linux EL 5 and and getting the following error 我正在尝试连接到安装在Linux EL 5上的oracle 11g并且出现以下错误

SQL> connect sys/password@ud06 as sysdba
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

my listener.ora under network/admin is as follows 我在network / admin下的listener.ora如下

LISTENER=
  (DESCRIPTION=
    (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=ud06)(PORT=1521))
      (ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))

SID_LIST_LISTENER=
  (SID_LIST=
    (SID_DESC=
      (GLOBAL_DBNAME=orcl)
      (ORACLE_HOME=/home/oracle/app/oracle/product/11g)
      (SID_NAME=orcl))
    (SID_DESC=
      (SID_NAME=plsextproc)
      (ORACLE_HOME=/home/oracle/app/oracle/product/11g)
      (PROGRAM=extproc)))

MY tnsnames.ora is as follows 我的tnsnames.ora如下

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

UD06=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ud06)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

MY lsnrctl status shows as follows: MY lsnrctl状态显示如下:

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ud06.us.server.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                17-FEB-2010 16:23:06
Uptime                    0 days 0 hr. 12 min. 33 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/oracle/app/oracle/product/11g/network/admin/listener.ora
Listener Log File         /home/oracle/app/oracle/product/11g/log/diag/tnslsnr/ud06/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ud06.us.server.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Service "plsextproc" has 1 instance(s).
  Instance "plsextproc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

The answer to this problem is very simple. 这个问题的答案很简单。 Do not worry about the .ora files or any other configuration. 不要担心.ora文件或任何其他配置。 Oracle does all these just perfect. Oracle完成所有这些工作。

Only while connecting via command line, it gets confused with passwords that have a @ symbol in them. 只有在通过命令行连接时,它才会与其中包含@符号的密码混淆。

Therefore while connecting through command line SQL, do not use a password with a '@' in it. 因此,在通过命令行SQL连接时,请勿使用带有“@”的密码。 Just use the web interface to create an account having a password without an '@' symbol in it. 只需使用Web界面创建一个帐户,密码中没有“@”符号。

That is!! 那是!! Problem solved. 问题解决了。 I had been breaking my head for quite a few days, and now my problem is solved!! 我已经打破了好几天了,现在我的问题解决了!

Can you ping ud06 successfully (as ud06, not ud06.us.server.com)? 你能成功ping ud06(如ud06,而不是ud06.us.server.com)?

What does the command 命令是什么

lsnrctl services

show? 节目?

EDIT: It sounds to me like maybe the database instance name isn't actually "orcl"? 编辑:听起来像我可能数据库实例名称实际上不是“orcl”? What the lsnrctl services output tells me is that the "orcl" service, although defined in the listener.ora file, is not actually running. lsnrctl服务输出告诉我的是,“orcl”服务虽然在listener.ora文件中定义,但实际上并没有运行。

Can you log on with a direct connection on the server? 你可以在服务器上直接连接登录吗? If so, what do you use as the ORACLE_SID environment variable value? 如果是这样,您使用什么作为ORACLE_SID环境变量值? Log in as the SYS user and issue the command: 以SYS用户身份登录并发出命令:

ALTER SYSTEM REGISTER; 更改系统寄存器;

Then issue the lsnrctl services command again and see if an additional instance doesn't show up. 然后再次发出lsnrctl services命令,看看是否没有显示其他实例。

Also, as Alex points out, the tnsping command is reporting a fully qualified service name. 此外,正如Alex指出的那样,tnsping命令报告了一个完全限定的服务名称。 Edit the sqlnet.ora file and set the NAMES.DEFAULT_DOMAIN value to NULL if it has a value. 编辑sqlnet.ora文件,如果NAMES.DEFAULT_DOMAIN值有值,则将其设置为NULL。

EDIT 2: Does tnsping ud06 on the server work? 编辑2: 服务器上的 tdping ud06是否有效? Or is my assumption that client and server are on different systems wrong? 或者我的假设客户端和服务器在不同的系统上是错误的?

The SERVICE_NAME in the tnsping output doesn't match the entry in tnsnames.ora ; tnsping输出中的SERVICE_NAMEtnsnames.ora中的条目不匹配; is that file from the Windows box or the Linux box? 是从Windows框或Linux框中的文件? It looks like you don't have a local (Windows) tnsnames.ora entry for u06 and it's guessing what the service name should be expanding it - I think that's what the reference to the hostname adapter means. 看起来你没有u06的本地(Windows) tnsnames.ora条目,它猜测服务名称应该扩展它 - 我认为这是对主机名适配器的引用意味着什么。

first try whether the oracle instance is started : 首先尝试是否启动了oracle实例:

for windows: 对于Windows:

start->configuration panel-> administration touls->Services->ORACLESERVICEORCL(my instance by the way)->start start-> configuration panel-> administration touls-> Services-> ORACLESERVICEORCL(顺便提一下我的实例) - > start

Provide the connection string like this: 提供如下连接字符串:

ServerName:port/ServiceName;User Name;Password ServerName:port / ServiceName;用户名;密码

添加连接图像

I was also facing the same error, try this code: 我也遇到了同样的错误,请尝试以下代码:

SQL> conn  hr/hr  @pdborcl;

and if you find same error, it means that you have a different pluggable database name. 如果您发现相同的错误,则表示您具有不同的可插拔数据库名称。 Check the pluggable database name by just writing the following command in sqlplus 只需在sqlplus编写以下命令即可检查可插拔数据库名称

sql> SELECT  name,  con_id  FROM  v$pdbs;

I fixed this problem using this steps. 我使用这个步骤解决了这个问题。

First of all, this error occured , if you didn't install same directory or drive. 首先,如果您没有安装相同的目录或驱动器,则会发生此错误。

But the answer is here. 但答案就在这里。

  1. Login windows as a Adminstrator. 以管理员身份登录窗口。
  2. Go to Control Panel. 转到“控制面板”。
  3. System Properties and click Enviroment 系统属性,然后单击“环境”
  4. Find the OS variable and change name as a "TNS_ADMIN" 找到OS变量并将名称更改为“TNS_ADMIN”

    在此输入图像描述

  5. And change the value as a "tnsnames's directory address" 并将值更改为“tnsnames的目录地址” 在此输入图像描述

  6. Restart the system. 重启系统。

  7. Congrulations. Congrulations。

我也遇到了ORA-12154:TNS:无法解析指定的连接标识符,并添加尝试连接到oracle的oinstall组的用户修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ORA-12154:TNS:无法解析表上指定的连接标识符 - ORA-12154: TNS:could not resolve the connect identifier specified on a table ORA-12154:TNS:无法解析使用TeamCity指定的连接标识符 - ORA-12154: TNS:could not resolve the connect identifier specified with TeamCity ORA-12154:TNS:无法解析指定的连接标识符 - ORA-12154: TNS: could not resolve the connect identifier specified 错误:ORA-12154:TNS:无法解析指定的连接标识符 - ERROR: ORA-12154: TNS:could not resolve the connect identifier specified 这是错误 ORA-12154:TNS:无法解析指定的连接标识符? - this is error ORA-12154: TNS:could not resolve the connect identifier specified? BizTalk ORA-12154:TNS:无法解析指定的连接标识符 - BizTalk ORA-12154: TNS:could not resolve the connect identifier specified ORA-12154:TNS:无法解析指定的连接标识符 - ORA-12154: TNS:could not resolve the connect identifier specified 无法解析ORA-12154:TNS:无法解析指定的连接标识符 - Unable to resolve ORA-12154: TNS:could not resolve the connect identifier specified 尝试连接到数据库,出现错误 ORA-12154: TNS:could not resolve the connect identifier specified - Trying to connect to database, getting error ORA-12154: TNS:could not resolve the connect identifier specified ORA-12154错误TNS无法解析指定的连接 - ORA-12154 error TNS could not resolve the connect identified specified
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM