首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有本地连接的ORA-12154

带有本地连接的ORA-12154
EN

Database Administration用户
提问于 2022-10-03 22:18:56
回答 1查看 113关注 0票数 -1

我刚刚安装了oracle19c并试图锁定HR用户,但是当我想连接到sqlplus时,我得到了这个错误ORA-12154: TNS:could not resolve the connect identifier specified。我不知道该怎么办请帮帮我

这就是我得到的

代码语言:javascript
复制
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Oct 3 23:01:33 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Enter user-name: sys as sysdba
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
EN

回答 1

Database Administration用户

发布于 2022-10-04 08:08:48

TWO_TASK变量被设置为不能作为TNS别名解析的值时,就会发生这种情况。示例:

代码语言:javascript
复制
[oracle@o82 ~]$ sqlplus

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 4 10:04:36 2022
Version 19.16.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.

Enter user-name: sys as sysdba
Enter password:

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.16.0.0.0

现在打破它:

代码语言:javascript
复制
[oracle@o82 ~]$ export TWO_TASK=THIS_DOES_NOT_EXIST
[oracle@o82 ~]$ tnsping THIS_DOES_NOT_EXIST

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 04-OCT-2022 10:05:15

Copyright (c) 1997, 2022, Oracle.  All rights reserved.

Used parameter files:

TNS-03505: Failed to resolve name
[oracle@o82 ~]$ sqlplus

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Oct 4 10:05:17 2022
Version 19.16.0.0.0

Copyright (c) 1982, 2022, Oracle.  All rights reserved.

Enter user-name: sys as sysdba
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified


Enter user-name:

检查TWO_TASK的值并确保它未设置或设置为可解析的值。在Windows上,而不是TWO_TASK上,检查LOCAL变量

票数 0
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/317782

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档