以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 如果還是有問題,可能是缺
以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=
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連接了