Orapwd Utility
Orapwd Utility
Orapwd Utility
REMOTE_LOGIN_PASSWORDFILE
A SHARED password file cannot be modified i.e. you cannot add users to a SHARED
password file. Any attempt to do so or to change the password of SYS or other users with
the SYSDBA or SYSOPER or SYSASM (this is from Oracle 11g) privileges generates an error.
All users needing SYSDBA or SYSOPER or SYSASM system privileges must be added to the
password file when REMOTE_LOGIN_PASSWORDFILE is set to EXCLUSIVE. After all users
are added, you can change REMOTE_LOGIN_PASSWORDFILE to SHARED.
This option is useful if you are administering multiple databases or a RAC database.
If a password file is SHARED or EXCLUSIVE is also stored in the password file. After its
creation, the state is SHARED. The state can be changed by setting
REMOTE_LOGIN_PASSWORDFILE and starting the database i.e. the database overwrites the
state in the password file when it is started up.
ORAPWD
You can create a password file using orapwd utility. For some Operating systems, you can
create this file as part of standard installation.
Users are added to the password file when they are granted the SYSDBA or SYSOPER or
SYSASM privilege.
The Oracle orapwd utility assists the DBA while granting SYSDBA, SYSOPER and SYSASM
privileges to other users. By default, SYS is the only user that has SYSDBA and SYSOPER
privileges. Creating a password file, via orapwd, enables remote users to connect with
administrative privileges.
$ orapwd file=password_file_name [password=the_password] [entries=n] [force=Y|N]
[ignorecase=Y|N] [nosysdba=Y|N]
Examples:
$ orapwd file=orapwSID password=sys_password force=y nosysdba=y
$ orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password=secret
$ orapwd file=orapwprod entries=30 force=y
C:\orapwd file=%ORACLE_HOME%\database\PWD%ORACLE_SID%.ora password=2012
entries=20
C:\orapwd file=D:\oracle11g\product\11.1.0\db_1\database\pwdsfs.ora password=id
entries=6 force=y
$ orapwd file=orapwPRODB3 password=abc123 entries=10 ignorecase=n
$ orapwd file=orapwprodb password=oracle1 ignorecase=y
There are no spaces permitted around the equal-to (=).
The following describe the orapwd command line arguments.
FILE
Name to assign to the password file, which will hold the password information. You must
supply complete path. If you supply only filename, the file is written to the current directory.
The contents are encrypted and are unreadable. This argument is mandatory.
The filenames allowed for the password file are OS specific. Some operating systems require
the password file to adhere to a specific format and be located in a specific directory. Other
operating systems allow the use of environment variables to specify the name and location
of the password file.
If you are running multiple instances of Oracle Database using Oracle Real Application
Clusters (RAC), the environment variable for each instance should point to the same
password file.
It is critically important to secure password file.
PASSWORD
This is the password the privileged users should enter while connecting as SYSDBA or
SYSOPER or SYSASM.
ENTRIES
Entries specify the maximum number of distinct SYSDBA, SYSOPER and SYSASM users that
can be stored in the password file.
This argument specifies the number of entries that you require the password file to accept.
The actual number of allowable entries can be higher than the number of users, because
the orapwd utility continues to assign password entries until an OS block is filled. For
example, if your OS block size is 512 bytes, it holds four password entries. The number of
password entries allocated is always a multiple of four.
Entries can be reused as users are added to and removed from the password file. When you
exceed the allocated number of password entries, you must create a new password file. To
avoid this necessity, allocate a number of entries that is larger than you think you will ever
need.
FORCE
(Optional) If Y, permits overwriting an existing password file. An error will be returned if
password file of the same name already exists and this argument is omitted or set to N.
IGNORECASE
(Optional) If Y, passwords are treated as case-insensitive i.e. case is ignored when
comparing the password that the user supplies during login with the password in the
password file.
NOSYSDBA
(Optional) For Oracle Data Vault installations.
Column
Description
If the value of this column is TRUE, then the user can log on
with SYSDBA system privilege.
SYSOPER
If the value of this column is TRUE, then the user can log on
with SYSOPER system privilege.
SYSASM
If the value of this column is TRUE, then the user can log on
with SYSASM system privilege.
If orapwd has not yet been executed or password file is not available, attempting to grant
SYSDBA or SYSOPER or SYSASM privileges will result in the following error:
SQL> grant sysdba to satya;
ORA-01994: GRANT failed: cannot add users to public password file
If your server is using an EXCLUSIVE password file, use the GRANT statement to grant the
SYSDBA or SYSOPER or SYSASM system privilege to a user, as shown in the following
example:
SQL> grant sysdba to satya;
SQL> select * from v$pwfile_users;
USERNAME SYSDBA SYSOPER SYSASM
-------- ------ ------- -----SYS TRUE TRUE FALSE
SATYA TRUE FALSE FALSE
SQL> grant sysoper to satya;
SQL> select * from v$pwfile_users;
USERNAME SYSDBA SYSOPER SYSASM
-------- ------ ------- -----SYS TRUE TRUE FALSE
SATYA TRUE TRUE FALSE
SQL> grant sysasm to satya;
SQL> select * from v$pwfile_users;
USERNAME SYSDBA SYSOPER SYSASM
-------- ------ ------- -----SYS TRUE TRUE FALSE
SATYA TRUE TRUE TRUE
When you grant SYSDBA or SYSOPER or SYSASM privileges to a user, that user's name and
privilege information are added to the password file. If the server does not have an
If you determine that you no longer require a password file to authenticate users, you can
delete the password file and then optionally reset the REMOTE_LOGIN_PASSWORDFILE
initialization parameter to NONE. After you remove this file, only those users who can be
authenticated by the OS can perform SYSDBA or SYSOPER or SYSASM database
administration operations.