Blog / Database Blog

Orapwd Tool For Password File In Oracle

Orapwd Tool For Password File In Oracle

orapwd tool is used to create and manage password files.

DEFAULT LOCATION FOR PWD FILE – $ORACLE_HOME/dbs

Usage: orapwd file= entries= force=<y/n> asm=<y/n>
dbuniquename= format=<legacy/12> sysbackup=<y/n> sysdg=<y/n>
syskm=<y/n> delete=<y/n> input_file=

Usage: orapwd describe file=

where
file – name of password file (required),
password – password for SYS will be prompted
if not specified at command line.
Ignored, if input_file is specified,
entries – maximum number of distinct DBA (optional),
force – whether to overwrite existing file (optional),
asm – indicates that the password to be stored in
Automatic Storage Management (ASM) disk group
is an ASM password. (optional).
dbuniquename – unique database name used to identify database
password files residing in ASM diskgroup only.
Ignored when asm option is specified (optional),
format – use format=12 for new 12c features like SYSBACKUP, SYSDG and
SYSKM support, longer identifiers, etc.
If not specified, format=12 is default (optional),
delete – drops a password file. Must specify ‘asm’,
‘dbuniquename’ or ‘file’. If ‘file’ is specified,
the file must be located on an ASM diskgroup (optional),
sysbackup – create SYSBACKUP entry (optional and requires the
12 format). Ignored, if input_file is specified,
sysdg – create SYSDG entry (optional and requires the 12 format),
Ignored, if input_file is specified,
syskm – create SYSKM entry (optional and requires the 12 format),
Ignored, if input_file is specified,
input_file – name of input password file, from where old user
entries will be migrated (optional),
describe – describes the properties of specified password file
(required).

There must be no spaces around the equal-to (=) character.

Create a password file for standalone database .
cd $ORACLE_HOME/dbs

orapwd file=orapwORCL password=oracle force=y

Create a password file in ASM diskgroup:

orapwd file=’+DATA/orapwORCL’ ENTRIES=10 DBUNIQUENAME=’ORCL’

Create password file from asmcmd tool:(Oracle 12c onwards)

ASMCMD> pwcreate –dbuniquename ORCL +DATA/PWDFILE/pwdORCL oracle

We can view users authenticated through password file in v$pwfile_users table

SQL> select username,sysdba from v$pwfile_users;

USERNAME SYSDB
——— —–
SYS TRUE

Related blogs