If the password file format in the 12c databases is same with the format in the 11g databases, you receive the error “ORA-28017: The password file is in the legacy format” when attempting to change the password of a user in the password file.
1 2 3 4 5 |
SQL> alter user sys identified by "P@ssw0rd"; alter user sys identified by "P@ssw0rd" * ERROR at line 1: ORA-28017: The password file is in the legacy format. |
The format of the password file should be set to 12 or higher instead of LEGACY to avoid error.
Find Password File Format in Oracle
You can learn the format of the existing password file as follows.
1 2 3 |
[oracle@orcldb ~]$ cd $ORACLE_HOME/dbs [oracle@orcldb dbs]$ orapwd describe file=orapwORCL Password file Description : format=LEGACY |
To avoid the problem, either re-create or convert the password file.
How To Create Oracle Password File
1 |
orapwd file=orapwORCL entries=5 force=y password=welcome1 format=12 |
How To Change Oracle Password File Format
You can convert the password file to the new format as follows.
1 |
orapwd file=orapwORCL entries=5 force=y password=welcome1 format=12 input_file=orapwORCL |
The above commands should be executed under the $ORACLE_HOME/dbs directory, or the path must be specified exactly when specifying the file name. (Like $ORACLE_HOME/dbs/orapwORCL).
The format of the new password file should be as follows.
1 2 |
[oracle@orcldb dbs]$ orapwd describe file=orapwORCL Password file Description : format=12 |
Then you can change the password successfully.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[oracle@orcldb dbs]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Mon May 20 12:05:31 2019 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> alter user sys identified by "P@ssw0rd"; User altered. |
In RAC databases, the new password file created must be copied with the name it should be into the $ORACLE_HOME/dbs directory to other nodes.