How to Fix ORA-01017: invalid username/password; logon denied
When you’re working with Oracle Recovery Manager (RMAN) and encounter the error:
ORA-01017: invalid username/password; logon denied
you may immediately assume that it’s an issue with the username or password. While this is often the case, there’s also a possibility that the problem lies elsewhere, specifically with your connection string or TNS entry.
Let’s walk through what this error means and how to fix it.
Understanding the Error
The ORA-01017 error generally occurs when RMAN (or Oracle) cannot authenticate the provided credentials. It might seem like a simple case of entering the wrong password or username, but sometimes the issue is more complex.
In the example message above, RMAN encounters the error after failing to connect to the target database:
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-01017: invalid username/password; logon denied
The key takeaway here is that the issue might not always be about incorrect credentials.
The Real Culprit: Connection String
In some instances, the error is caused by an incorrect connection string or TNS entry. The credentials might be correct, but if the connection string isn’t properly configured, Oracle won’t be able to establish the connection, leading to an “invalid username/password” error.
For example, this connection string might fail:
rman target sys/somepassword@"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac01.testserver.com)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=TESTDB)))"
The Fix: Add INSTANCE_NAME
Sometimes, the issue can be solved by simply modifying the connection string. If you include the INSTANCE_NAME
parameter, Oracle may be able to resolve the connection properly. Here’s an updated connection string:
rman target sys/somepassword@"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac01.testserver.com)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=TESTDB)(INSTANCE_NAME=TESTDB1)))"
Notice the addition of the INSTANCE_NAME
parameter within the CONNECT_DATA
section. This small change can make a big difference in fixing the issue.
Conclusion
While the ORA-01017 error usually points to issues with credentials, always consider verifying the connection string or TNS entry. Modifying the connection string to include the INSTANCE_NAME might be all you need to resolve the issue and successfully connect to your Oracle database using RMAN.