ORA-01031 故障處理方法



1.故障現象:

   報ORA-01031: insufficient privileges 錯誤,本地命名方式無法登錄:


[oracle@edbjr2p2 admin]$ sqlplus sys/oracle@PROD3 as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Sat Jan 21 04:32:12 2017

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

ERROR:
ORA-01031: insufficient privileges


Enter user-name: ll
Enter password:
ERROR:
ORA-01005: null password given; logon denied


2.嘗試OS 驗證登錄,登陸正常,暫時排除數據庫本身問題:

[oracle@edbjr2p2 admin]$export ORACLE_SID=PROD3

[oracle@edbjr2p2 admin]$ sqlplus  / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Sat Jan 21 04:33:08 2017

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


 SYS @ PROD3 >show parameter remote

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
result_cache_remote_expiration       integer     0



# 發現沒有密碼文件用戶(或未發現),也無法授予權限,提示密碼文件丟失或無效:

 SYS @ PROD3 >select * from v$pwfile_users;

no rows selected


 SYS @ PROD3 >grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled


 SYS @ PROD3 >exit

[oracle@edbjr2p2 dbs]$ pwd
/u01/app/oracle/product/11.2.0/db_1/dbs


#發現密碼文件拼寫有誤:

[oracle@edbjr2p2 dbs]$ ll


-rw-rw---- 1 oracle oinstall  1544 Jan 18 18:57 hc_PROD3.dat
-rw-r--r-- 1 oracle oinstall   535 Jan 18 19:00 initPROD3.ora
-rw-r----- 1 oracle oinstall    24 Jan 18 19:14 lkPROD3
-rw-r----- 1 oracle oinstall  5120 Jan 18 18:47 orapwdPROD3
-rw-r----- 1 oracle oinstall  2560 Jan 18 19:58 spfilePROD3.ora

#重建密碼文件

[oracle@edbjr2p2 dbs]$ orapwd file='/u01/app/oracle/product/11.2.0/db_1/dbs/orapwdPROD3'password=oracle

OPW-00005: File with same name exists - please delete or rename



[oracle@edbjr2p2 dbs]$ rm orapwdPROD3
[oracle@edbjr2p2 dbs]$ orapwd file='/u01/app/oracle/product/11.2.0/db_1/dbs/orapwPROD3'password=oracle


[oracle@edbjr2p2 ~]$ export ORACLE_SID=PROD3
[oracle@edbjr2p2 ~]$ sqlplus
sys/oracle@PROD3 as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Sat Jan 21 04:59:12 2017

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

 SYS @ PROD3 >

 SYS @ PROD3 >select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE


如果口令文件創建的有問題,也是會報如下的錯誤:

ora-01031:insufficient privileges

口令文件的命名格式應爲orapwsid,並且sid是區分大小寫的。由於Target Database連接Auxiliary Database時需要驗證口令,
如果違反了以上規則,將會提示ORA-01031: insufficient privileges。




博文鏈接:http://www.cnblogs.com/kelantas/archive/2011/02/18/1958173.html

博文鏈接2:http://blog.csdn.net/wyzxg/article/details/4301266




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章