Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to log in to database as SYS with Oracle SQL Developer

I've worked with Oracle for some time but very much a noob with the Admin side of things and am learning, so bear with me.

I cannot log on to my database (orcl_test) with SQL Developer with the SYS username. I can log on just fine in SQLPlus with SYS as SYSDBA - when I try with SQL Developer I get an error:
ORA-01017: invalid username/password; logon denied.

Logging on as SYS as SYSDBA in SQLPlus, I created a test table within the database and granted the test user SCOTT with SELECT permissions. The Scott user can log on through SQL Developer w/o problem and access the allowed tables.

I have checked that the Scott user and SYS are logging in using the same settings -
Hostname: (ip address)
Port: 1521
SID: orcl_test

For SYS I flag the role SYSDBA - but otherwise the settings are the same.

Any thoughts on why I can't log on using SYS? Am I just overlooking something or have I configured my db incorrectly?

Not sure if this is relevant but I cannot use 'localhost' for the hostname, I have to enter the IP address. Where do I configure Oracle to recognize localhost?

This is a new installation of Oracle 11.2.0.1.0 on a standalone test box running Windows XP. Running Oracle SQL Developer 1.5.5.

like image 892
owlie Avatar asked Feb 03 '12 13:02

owlie


3 Answers

If I understand correctly the database is on the same host as the SQL Developer installation? Are you fully qualifying the connection when testing with SQLPlus:

sqlplus "sys/password@database as sysdba"

It may be the case that the error is correct. Make sure you've created a password file.

like image 29
j.b. Avatar answered Sep 20 '22 18:09

j.b.


From the The SYSDBA System Privilege and (Logging In and Connecting to the Database as SYSDBA:

1--Connecting AS SYSDBA invokes the SYSDBA privilege. If you omit the AS SYSDBA clause when logging in as user SYS, the SQL Command Line rejects the login attempt.

2--Using SQL Developer, open a database connection to the SYS user AS SYSDBA.

So - if this works for you:

sqlplus sys/Oracle_1@pdborcl as sysdba;

Try: "SYS AS SYSDBA" as below:

enter image description here

Alternatively:

you can type in: "SYS" and select from dropdown-menu ROLE: SYSDBA.

enter image description here

like image 119
Witold Kaczurba Avatar answered Sep 23 '22 18:09

Witold Kaczurba


The sys password that you are using is not valid.

But because you are connecting to oracle by command on an Oracle machine, Oracle does not check your password even though your password is not right.

Just change the sys password and try again.

like image 34
mehdi Avatar answered Sep 22 '22 18:09

mehdi