ORA-01994: GRANT failed: password file missing or disabled

ORA-Errors

I am attempting to add an entry to my orapwd file and I get this error:

SQL> grant sysdba to scott;
grant sysdba to scott
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled

Cause The operation failed either because the INIT.ORA parameter REMOTE_LOGIN_PASSWORDFILE was set to NONE or else because the password file was missing.

1) Check remote_login_passwordfile value
SQL> show parameter REMOTE_LOGIN_PASSWORDFILE;

NAME TYPE VALUE


remote_login_passwordfile string NONE

2) Change the exclusive remote_login_passwordfile mode not to exclusive .This statics parameter
SQL> alter system set remote_login_passwordfile =exclusive scope=spfile;

System altered.
to implement the changes you need to restart the database

SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 603979776 bytes
Fixed Size 1250380 bytes
Variable Size 184552372 bytes
Database Buffers 411041792 bytes
Redo Buffers 7135232 bytes
Database mounted.
Database opened.

SQL> show parameter REMOTE_LOGIN_PASSWORDFILE;

NAME TYPE VALUE


remote_login_passwordfile string EXCLUSIVE

now grant the sysdba privelages to user
SQL> grant sysdba to scott;

Grant succeeded.

You can caheck which user have sysdba privelages tou can find using query

SQL> SELECT USERNAME FROM V$PWFILE_USERS WHERE USERNAME != ‘SYS’ AND SYSDBA=’TRUE’;

USERNAME

SCOTT

2) if password file is missing then you need to creaet new password file using blow command
C:\Documents and Settings\vanita.sharma>orapwd FILE=C:\ORACLE\product\10.2.0\db_1\database\pwdorcl.ora password=pass ENTRIES=50 FORCE=y