oracle - 如何使用 SQLPLUS 连接到 Oracle | Oracle 即时客户端 | 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 - 获取以前的结清余额作为日期范围的未结余额
- java - 您如何在 Android 中从您的应用中注销(youtube、twitter 等)会话
- commaide - 单击“运行”后的空输出
- sql - 在 SQL Server 中将基数 10 转换为基数 2 以获得非常大的数字
- html - 为什么我看不到我的卡片是 flex 或 grid 布局?
- google-cloud-platform - 谷歌云项目合并
- python - 使用 Scrapy 抓取 json 文件的多个 url
- c# - 运行测试时更新 DataGridView
- python - 如何构建包装 pytest 插件?
- html - 输入文本字段在移动视图中变为只读