Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

What should I do - ora 01017 invalid username password logon denied

Asked by Ai Oct 4, 2022 5.2K views 3 answers
Share

About this question

I'm trying to connect to a remote instance as sysdba - however, I encounter the error: "ORA-01017: invalid username/password; logon denied".


$ sqlplus "sys/xxxx@:1521/sid1 as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 29 04:07:34 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
When I try to connect to another instance on the same server, I can get through:
$ sqlplus "sys/xxxx@:1521/sid2 as sysdba"
SQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 29 04:07:23 2015
Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
Can someone point me to what I may have missed here?


Your answer

3 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on Feb 21, 2025

The ORA-01017: invalid username/password; logon denied error in Oracle occurs when the provided credentials are incorrect or the authentication method is misconfigured. Here’s how to troubleshoot and fix it:

1. Check Username and Password

Ensure you are using the correct username and password.

Oracle usernames and passwords are case-sensitive in Oracle 11g and later.

  CONNECT username/password@db_service;

If unsure about the credentials, reset the password:

  ALTER USER username IDENTIFIED BY new_password;

2. Verify Database Connection Details

Ensure the TNS entry in tnsnames.ora is correct.

Test the connection using:

  tnsping db_service

3. Use the Correct Authentication Method

If using OS authentication, connect with:

  sqlplus / as sysdba

If logging in remotely, ensure remote authentication is enabled in sqlnet.ora:

  SQLNET.AUTHENTICATION_SERVICES = (NONE)

4. Check Oracle Profile Settings

The user may be locked or expired. Check with:

  SELECT username, account_status FROM dba_users WHERE username = 'YOUR_USER';

If locked, unlock the account:

  ALTER USER username ACCOUNT UNLOCK;

5. Ensure Proper Role Permissions

If using a pluggable database (PDB) in Oracle 12c+, specify the correct service:

  sqlplus username/password@//hostname:port/service_name

6. Restart the Database (If Necessary)

If credentials are correct but login still fails, try restarting the database:

  shutdown immediate;startup;
Was this helpful?

Ranjana Admin JanBask Expert

Answered on May 2, 2024

The ORA-01017 error in Oracle indicates that the provided username and/or password is invalid, and the login attempt has been denied. Here's what you should do to address this issue:


Verify Username and Password: Double-check the username and password you are using to log in. Ensure there are no typos or mistakes in the credentials. Remember that Oracle usernames and passwords are case-sensitive.

Reset Password: If you suspect that the password might be incorrect or if you've forgotten it, consider resetting the password for the user. Depending on your setup and permissions, you may need assistance from a database administrator (DBA) to reset the password.

Unlock the Account (if necessary): Sometimes, an account may become locked due to multiple failed login attempts. If you suspect this is the case, you can ask your DBA to unlock the account.

Check Account Status: Ensure that the user account you are trying to log in with is active and not expired. If the account has expired or is locked, you may need administrative privileges to rectify the situation.

Review Connection Configuration: If you're connecting through a client application or script, review the connection configuration to ensure it's pointing to the correct database instance and using the correct authentication method.

Check for Case Sensitivity: Remember that Oracle usernames and passwords are case-sensitive. Make sure you're entering the username and password exactly as they were created.

Check for Database Connectivity Issues: Ensure that there are no network or firewall issues preventing your client from connecting to the Oracle database.

Review Audit Logs: If necessary, review the Oracle audit logs to see if there are any additional details or errors that could provide insight into why the login attempt is failing.

Contact Database Administrator: If you've exhausted all other options and are still unable to resolve the issue, contact your database administrator or Oracle support for further assistance. They may be able to provide additional troubleshooting steps or reset the account if needed.

By following these steps, you should be able to diagnose and resolve the ORA-01017 error and successfully log in to the Oracle database.

Was this helpful?

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.