采用dbstart脚本启动的一些错误——解决

本文解决在Linux环境下使用root用户启动Oracle服务时未同时启动监听的问题,并调整权限设置以确保正常运行。此外,还探讨了不同登录方式下的权限认证问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在linux系统下,用root用户采用dbstart脚本直接启动oracle服务或监听

 

第一个问题:启动服务的同时没有启动监听

[root@localhost ~]# su - oracle -c "dbstart"
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener
Usage: /oradata/oracle/112/bin/dbstart ORACLE_HOME
Processing Database instance "orcl": log file /oradata/oracle/112/startup.log

ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener这个提示说明
启动oracle服务的同时没有启动oracle监听服务,因此如果想在启动oracle服务的同时i启动监听
就需要修改dbstart,将ORACLE_HOME_LISTNER值设为$ORACLE_HOME(原来是为$1)
[root@localhost ~]# vi /oradata/oracle/112/bin/dbstart

注:dbshut一样的道理,如果想关闭数据库服务的同时关闭监听服务也是将dbshut文件中的ORACLE_HOME_LISTNER值设为$ORACLE_HOME

修改后再次执行dbstart
[root@localhost ~]# su - oracle -c "dbstart"
Processing Database instance "orcl": log file /oradata/oracle/112/startup.log
查看启动日志,发现提示权限不足
[root@localhost ~]# cat /oradata/oracle/112/startup.log

/oradata/oracle/112/bin/dbstart: Starting up database "orcl"
2012年 04月 14日 星期六 12:12:17 CST


SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 14 12:12:17 2012

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

SQL> ERROR:
ORA-01031: insufficient privileges


SQL> ORA-01031: insufficient privileges
SQL>
/oradata/oracle/112/bin/dbstart: Database instance "orcl" warm started.

 

第二个问题:不同登录方式下权限的认证问题
直接手动登陆以sqlplus / as sysdba方式 登陆,提示权限不足

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 14 12:17:48 2012

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

ERROR:
ORA-01031: insufficient privileges


Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied


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

但是如果先以sqlplus /nolog,在以sys用户登陆就可以
[oracle@localhost ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 14 12:17:58 2012

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

SQL> conn sys/xxx@orcl as sysdba
Connected to an idle instance.


修改sqlnet.ora文件,将SQLNET.AUTHENTICATION_SERVICES=(NTS)这句话注释或值改为ALL

修改后再次直接以sqlplus / as sysdba方式登陆就可以了
[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 14 12:26:44 2012

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

Connected to an idle instance.
SQL> exit
Disconnected


因此直接再次执行dbstart,这次成功启动oracle服务了
[oracle@localhost ~]$ su - oracle -c "dbstart"
口令:
Processing Database instance "orcl": log file /oradata/oracle/112/startup.log

说明:关于第二个问题,可查看  这篇文章。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值