ORA-12154: TNS:could not resolve the connect identifier specified--sys密码包含@符号

问题描述:在操作系统登录数据库时,由于忘记了sys密码,重新修改的sys密码包含@符号,登录时报错,

 ORA-12154: TNS:Could not resolve the connect identifier specified

 

要使用在线恢复恢复DG,所以要连接到主库测试tns的连通情况

 

 

备库上验证:

 

[2021/4/23 20:51:13] [oracle@PEKPBSDIHDBP02 dbs]$ sqlplus "sys/elcarO@321qwe"@ORCLDG1 as sysdba

 

[2021/4/23 20:51:14]

 

[2021/4/23 20:51:14] sql*Plus: Release 11.2.0.4.0 Production on Fri Apr 23 20:44:06 2021

 

[2021/4/23 20:51:14]

 

[2021/4/23 20:51:14] copyright (c) 1982,2013,Oracle.  All rights reserved.

 

[2021/4/23 20:51:14]

 

[2021/4/23 20:52:34] ERROR:

 

[2021/4/23 20:52:34] ORA-12154: TNS:Could not resolve the connect identifier specified

 

登录密码包含@,在界面登录需要转义

 

主库上验证:

 

[2021/4/23 20:55:11] [oracle@PEKPBSDIHDBP02 dbs]$ sqlplus sys/\"elcarO@321qwe\"@orcl_stb as sysdba

 

[2021/4/23 20:55:11]

 

[2021/4/23 20:55:11] sql*Plus: Release 11.2.0.4.0 Production on Fri Apr 23 20:48:03 2021

 

[2021/4/23 20:55:11]

 

[2021/4/23 20:55:11] copyright (c) 1982,Oracle.  All rights reserved.

 

[2021/4/23 20:55:11]

 

[2021/4/23 20:55:11]

 

[2021/4/23 20:55:11] Connected to:

 

[2021/4/23 20:55:11] Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

 

[2021/4/23 20:55:11] With the Partitioning,OLAP,Data Mining and Real Application Testing options

 

转义写法:sqlplus sys/\"密码\"@tnsname

 

相关文章

Java Oracle 结果集是Java语言中处理数据库查询结果的一种方...
Java AES和Oracle AES是现代加密技术中最常使用的两种AES加密...
Java是一种广泛应用的编程语言,具备可靠性、安全性、跨平台...
随着移动互联网的发展,抽奖活动成为了营销活动中不可或缺的...
Java和Oracle都是在计算机领域应用非常广泛的技术,他们经常...
Java 是一门非常流行的编程语言,它可以运行于各种操作系统上...