Oracle sys使用者遠程登入失敗 ORA-01031

來源:互聯網
上載者:User

標籤:

今天在管理oracle的時候發現一個很奇怪的問題,通過sqlplus sys/password as sydba 或者 sqlplus / as sysdba均可以登陸。

但通過sqlplus sys/[email protected] as sysdba登入的時候報錯,顯示

ORA-01031: insufficient privileges

明明是sys使用者,為什麼會登入不上呢?

這個原因是密碼檔案錯誤或失敗導致的。Oracle通過密碼檔案來管理sysdba的許可權。如果被賦予了

Sysdba許可權,正常情況下在密碼檔案裡就有使用者與密碼的記錄。

經查:Oracle有兩種認證的方式:

  1. 與作業系統整合認證方式

    ?

  2. 使用密碼檔案認證

過程中有以下幾個疑點:

  1. oracle 密碼檔案是做什麼用的呢?

主要是進行DBA許可權的身分識別驗證。

  1. Oracle密碼檔案儲存體在什麼位置呢?

$ORACLE_HOME/dbs/orapw$ORACLE_SID

  1. 根據什麼判斷是使用作業系統整合認證還是使用密碼檔案認證呢?

    SQL> show parameter remote_login

    ?

    NAME TYPE VALUE

    ------------------------------------ ----------- ------------------------------

    remote_login_passwordfile string EXCLUSIVE

    ?

    其中remote_login_passworldfile有以下幾個值:

  • shared

    One or more databases can use the password file. The password file can contain?SYS?as well as non-SYS?users.

    一個或多個的資料庫執行個體可以使用這個密碼檔案。內容含有sys和非sys使用者

  • exclusive

    The password file can be used by only one database. The password file can contain?SYS?as well as non-SYS?users.

    密碼檔案只能被一個執行個體使用。內容含有sys和非sys使用者

  • none

    Oracle ignores any password file. Therefore, privileged users must be authenticated by the operating system.

    忽略任何密碼檔案。所以所有使用者必須經過作業系統認證

經查資料庫使用密碼檔案認證。那麼需要重建密碼檔案。

orapwd file=$ORACLE_HOME/dbs/orapworcl password=password

提示已經有一個同名的檔案

先刪除orapwdorcl.ora 與orapwdorcl

rm orapwdorcl.ora

rm orapwdorcl

再執行

orapwd file=$ORACLE_HOME/dbs/orapworcl password=password

通過sqlplus sys/[email protected] as sysdba登入還是提示

ORA-01031: insufficient privileges

Why?

經查執行orapwd命令缺少entries與force參數

orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=password entries=5 force=y

再次登入,成功。

?

?

?

Ref:

https://aprakash.wordpress.com/2010/06/01/sys-as-sysdba-insufficient-privileges/

http://blog.csdn.net/leshami/article/details/5611672

Oracle sys使用者遠程登入失敗 ORA-01031

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.