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.

Can anyone tell me in detail,what is the difference between sqlplus sys/ as sysdba and sqlplus sys@xe as sysdba?For the records the database is installed on the same machine as the client.

share|improve this question

migrated from serverfault.com Jan 30 '13 at 19:49

This question came from our site for system and network administrators.

    
One conn goes through the listener, the other doesn't and attaches directly. –  Phil Jan 30 '13 at 19:51

2 Answers 2

sqlplus sys/ as sysdba connects directly to the database without using networking (TNS. This type of connection is called a bequeath connection.

sqlplus sys@xe as sysdba connects through the listener.

share|improve this answer

@xe defines the database where you are connecting to. Since it in your case seems to be the same as without defining it specifically, it points the connection to this same database.

No difference in privileges etc.

So, in practice, there is no difference in the result in your case.

share|improve this answer
2  
Incorrect. @xe forces the connection through the listener. / as sysdba doesn't require a listener as it connects directly. –  Phil Jan 30 '13 at 20:51
    
Since the connection ends up to same database with same privileges, I believe that making a quick jump at the listener is not that relevant for the asker. –  grassroot Jan 30 '13 at 21:02
    
It does make a difference. You can't connect to an idle instance through the listener. This is needed e.g. in order to startup or shutdown the instance. –  a_horse_with_no_name Jan 30 '13 at 22:49

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.