I would like to know, if it's possible to connect to different database instance from the current logged in database SQL worksheet on SQL Developer? If so, please tell me what commands i should be using.
I opened a SQL Worksheet connecting to DEV Instance and now I want to connect to PROD instance from the same SQL Worksheet.
Just right-click Connections, choose "[plus] New Connection" ... then fill in the information and test it.
(I have 6 DBs ... I have a connect to all of them, plus a few several times, as different users / schemas, for link-testing purposes ... you can then export the connections as an XML file ... share that with others (who then import it))
Or just use the connection dropdown in the upper right hand corner of the worksheet to change the connection.
I originally read the question as they were looking for a way to programmatically change the connection vs UI.
Thanks for your replies.
I have already added them as new connection, but i don't want to take that route of clicking on the connection instance and opening a new sql worksheet after successful connection; rather i would prefer accessing all the instances from the same sql worksheet which how i used to do it on SQL*PLUS.
I tried executing the following command on sql worksheet: sqlplus connect username/password@instance
but it ain't working.
The connection dropdown property will change the connection for the current worksheet, no new worksheet is opened.
If you're going to run a SQL*Plus command, just type the command, no need to add the 'sqlplus' bit.
It's not an issue if you're happy to be living in the year 2006 :)
The latest and greatest version of SQL Developer is 3.2.20_09 and we didn't add support for CONNECT in the worksheet until way after 1.5