Just Asking
Just Asking

Reputation: 13

SQL Developer 18.3: set alternative schema for individual connections automatically

I'm using several connections in SQL developer to connect to different Oracle databases. For some connections I have to change the schema to that of another user. This can be done is several ways

  1. By using: alter session set current_schema = <otheruser>; The drawback is that I have to enter this for every connection I want to open and with a different <otheruser> for each connection.

  2. Using the global connection startup script in Preferences > Database > Filename for connection startup script. The drawback of this method is that SQL Developer uses the same global startup script and runs it for every connection I open. Probably trying to set a non existing schema in most -but one- connections.

Is there a way to automatically set the default schema on connecting to a database for individual connections?

Connection Schema

A solution will be very helpful.

Upvotes: 1

Views: 541

Answers (1)

thatjeffsmith
thatjeffsmith

Reputation: 22427

No, that is not a feature. We assume when you define the connection, you are using the schema that you want to work with.

The tool is VERY connection driven - using alter session set current schema will work with queries you run in a SQL Worksheet, but won't have any effect for the rest of the tool, say browsing your tables in the Connection navigation tree.

Now, if you have PROXY connect privs, you could set up your connection to actually connect to your 'default' schema via proxy.

I show how here

Upvotes: 1

Related Questions