【问题标题】:Oracle SQL Developer Works SQLplus DOESN'TOracle SQL Developer Works SQLplus 不支持
【发布时间】:2019-07-03 13:49:28
【问题描述】:

使用 Oracle SQL-Developer,我可以连接到我的 VMware CentOS 7 Oracle 数据库 ORCL。

如果我尝试连接 SQLPlus,我会被告知该领域不存在。

知道为什么我可以在同一台机器上连接 Oracle SQL-Developer 而不是 SQLPlus?

TNSPing 解析 SID/服务名称没有任何问题。

C:\oracle\ora11g\11.2.0.2\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = 192.168.1.50) (Port = 1521))) (CONNECT_DATA = (SERVICE_NAME = ORCL)))
OK (10 msec)

以下是 SQLPlus 连接尝试的输出,来自 SQL-Developer 正常工作的同一台机器。

C:\oracle\ora11g\11.2.0.2\BIN>sqlplus system/password@orcl

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 3 08:31:13 2019

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

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3640
Additional information: -2140813497
Process ID: 0
Session ID: 0 Serial number: 0

【问题讨论】:

    标签: oracle oracle-sqldeveloper sqlplus database-administration


    【解决方案1】:

    你的 sqlplus 命令,试试这个:

     sqlplus user/password@192.168.1.50:1521/ORCL
    

    在 SQL Developer 中,连接后,运行以下命令:

    show tns
    show connection
    

    确保您实际上是在尝试连接到 SQLPlus 中的同一个数据库,同时确保您的 $ORACLE_HOME 和 $ORACLE_SID 配置正确。

    【讨论】:

    • 查看我的更新,我尝试了你所说的但我仍然无法连接。
    • 这是在同一台机器上吗?如果是这样,您的 $ORACLE_HOME 的价值是多少?
    • 与 Oracle SQL Developer 相同的机器(Windows 10)。 ORACLE_HOME = C:\oracle\ora11g\11.2.0.2 和 ORACLE_SID = ORCL
    • 在 Windows 上应该看起来不像 C:\...\...\product\11.2.0.2\dbhome_1 吗?
    • 我认为 $ORACLE_HOME 的目录值有些问题,这就是为什么它失败但 sqldev 有效(jdbc/java 不使用它)
    【解决方案2】:

    这似乎是 Oracle_Home 或您的侦听器有问题。
    能否请您 - - LSNRCTL 并检查其状态。
    如果没问题,再尝试连接sys:

    sqlplus /nolog
    conn / as sysdba
    

    【讨论】:

      猜你喜欢
      • 2019-10-01
      • 1970-01-01
      • 2011-08-10
      • 1970-01-01
      • 2016-11-28
      • 2015-01-14
      • 1970-01-01
      • 2014-04-30
      • 1970-01-01
      相关资源
      最近更新 更多