Oracle賦予使用者sysdba許可權

來源:互聯網
上載者:User

以SYS使用者進入Oracle,

SQL> grant sysdba to username;

grant sysdba to username

*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled

首先,把初始化參數REMOTE_LOGIN_PASSWORDFILE的值改成EXCLUSIVE

如果還是有問題,可能是缺少密碼檔案,用orapwd建立密碼檔案

$ orapwd -h
Usage: orapwd file=<fname> password=<password> entries=<users>

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

這個命令很簡單,密碼檔案一般放在$ORACLE_HOME/dbs目錄下,命名規則為orapd+SID,

orapwd FILE='/db/oracle/product/10.2.0/db_1/dbs/orapw+SID'  PASSWORD=oracle   ENTRIES=5  FORCE=y

然後再執行

SQL> grant sysdba to username;

Grant succeeded.

檢查

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP
------------------------------ ----- -----
SYS                            TRUE  TRUE
******                          TRUE  FALSE

SYSDB那一欄是TRUE就對了

然後就可以as sysdba串連了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.