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

3.7K    Asked by ai_7420 in SQL Server , Asked on Oct 4, 2022

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?


Answered by Akansha Chawla

In case of - ora 01017 invalid username password logon denied


Seems simply a password issue. Different instances may have different passwords, the SYS password is not necessarily the same for all the instances on the same server. Make sure remote_login_passwordfile is configured properly in the instances, and the password file exists for instance SID1 on the server in ORACLE_HOME/dbs/orapwSID1 (Linux-Unix) or ORACLE_HOME/database/pwdSID1.ora (Windows).

If you do not know the correct SYS password, you can recreate the password file, for example:

orapwd file=$ORACLE_HOME/dbs/orapwsid1 password=xxxx force=y

Your Answer

Answers (2)

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;
2 Days

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.

9 Months

Interviews

Parent Categories