执行sqlplus / as sysdba报错ORA-01031: insufficient privileges

背景:

        从线上环境copy OracleHome到线下做测试环境,修改完pfile后执行sqlplus / as sysdba报错

[erparc@xxx.com ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Feb 14 16:26:00 2022

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

ERROR:
ORA-01031: insufficient privileges

解决办法:

        检查文件$ORACLE_HOME/rdbms/lib/config.c

[erparc@xxx.com ~]$ cat $ORACLE_HOME/rdbms/lib/config.c

/*  SS_DBA_GRP defines the UNIX group ID for sqldba adminstrative access.  */
/*  Refer to the Installation and User's Guide for further information.  */

/* IMPORTANT: this file needs to be in sync with
              rdbms/src/server/osds/config.c, specifically regarding the
              number of elements in the ss_dba_grp array.
 */

#define SS_DBA_GRP "dba"
#define SS_OPER_GRP "dba"
#define SS_ASM_GRP ""

char *ss_dba_grp[] = {SS_DBA_GRP, SS_OPER_GRP, SS_ASM_GRP};

        发现线上的oracle用户的group设置的是dba,线下的则没有将dba加入到group里

[erparc@xxx.com ~]$ id
uid=510(erparc) gid=512(erparc) groups=512(erparc)

        使用命令usermod追加到groups里即可

[root@xxx.com u01]# usermod -a -G dba erparc
[erparc@xxx.com ~]$ id
uid=510(erparc) gid=512(erparc) groups=512(erparc),508(dba)
[erparc@xxx.com ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Feb 14 16:28:02 2022

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

Connected to an idle instance.

        当然修改$ORACLE_HOME/rdbms/lib/config.c文件也是可以的

                1.修改$ORACLE_HOME/rdbms/lib/config.c文件,将SS_DBA_GRP/SS_OPER_GRP/SS_ASM_GRP设置正确

                2.cd $ORACLE_HOME/rdbms/lib/config.c && mv config.o config.bck

                3.make -f ins_rdbms.mk ioracle

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值