如何使用 SQLPLUS 连接到 Oracle | Oracle 即时客户端 | ORA-12545 错误
How to connect to Oracle using SQLPLUS | Oracle Instant Client | ORA-12545
使用 SQL Developer 成功连接,但是当我在 Oracle Instant Client 中使用 sqlplus 时出现以下问题
方法一:
[integrator@a-esb-app01 instantclient_19_8]$ ./sqlplus EGOINT@139.138.267.202:1521:EPROD
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 22 18:14:36 2020
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Enter user-name: egoint
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
方法二:
[integrator@a-esb-app01 instantclient_19_8]$ ./sqlplus EGOINT@139.138.267.202:1521/EPROD
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 22 18:18:13 2020
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
不确定以上哪种方法是正确的,连接字符串有什么问题或服务器端需要进行任何更改?
注意:我能够成功连接到另一个Oracle 服务器。所以 InstantClient
没问题
使用以下方法修复:
./sqlplus egoint/egoint@(description=(address=(protocol=tcp)(host=139.138.267.202)(port=1521))(connect_data=(sid=EPROD)))
使用 SQL Developer 成功连接,但是当我在 Oracle Instant Client 中使用 sqlplus 时出现以下问题
方法一:
[integrator@a-esb-app01 instantclient_19_8]$ ./sqlplus EGOINT@139.138.267.202:1521:EPROD
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 22 18:14:36 2020
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12545: Connect failed because target host or object does not exist
Enter user-name: egoint
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
方法二:
[integrator@a-esb-app01 instantclient_19_8]$ ./sqlplus EGOINT@139.138.267.202:1521/EPROD
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Dec 22 18:18:13 2020
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
不确定以上哪种方法是正确的,连接字符串有什么问题或服务器端需要进行任何更改?
注意:我能够成功连接到另一个Oracle 服务器。所以 InstantClient
没问题使用以下方法修复:
./sqlplus egoint/egoint@(description=(address=(protocol=tcp)(host=139.138.267.202)(port=1521))(connect_data=(sid=EPROD)))