ORA-01031: insufficient privileges as sysdba

Problem:

[oracle@l360cn31 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 15 10:21:54 2010

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

ERROR:
ORA-01031: insufficient privileges

 

Solutions:

1. http://www.chinaunix.net/jh/19/132866.html 写道

#############################################
#
# NAME: troubleshoot connect internal.txt
#
# DESCRIPTION:
# connect internal
# connect / as sysdba 要口令问题:
# refer (METALINK,ORACLEDOC),
# metalink search words(connect internal)
# NOTE:
#
# modifiy (MM/DD/YY) AUTHOR
# 05/03/03 ZORROL
#############################################

————————————————————
1。检查sqlnet.ora 文件.
sqlnet.ora 文件损坏或格式不对可以导致出现该问题。
sqlnet.ora 文件可能存放路径为
$TNS_ADMIN/sqlnet.ora
如果没有设置$TNS_ADMIN默认在$ORACLE_HOME/network/admin/sqlnet.ora

$HOME/sqlnet.ora

(1). 可以从别的机器拷贝一个文件过来,注意备份原来的sqlnet.ora。
---检查sqlnet.ora 文件内容
(2). 检查SQLNET.AUTHENTICATION_SERVICES
如果没有使用dblink.检查该行并设置
SQLNET.AUTHENTICATION_SERVICES = (BEQ,NONE)

(3). SQLNET.CRYPTO_SEED
在unix 下不需要该参数。如果存在该行,注释掉或删掉

(4).AUTOMATIC_IPC
如果该参数为 ON,将强制使用"TWO_TASK" 连接
最好设置为OFF
AUTOMATIC_IPC = OFF

2.检查相关文件的权限配置。
找到$TNS_ADMIN/*

$ cd $TNS_ADMIN
$ chmod 644 sqlnet.ora tnsnames.ora listener.ora
$ ls -l sqlnet.ora tnsnames.ora listener.ora
-rw-r--r-- 1 oracle dba 1628 Jul 12 15:25 listener.ora
-rw-r--r-- 1 oracle dba 586 Jun 1 12:07 sqlnet.ora
-rw-r--r-- 1 oracle dba 82274 Jul 12 15:23 tnsnames.ora

3.检查操作系统相关设置。
(1). $ORACLE_HOME环境变量是否设置正确
% cd $ORACLE_HOME
% pwd
如果错误,请重新设置:
sh or ksh: ----------
$ ORACLE_HOME=<path_to_ORACLE_HOME>;
$ export ORACLE_HOME
Example:
$ ORACLE_HOME=/u01/app/oracle/product/7.3.3
$ export ORACLE_HOME

csh: ----
% setenv ORACLE_HOME <path_to_ORACLE_HOME>; Example:
% setenv ORACLE_HOME /u01/app/oracle/product/7.3.3
另外$ORACLE_HOME路径应为实际路径,不应是目录连接(ln -s)

(2) $ORACLE_SID是否设置正确;
% echo $ORACLE_SID

(3).确信没有设置$TWO_TASK
检查 "TWO_TASK" 是否设置:
sh, ksh or on HP/UX only csh:
-----------------------------------
env |grep -i two
- or -
echo $TWO_TASK

csh:
----
setenv |grep -i two

如果有返回行比如:
TWO_TASK=
- or -
TWO_TASK=PROD
就需要取消着这些环境变量设置 :
sh or ksh:
----------
unset TWO_TASK
csh:
----
unsetenv TWO_TASK


(4) 检查oracle 文件的权限:
% cd $ORACLE_HOME/bin
% ls -l oracle
权限应为:rwsr-s--x, or 6751.
如果不是:
% chmod 6751 oracle

(5). 检查当前所连接的操作系统用户是否是"osdba" 并且已经定义在:
"$ORACLE_HOME/rdbms/lib/config.s"
or
"$ORACLE_HOME/rdbms/lib/config.c".
通常应为dba
% id uid=1030(oracle) gid=1030(dba)
可以如果"gid" 是 "dba" , "config.s" or "config.c"
里面应该有: /* 0x0008 15 */ .ascii "dba\0"
如果没有添加目前的操作系统用户到dba 组,或则手工编辑更改config.c并且:%relink oracle

(6).所需要的文件系统是否正确mount
%mount

(7) 目前身份是否是"root" 并且操作系统环境变量 "USER", "USERNAME", and "LOGNAME" 没有设置成"root".
root用户是特例,除非当前组是dba 组,否则不能connect internal.
把root用户当前组改为dba组:
# newgrp dba
-----最好不要以root管理数据库;

(8).检查"/etc/group" :
是否存在重复行
% grep dba /etc/group
dba::1010:
dba::1100:
如果有,删掉没有用的。

(9).确信停掉的instance没有占用内存资源
比如:ipcs -b
T ID KEY MODE OWNER GROUP SEGSZ
Shared Memory:
m 0 0x50000ffe --rw-r--r-- root root 68
m 1601 0x0eedcdb8 --rw-r----- oracle dba 4530176
可以看到1601 被oracle 使用,删掉.
-------注意是否启动了多个instance
% ipcrm -m 1601

(10).如果同时还有ora-12705 错误检查一下环境变量:
"ORA_NLS", "ORA_NLS32", "ORA_NLS33" ,"NLS_LANG".

(11).检查 "ORACLE_HOME" and "LD_LIBRARY_PATH 环境变量:
$ LD_LIBRARY_PATH=$ORACLE_HOME/lib
$ export LD_LIBRARY_PATH
$ ORACLE_HOME=/u01/app/oracle/product/8.0.4
$ export ORACLE_HOME


(12).当前的instance 所再的磁盘是否有足够的磁盘空间
df -k

(13).用户对/etc/passwd 是否有读权限。

(14).如果使用mts 方式,确信你的连接使用dedicade server 方式。

(15).安装ORACLE所需操作系统补丁是否打全。ORACLE 是否已经补丁到最新

 

2. all solutions in step 1 are not work for me. then rebuild the password file.

a) password file location: $ORACLE_HOME/dbs

b) file name: orapw<SID>; e.g. your oracle sid is orcl, then the name is orapworcl.

NOTE: the name can NOT be changed.

c) run the command: orapwd, format:

 

Usage: orapwd file=<fname> password=<password> entries=<users> force=<y/n>

  where
    file - name of password file (mand),
    password - password for SYS (mand),
    entries - maximum number of distinct DBA and     force - whether to overwrite existing file (opt),
OPERs (opt),
  There are no spaces around the equal-to (=) character.

 

 So your command will be:

 

[oracle@l360cn31 ~]$ orapwd file=$ORACLE_HOME/dbs/orapworcl password=oracle entries=3 force=y

 

d) using the command to login as sysdba: sqlplus sys/oracle as sysdba

NOTE: the password is only used for SYS user.

 

[oracle@l360cn31 ~]$ sqlplus sys/oracle as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 15 10:56:47 2010

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


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL>
 

 e) how the sqlplus search the password file:

 

  • $ORACLE_HOME/dbs/orapw<sid>  
  • $ORACLE_HOME/dbs/orapw

NOTE: the file orapw can be used for share login mode.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值