🍇Fix Password File Missing on Oracle

ในกรณีที่เราทำการ Remote Login บน Oracle ด้วย Privilege DBA มันจะทำการ Authentication กับ Password File ซึ่งถ้าหากหายไป จะทำให้ไม่สามารทำการ Remote Login หรือแม้กระทั่ง Grant Privilege DBA ให้กับ User ได้ จะต้องทำการ Create ใหม่

SQL> grant sysdba to scott ; 
ORA-01994: GRANT failed: password file missing or disabled

รวมถึงจะไม่สามารถทำการ Remote Login ด้วย User ที่มี Privilege DBA ได้เช่นเดียวกัน

Configuration

  • ทำการ Connect Database ด้วย SQL*Plus

$
sqlplus / as sysdba
  • Check User in Password File

SQL>
select * from v$pwfile_users ;
USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
  • Create Password File

$
orapwd file=orapwORCL password=sys_password entries=3
  • Check User in Password File Again

SQL>
select * from v$pwfile_users ;
USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE
  • Grant SYSDBA to SCOTT

SQL>
grant sysdba to scott ;
  • Check User in Password File Again

SQL>
select * from v$pwfile_users ;
USERNAME                       SYSDB SYSOP SYSAS
------------------------------ ----- ----- -----
SYS                            TRUE  TRUE  FALSE
SCOTT                          TRUE  FALSE FALSE
  • Show Parameter Password

SQL>
show parameter password ;
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile            string      EXCLUSIVE

อ่านเพิ่มเติม : https://bit.ly/2XoFWMn

Last updated

Was this helpful?