How to solve ORA-01017: Invalid username/password; logon denied

I was trying to connect to a database today when I found this:

ORA-01017

I think there could be a lot of reasons for this, but the easiest approach is to reset the user’s password, that is if the user exists of course. Here is the solution:

  1. Connect as sysdba to the database
    C:\Users\hecperez>sqlplus / as sysdba
  2. Run the following query to check if the user is in the database
    SQL> select username from dba_users;
    USERNAME
    ------------------------------
    HR
    ANONYMOUS
    APEX_040000
    FLOWS_FILES
    XDB
    CTXSYS
    MDSYS
    SYSTEM
    SYS
    Stacey_G
    Macey_M
    
    USERNAME
    ------------------------------
    Siry_M
    user_name
    APEX_PUBLIC_USER
    XS$NULL
    OUTLN
    
    16 rows selected.
  3. If it is then run the following query to set a new password for the user
    ALTER USER user_name IDENTIFIED BY password;
    User altered.

That’s it!, I just reset the password for the user. Remember that all the text in Italics represents variables and should be replaced with your own values.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: