4 Replies Latest reply on Dec 5, 2016 11:36 PM by thatJeffSmith-Oracle

    See my sid and session

    Shadow123

      Hi All

      Is that possible that whenever I open sql developer then I can see my sid and session ?. Thanks in advance

        • 1. Re: See my sid and session
          thatJeffSmith-Oracle

          SID - yes.

           

          SESSION - not sure what you mean by that. Have you looked at Tools > Monitor sessions?

           

          But one way to approach this is with a LOGIN.SQL script.

           

          SET SERVEROUTPUT ON

           

          DECLARE

          id integer;

           

          BEGIN

          SELECT SYS_CONTEXT ('USERENV', 'SID') into id

             FROM DUAL;

          dbms_output.put_line('My Session ID is ' || id || '.');

          end;

           

          Save this to a file.

           

          Tools > preferences > Database > filename for connection startup script.

           

          Connect, voila.

           

          session_id.png

          • 2. Re: See my sid and session

            Is that possible that whenever I open sql developer then I can see my sid and session ?

            Explain what you mean.

             

            There is no 'sid' or 'session' until you actually connect to a database. And then it will depend on what database you connect to.

             

            So - no - it is NOT possible to display sid or session just because you launched sql developer until a connection is actually opened.

             

            Even then if you have three connections opened what sid/session do you want to see and where?

            • 3. Re: See my sid and session
              Shadow123

              Thanks for the reply, Actually I mean to say whenever I open any connection in SQL Developer then I can see my SID and Session for that specific connection.

              • 4. Re: See my sid and session
                thatJeffSmith-Oracle

                what do you mean by 'session?' See my previous reply for A way to do it for SID.