3

Is there a way to set the default schema for a Database connection in Oracle SQL Developer version 4+? I see this link for previous versions: http://www.javaforge.com/project/schemasel

...but I can't figure it out for Oracle SQL Developer version 4.

6
  • 1
    Why not just log in as that schema? Unless I'm missing something? Commented Feb 9, 2015 at 21:04
  • 1
    Sure, that sounds great - how do I do that? :) Commented Feb 10, 2015 at 2:38
  • 2
    This other post leads me to believe that this is not possible or is at least not straightforward: stackoverflow.com/questions/17407950/… Commented Feb 10, 2015 at 2:39
  • 1
    This is the basic tutorial on how to add a DB connection in SQL Dev. You can add many connections to a single database and then if you want to connect to say the HR schema you can only connect that one while not connecting to SCOTT. Commented Feb 10, 2015 at 12:13
  • 1
    Sure, but my question remains. I still need to know if/how I can set a default schema. Commented Mar 12, 2015 at 20:29

1 Answer 1

7

The way to do this at the tool level would be to run a session startup script.

  1. Create a text file 'logon.sql' with the script "alter session set current_schema = yourschema;"

  2. Save it anywhere - I recommend saving it somewhere in your database install location.

  3. In SQL Developer go to Tools -> Preferences -> Database Check the box for "Run connection startup script on each new database connection"

  4. Browse and select the above file.

That should make you default to that schema every time you login.

Sign up to request clarification or add additional context in comments.

1 Comment

This seems to be a global setting. It would be nice if you could do this with a particular connection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.