我刚刚安装了oracle19c并试图锁定HR用户,但是当我想连接到sqlplus时,我得到了这个错误ORA-12154: TNS:could not resolve the connect identifier specified。我不知道该怎么办请帮帮我
这就是我得到的
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发布于 2022-10-04 08:08:48
当TWO_TASK变量被设置为不能作为TNS别名解析的值时,就会发生这种情况。示例:
[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现在打破它:
[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变量
https://dba.stackexchange.com/questions/317782
复制相似问题