오라클 18c ORA-01017 - olakeul 18c ORA-01017

Your connection with sqlplus is utilizing os credentials, and is not even checking the username and password. The fact that you are requesting a connection 'as sysdba' tells oracle to see if the requesting OS user is a member of the os group DBA. If it is, let 'm in.

[oracle@vbol83-01 ~]$ sqlplus fubar/thisiswrong as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 24 08:31:50 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL>

In fact, you don't even need a username/password at all for this connection:

[oracle@vbol83-01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 24 08:34:11 2022
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

On the other hand, your SQL Dev connection is going across the network, and requires the credentials that are presented match what is in the oracle password file.

I don't know what your system looked like "months ago", or what you might have been doing differently then.

ORA-01017: invalid username/password; logon denied
Cause: An invalid username or password was entered in an attempt to log on to Oracle. The username and password must be the same as was specified in a GRANT CONNECT statement. If the username and password are entered together, the format is: username/password.
Action: Enter a valid username and password combination in the correct format.

Example:

C:\>sqlplus scott/tigerr@orcl
SQL*Plus: Release 11.2.0.3.0 Production on Sun Jun 7 16:26:19 2015
Copyright (c) 1982, 2011, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied

Enter user-name:

ORA-01017 is a very common error which we get while connection to Oracle Database, Other than invalid Username/Password, it can be encountered dute to improper connect string, permissions isues or wrong configuration of tnsnames.ora or sqlnet.ora.

Once we get ORA-01017 and we are sure that our username or password was correct, we can perform following tasks to debug the issues.

1) If connecting to Oracle 11 or later, passwords can be configured as case sensitive. To check this configuration, run following by SYS/SYSTEM user

SQL> show parameter SEC_CASE_SENSITIVE_LOGON
NAME                           TYPE      VALUE
------------------------------ --------- ------------
sec_case_sensitive_logon       boolean   TRUE

You can change this configuration and alter password of user and try to connect

SQL> ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;
System altered.

SQL> alter user scott identified by <password>;
User Altered.

SQL> CONN scott/<password>
Connected.

To read more about Oracle Case Sensitive Passwords, click here.

2) Check $ORACLE_SID and $ORACLE_HOME environmental variables to validate if we are trying to connect the right database.

3) Check TNSNAMES.ORA to validate that TNS-Alias we are using to connect Oracle Database is pointing to right Database Server and Instance.

4) Check is the user we are trying to connect exists on that instance. Run following by SYS/SYSTEM user

SQL> SELECT username FROM dba_users where username='SCOTT';
USERNAME
------------------------------
SCOTT

Related Posts:
- Oracle Default Username and Password
- How to connect sqlplus without tnsnames.ora
- SQLNET: How does Oracle Client connect with Oracle Server
- How to configure Case Sensitive Password in Oracle
- ORA-28002: the password will expire within 7 days
- ORA-03135: connection lost contact
- ORA-01034: ORACLE not available

 

오라클 18c ORA-01017 - olakeul 18c ORA-01017
 

Oracle Database Tips by Donald Burleson

Question:  I get the following ORA-01017 error when attempting to connect using a database link:

ORA-01017: invalid username/password; logon denied

How do I resolve the ORA-01017 error?

Answer: The docs note that the ORA-01017 can have a variety of causes most relating to permissions (grant), tnsnames.ora, sqlnet.ora configuration, or improper connect string syntax.

In Oracle 12c, see bug 16385258 for the ORA-01017 error on multi-tenant databases.

An oerr search yields the following information.  Also, see my notes on diagnosing Oracle network connection issues:

ORA-01017: invalid username/password; logon denied

Cause: An invalid username or password was entered in an attempt to log on to Oracle. The username and password must be the same as was specified in a GRANT CONNECT statement. If the username and password are entered together, the format is: username/password.

Action: Enter a valid username and password combination in the correct format.

Checklist for ORA-01017 errors:

The core issue with an ORA-01017 error is an invalid user ID and passwords combination, but other than an incorrect password, there are user ID issues that may contribute to the ORA-01017 error:

  • It may be that the user ID is invalid for the target system - The user ID exists as the username column in the dba_users view.  select username from dba_users;

  • Check your $ORACLE_SID environmental parameter.  If your $ORACLE_SID is set to the wrong system ID then you may get a ORA-01017 error because you are connecting to the wrong database.

  • If using external OS user authentication (ops$ or remote_os_authent) you need to verify that the user ID is valid.  You can tell if you are using external authentication because you connect without providing a user/password combination, and only provide a forward slash to the connect string, (e.g. connect / as sysdba;).   

  • Check your tnsnames.ora to ensure that the TNS service name points to the correct server and instance name.  If you specify an incorrect tnsnames.ora service name, then the user ID and password may not exist in that database.

Reader Comments:

Thomas writes:

Your oracle dba pages offer plenty of useful informations for us, so first:
Thank you for this service.

While digging for a solution for one of our daily problems, I got to the pages for ORA-01017.

Now I want to propose a little addition to it:

Since Oracle 11 (or was it even 10?), user names and passwords are case sensitive. If you don't respect that in scripts or other sql statements, this can also lead to ORA-01017, simply because there is a mismatch in case for a user "demo" or "DEMO". And depending on tools (sql developer or others), things might still work, or not.

So you could add a little note about that new "feature" in the causes of ORA-01017, because these cases are even harder to resolve than the others. If a user doesn't exist at all or you try to connect to the wrong db, you might find out quickly. But if the user exists, just not in the right case, but scripts don't work anymore, you might end head-banging in frustration.

Matt writes:

I wanted to let you know about another instance where I got an ORA-01017 error and banged my head against the wall for a little bit before figuring it out.

A vendor product had shipped with ojdbc14.jar.  The product needed to run a small java main against the DB to set up some tables.  I was using a 1.6 JRE.

The error I got was an ORA-01017.

Only after I replaced the jar with ojdbc6.jar and fix the vendor wrapper script to reference this new jar did it work.

Odd getting an "invalid password" because of an incompatible java version, but thought it might help someone.

 

오라클 18c ORA-01017 - olakeul 18c ORA-01017
If you like Oracle tuning, see the book "Oracle Tuning: The Definitive Reference", with 950 pages of tuning tips and scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


오라클 18c ORA-01017 - olakeul 18c ORA-01017