使用Instant Client Mac连接到SQLPLUS中的系统

发布于 2025-02-12 02:08:19 字数 784 浏览 1 评论 0原文

我已经在Mac上下载了SQLPLUS Instant Client,并具有SQLPLUS的工作。我需要登录系统并连接HR模式或制作新的模式。我在连接方面遇到问题。

user@togo ~ % export PATH=~/Downloads/instantclient_19_8:$PATH
user@togo ~ % sqlplus

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 1 11:43:25 2022
Version 19.8.0.0.0

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

Enter user-name: sqlplus /nolog
ERROR:
ORA-12162: TNS:net service name is incorrectly specified


Enter user-name: system
Enter password: 
ERROR:
ORA-12162: TNS:net service name is incorrectly specified


Enter user-name: sys as sysdba
Enter password: 
ERROR:
ORA-12162: TNS:net service name is incorrectly specified


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

如果有人可以帮助我解决这个问题,或者指导我完成Mac上使用SQLPLU的过程。

I have downloaded sqlplus instant client on mac and have sqlplus working. I need to login as system and connect hr schema or make a new schema. i'm having problems connecting.

user@togo ~ % export PATH=~/Downloads/instantclient_19_8:$PATH
user@togo ~ % sqlplus

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Jul 1 11:43:25 2022
Version 19.8.0.0.0

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

Enter user-name: sqlplus /nolog
ERROR:
ORA-12162: TNS:net service name is incorrectly specified


Enter user-name: system
Enter password: 
ERROR:
ORA-12162: TNS:net service name is incorrectly specified


Enter user-name: sys as sysdba
Enter password: 
ERROR:
ORA-12162: TNS:net service name is incorrectly specified


SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

If anyone could help me with this problem or guide me through the process of using sqlplus on Mac.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

朦胧时间 2025-02-19 02:08:19
  1. 首先,您需要弄清数据库正在运行的主机以及可以使用的服务名称是什么。
  2. 接下来,使用从1中学到的信息创建一个tnsnames.ora或使用ezconnect连接而不tnsnames.ora
 假设您的DBSERVER可以作为Linux01到达
假设您的数据库支持服务dbservice1
假设linux01上的侦听器dbservice1在端口1521上
 

可以

使用sqlplus hr/bigSecretPassword@// linux01/dbservice01

进行sqlplus hr/bigSecretPassword完成您的ezconnect ,或者如果您的侦听器在其他端口(1527)上,则可以

使用sqlplus hr/bigSecretphere@/bigSecretPlastword@/@// linux01:1527/dbservice01

可能有很多错误消息。如果遇到错误,请不要忘记指定您收到的确切消息。 (以及它到了多长时间)

  1. First you need to figure out on what host your database is running and what the service names are that you can use to connect to.
  2. Next create a tnsnames.ora using the info learned from 1 or use EZCONNECT to connect without tnsnames.ora
assume your dbserver is reachable as linux01
assume your database supports the service dbservice1
assume the listener on linux01 for dbservice1 is on port 1521

your EZCONNECT can be done

using sqlplus hr/bigsecretpassword@//linux01/dbservice01

or if your listener is on a different port (1527) you can specify that

using sqlplus hr/bigsecretpassword@//linux01:1527/dbservice01

Lots of error message are possible. If you get errors, don't forget to specify the exact message you get. (and how long it took before it came)

家住魔仙堡 2025-02-19 02:08:19

我不使用Mac,但是 - 一般而言,数据库名称(即其 alias )与用户名一起指定。我的MS Windows上这样的东西:

M:\>sqlplus

SQL*Plus: Release 18.0.0.0.0 - Production on Pet Srp 1 09:11:18 2022
Version 18.5.0.0.0

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

Enter user-name: scott@orcl                --> this!
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

Active code page: 1250

SQL>

I don't use Mac, but - generally speaking, database name (i.e. its alias) is specified along with username. Something like this on my MS Windows:

M:\>sqlplus

SQL*Plus: Release 18.0.0.0.0 - Production on Pet Srp 1 09:11:18 2022
Version 18.5.0.0.0

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

Enter user-name: scott@orcl                --> this!
Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

Active code page: 1250

SQL>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文