【问题标题】:Oracle database : ORA.01034:ORACLE not availableOracle 数据库:ORA.01034:ORACLE 不可用
【发布时间】:2018-10-19 08:40:55
【问题描述】:

我在 ubuntu 18.04 中安装了 oracle 12c r2,当我进入 SqlPlus 并执行查询时出现错误。

要安装 oracle,我遵循以下两个指南:

1-https://tutorialforlinux.com/2018/05/09/how-to-install-oracle-12c-r2-database-on-ubuntu-18-04-bionic-64bit-easy-guide/ 2-https://etc.to/confluence/pages/viewpage.action?pageId=20480023

给我的错误如下:

ERROR at line 1:
ORA-01034:ORACLE not available
Process ID:0
Session ID: Serial numbre:0

监听器的状态(lsnrctl status)给了我以下错误:

Connectinc to (ADDRESS=(PROTOCOL=tcp)(HOST)(PORT=1521))
TNS-12541:TNS: no listener
tns-12560 TNS:protocol adapter error
TNS-00511: No listener
Linux error:111: Connection refused

谁能帮帮我?谢谢!!

更多信息

现在当我输入 lsnrctl status 我得到了这个,但是在 sqlplus 中仍然出现上面的失败

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 19-OCT-2018 01:53:18

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                19-OCT-2018 01:52:14
Uptime                    0 days 0 hr. 1 min. 5 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/diag/tnslsnr/andoni-VirtualBox/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=andoni-VirtualBox)(PORT=1521)))
The listener supports no services
The command completed successfully

启动错误:

    Enter user-name: sys as sysdba
Enter password:
Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/12/dbhome_1/dbs/initSID.ora'
SQL>

【问题讨论】:

  • 可能数据库没有启动。您可以运行 ps -ef | grep pmon 查找 pmon 进程。你可以运行 sqlplus / as sysdba 然后输入 startup。
  • 当我执行命令时,我得到了我将在帖子中留下的错误,但是在这个目录中我没有 initxe.ora 只有 init.ora
  • 看下面的第二个答案。您的 ORACLE_HOME 和 ORACLE_SID 必须正确设置。 Oracle home 可能是 /u01/app/oracle/product/12/dbhome_1。看起来您没有设置 ORACLE_SID。应该是ORCL。
  • 您能否发布以下两个 Linux shell 命令的输出:ps -ef | grep pmon 和设置 | grep 甲骨文?

标签: database oracle


【解决方案1】:

编辑 tnsnames.ora 文件 u01/app/oracle/product/12/client_1/network/admin/tnsnames.ora

MY_BASE_DEV = (描述= (地址列表 = (地址 =(协议 = TCP)(主机 = 192.168.2.1)(端口 = 1521)) ) (连接数据 = (SERVICE_NAME = BASEDEV) ) ) MY_BASE_PROD = (描述= (地址列表 = (地址 = (协议 = TCP) (主机 = 192.168.2.2) (端口 = 1521)) ) (连接数据 = (SERVICE_NAME = BASEPROD) ) )

【讨论】:

  • 监听器似乎工作,但是当我尝试进行查询或创建用户时,sqlplus 继续失败
【解决方案2】:

您可能需要设置 ORACLE_HOME 和 ORACLE_SID 环境变量:

需要做到以下几点:

export ORACLE_HOME='HOME PATH VARIABLE'
export ORACLE_SID=<SID>
sqlplus "/as sysdba"
startup

ORACLE_HOME, ORACLE_SID 字段应该匹配。 ORACLE_HOME 中没有尾随“/”之类的小东西很重要。

【讨论】:

    猜你喜欢
    • 2012-11-27
    • 2012-11-08
    • 2017-07-19
    • 1970-01-01
    • 2019-08-03
    • 2011-09-27
    • 2016-04-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多