文章都可以转载、引用,标明转载出处即可。

Oracle 常见报错整理

DBserver Mr.c 3484℃ 0评论

报错一:
   上一篇文章 记录了如何在centos7 下安装oracle 11g数据库,如果一切正常的情况下呢oracle是正常启动的,但是突然发现检测状态居然报错了。

[root@oracledb ~] lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 29-APR-2017 17:06:13

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

Message 1053 not found; No message file for product=network, facility=TNSMessage 1020 not found; No message file for product=network, facility=TNSMessage 1021 not found; No message file for product=network, facility=TNSMessage 1022 not found; No message file for product=network, facility=TNSMessage 1023 not found; No message file for product=network, facility=TNSMessage 1026 not found; No message file for product=network, facility=TNSMessage 1034 not found; No message file for product=network, facility=TNSMessage 1024 not found; No message file for product=network, facility=TNSMessage 1025 not found; No message file for product=network, facility=TNSMessage 1040 not found; No message file for product=network, facility=TNSMessage 1033 not found; No message file for product=network, facility=TNSMessage 1028 not found; No message file for product=network, facility=TNSMessage 1415 not found; No message file for product=network, facility=TNS  Message 1050 not found; No message file for product=network, facility=TNS
Message 1029 not found; No message file for product=network, facility=TNSMessage 1411 not found; No message file for product=network, facility=TNS
  Message 1408 not found; No message file for product=network, facility=TNS
Message 1411 not found; No message file for product=network, facility=TNS
  Message 1408 not found; No message file for product=network, facility=TNS
Message 1052 not found; No message file for product=network, facility=TNS

  这就奇怪了,查看了端口明明就是监听状态,反复查后发现其实是因为我们使用root账户执行检测,但是root用户下没有获取到ORACLE_HOME的信息(可能没有设置或者未执行生效环境变量)。

[root@oracledb ~] echo $ORACLE_HOME

  添加ORACLE_HOME到系统环境变量。

[root@oracledb ~] vim /etc/profile
export ORACLE_HOME=/ora/oracle/product/11.2.0/db_1
export ORACLE_SID=orcl
[root@oracledb ~] source /etc/profile
[root@oracledb ~] echo $ORACLE_HOME
/ora/oracle/product/11.2.0/db_1

  再次执行lsnrctl status 即可查看到状态了。

[root@oracledb ~] lsnrctl status
..................
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

报错二:
  重启服务器后启动监听,但是登录后操作报错:

[root@oracledb ~] lsnrctl start
.............
SQL> show parameter local_listener;
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0

  由于只是启动了监听,但是数据库并没有同步启动导致:

SQL> start
SP2-1506: START, @ or @@ command has no arguments
SQL> startup
ORACLE instance started.

Total System Global Area 1603411968 bytes
Fixed Size		    2213776 bytes
Variable Size		  402655344 bytes
Database Buffers	 1191182336 bytes
Redo Buffers		    7360512 bytes
Database mounted.
Database opened.

另外,对oracle进行操作的时候建议已oracle用户操作,root账户可能由于各种环境变量问题无法操作。

转载请注明:菜鸟运维网 » Oracle 常见报错整理

喜欢 (4)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址