9 Replies Latest reply: May 6, 2014 5:58 AM by makel RSS

    Run a script on an unshared connection

    makel

      I can't find a way to run a script with an unshared connection - can anyone advise?  My original connection is busy running a query, but I can't see my unshared connection in the dropdown at the top of the script's window.  (When I say script I mean a SQL file opened from the file system).

        • 1. Re: Run a script on an unshared connection
          Jeff Smith Sqldev Pm-Oracle

          My previous answer was less than correct. As in, I was wrong.

           

          To do this, you have two options:

           

          1. open unshared worksheet, copy and paste your script in and execute
          2. open unshared worksheet, reference file with @filename.sql and execute
          • 2. Re: Run a script on an unshared connection
            makel

            Thanks - I am on v4.  But when I open a script it opens in a new window with no connection.  Is there some other preference I need to find?

            • 3. Re: Run a script on an unshared connection
              Gary Graham-Oracle

              The two preferences in Database >  Worksheet that control this behavior are:

              1. Open a Worksheet on connect

              2. New Worksheet to use unshared connection

              So if Open a Worksheet on connect is enabled (the default setting), then that first worksheet shares the Connections navigator view connection.  Disabling it will make any New Worksheet connections unshared.

               

              It is true, however, that if you open a SQL file, then there is currently no way to connect in any mode but shared.

               

              Regards,

              Gary

              SQL Developer Team

                

              • 4. Re: Run a script on an unshared connection
                SchemaCzar

                You NEED to fix this.

                 

                - Andrew Wolfe

                • 5. Re: Run a script on an unshared connection
                  Jeff Smith Sqldev Pm-Oracle

                  If you want to run a script on a separate connection, you can create another connection on the tree.

                  • 6. Re: Run a script on an unshared connection
                    makel

                    That is a workaround but, come on SQL Dev team - you're better than that aren't you?

                     

                    Instead of having us manually create and manage all those duplicate connections, could you enhance the tree so that we can see all connections (shared or unshared)?  One of the problems with unshared connections is their invisibility - this would let us disconnect, reconnect, etc. as well.

                    • 7. Re: Run a script on an unshared connection
                      Jeff Smith Sqldev Pm-Oracle

                      If a connection is unshared...that is, you open it on a worksheet, then why would you want it on a tree? to assign it to another window, in which case it's not unshared anymore?

                      • 8. Re: Run a script on an unshared connection
                        SchemaCzar

                        I think what Makel is saying (shades of The Right Stuff) is that he wants a list of the open sessions, that is, live connections to the database.

                         

                        I completely agree that it would be great to be able to manage the separate sessions/connections that are actively working with a particular database definition.  It's been a notion of mine but I hadn't seen it to +1 it before.

                         

                        I was a little thrown by the 'put it in the tree' idea.  However, what I think he means is that you would have the tree of "static connections" and in addition to (or instead of) the little connection indicator plug, there would be a sort of pop-up identifying the live sessions attached to that particular database using that particular set of credentials.

                         

                        I'm not really hot on the tree myself, so I don't really think about expanding its work.

                         

                        - Andrew Wolfe

                        • 9. Re: Run a script on an unshared connection
                          makel

                          Thanks for interpreting Andrew!

                           

                          Putting it differently, I don't have a need for shared or unshared connections - all I need is connections that I can use as I see fit. 

                           

                          I want to be able to pick a connection when I open a script file.  If the connection has been disconnected, I'd like to be able to reconnect it.  If I've been working in a live database, I want to be able to see all my connections and make sure they're disconnected when I'm done.

                           

                          I don't want to be blocked - either by the tree querying the data dictionary, or by the query I ran in my first worksheet.

                           

                          I think I'm suggesting that you change the top-level entity from "connection" to "database".  If I look at Database1, there should be a node in the tree that shows an entry for each of my connections.  Maybe in v5?