Thursday, March 14, 2013

Make sure you are connected to the correct Oracle database with SqlPlus

Using Oracle11g, you may find yourself in a situation where you are sure that you created a user, but when you try to connect you receive an ORA-01017: invalid username/password; logon denied.

Sometimes this is due to a log string like this:

sqlplus SYS as SYSDBA/pass@db

which seems valid. It prompts you for a password and then proceeds as normal. However, this syntax is not valid. Instead of warning you, it will connect to the default database! Any user you then create will not be in the right database. The correct syntax is:


sqlplus SYS@db/pass as SYSDBA


or like this without a password:

sqlplus SYS@db as SYSDBA


Check what you are connected to:

select name from v$database;

No comments:

Post a Comment