Friday, March 17, 2023

ORA-28017: The password file is in the legacy format.

 If you’ve ever encountered the ORA-28017: The password file is in the legacy format error, you know how frustrating it can be to solve. This Oracle database error occurs when a user attempts to connect using an old version of the Oracle Database that uses a pre-12c password file. In this blog post, we will discuss what this error means and provide steps for resolving it. 

The first step in resolving the ORA-28017: The Password File Is In Legacy Format Error is understanding why it occurred in the first place. As mentioned earlier, this issue typically arises when users attempt to connect with an older version of Oracle Database that uses a pre-12c password file format instead of its current 12c secure file format (also known as SYSKM). When attempting such connections with these outdated versions, they may encounter errors like “ORA 28017” or “Password File Is In Legacy Format". 

To resolve this issue quickly and easily without having to upgrade your entire system or reinstall software packages, we suggest following these steps : 

  1. Check if there are any existing legacy Password files on your server by running "ls -ltr" command which lists all files & directories present under the root directory. If yes, then delete them immediately using rm -rf command followed by the filename.
  2. Create new secure file-based passwords using "orapwd" utility provided by default within ORACLE_HOME/bin directory. Please refer to DOC ID 2112456 for more details about creating secure files based passwords & related troubleshooting tips.  


SQL> create user asmsnmp identified by <password>;

create user asmsnmp identified by <password>

*

Error at line 1:

ORA-28017: The password file is in the legacy format.

Check the output srvctl config ASM

[grid@sajidahmed ~]$ srvctl config ASM

ASM home: <CRS home>
Password file: orapwASM
Backup of Password file: <Location>
ASM listener: LISTENER
ASM instance count: 2
Cluster ASM listener: ASMNETLSNR

sqlplus / as sysasm


SQl> alter system flush passwordfile_metadata_cache;
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOPER SYSASM SYSBACKUP SYSDG SYSKM     CON_ID
--------------- -----   -----     -----   -----   -----   ---
SYS          TRUE  TRUE  FALSE FALSE FALSE FALSE          0


Now create the asmsnmp user and grant it privileges, this issue will be resolved.

[grid@sajidahmed ~]$ asmcmd orapwusr --add ASMSNMP

Enter Password: *************

[grid@sajidahmed ~]$ asmcmd orapwusr --grant sysasm ASMSNMP

[grid@sajidahmed ~]$ sqlplus asmsnmp/<password> as sysasm
SQL*Plus: Release 19.0.0.0.0 - test on Fri Mar 17 13:31:06 2023
Version 19.18.0.0.0
Copyright (c) 1982, 2022, Oracle.  All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
SQL> show user;
USER is "ASMSNMP"


By following these simple steps above, one should be able to resolve their issues related to "ORA 28017: The Password File Is In Legacy Format" errors very quickly without much effort!


No comments:

Post a Comment