Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

What is the difference between the two :

SQLPLUS / AS SYSDBA

and

SQLPLUS
Enter user-name: SYSDBA
Enter password:

If I use the first command I get connected and see the prompt SQL> but upon using the second command I always get ORA-01017: invalid username/password; logon denied , when I enter the correct password. Why is this ?

Also how do I get connected as the SYSDBA using the first command , when I didn't enter any password.

I am using Oracle Database 11g Express Edition Release 11.2.0.2.0

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

SYSDBA is a role. When you connect using that role you're effectively connecting as the user SYS (say show user in SQL*Plus). As @A.B.Cade already said you're using external authentication (OS in this case), but if you want to connect remotely over network you're required to provide username and password (unless account is configured to use remote OS authentication), e. g. sqlplus sys/password@orcl as sysdba.

You may also grant other users the SYSDBA privilege:

sql> GRANT SYSDBA to SCOTT;

This way user SCOTT is able to connect to database with SYS privileges:

[spongebob@example]$ echo "show user" | sqlplus -S scott/password as sysdba
USER is "SYS"
share|improve this answer
add comment

SYSDBA isn't a user but a way to connect to the DB.

Connecting as sysdba is based on the OS authentication which means that as long as you connect to your machine with a user which is in the oradba group you will be connected with this user AS SYSDBA no metter what user/password you'll write (as long as you try to connect as sysdba of course)

Read more in this Tom Kyte's thread

So, this-

SQLPLUS / AS SYSDBA

and this

SQLPLUS a/b AS SYSDBA

and even this

SQLPLUS
Enter user-name: as SYSDBA
Enter user-name: a
Enter password: b

Are pretty much the same

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.