在Linux環境下設置 ora-01031:insufficient privileges解決方法總結


今天需要使用sys用戶處理問題,但是報錯上面ora-01031:insufficient privileges。

在網上有很多方法,這個是自己經過測試的方法步驟。

1:首先檢查文件sqlnet.ora文件是否設置正確(文件地址就是你oracle安裝的目錄)

[html]  view plain  copy
 
  1. # sqlnet.ora Network Configuration File: /app/oracle/product/10.2.0/network/admin/sqlnet.ora  
  2. # Generated by Oracle configuration tools.  
  3.   
  4. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME)  
  5. <span style="color:#FF0000;">SQLNET.AUTHENTICATION_SERVICES=(ALL)  
  6.   
  7. </span>  

 

2:如果上面設置正確(為什么設置可以參考http://blog.csdn.net/huoyin/article/details/45544709)

然后用ssh等連接工具訪問Linux服務器這里注意了如果存在多個實例需要指定  

登錄oracle

[java]  view plain  copy
 
  1. su - oracle  

指定實例

 

 

[java]  view plain  copy
 
  1. export ORACLE_SID=***  

3:需要檢查系統配置

 

登錄oracle

 

[java]  view plain  copy
 
  1. sqlplus / as sysdba  

查詢

 

 

[sql]  view plain  copy
 
  1. SQL> show parameter password  
  2.   
  3. NAME                         TYPE        VALUE  
  4. ------------------------------------ ----------- ------------------------------  
  5. remote_login_passwordfile            string      EXCLUSIVE  
  6. SQL>   


2:檢查有哪些用戶

 

 

[sql]  view plain  copy
 
  1. SQL> select * from v$pwfile_users;  
  2.   
  3. USERNAME                       SYSDB SYSOP  
  4. ------------------------------ ----- -----  
  5. SYS                    TRUE  TRUE  
  6.   
  7. SQL>   

因為我已經操作過了現在顯示是有sys的,沒有設置的是空的

 

 

[sql]  view plain  copy
 
  1. SQL> grant sysdba to sys;  
  2. grant sysdba to sys  
  3. *  
  4. ERROR at line 1:  
  5. ORA-01994: GRANT failed: password file missing or disabled  


3:現在添加文件退出oracle用戶

 

 

[sql]  view plain  copy
 
  1. SQL> exit  
  2. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production  
  3. With the Partitioning, OLAP and Data Mining options  
  4. [oracle@dd ~]$   


4:添加文件

 

執行添加加密的建立password文件

[java]  view plain  copy
 
  1. [oracle@dd ~]$orapwd file=/app/oracle/product/10.2.0/dbs/orapwprice.ora password=111111 entries=10 force=y  

因為是linux所以文件明是orapw+實例.ora 
window是pwd+實例.ora  

 

5:重啟服務,用sys登錄


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM