I have exam question and can’t find answer. Why sid is mandatory required to perform KILL SESSION command?
KILL SESSION syntax: ALTER SYSTEM KILL SESSION 'sid,session#[@inst_id]' [IMMEDIATE];
Where sid is a ‘unique’ session identifier. Unique in quotes because it is unique in current moment, Oracle server can have, for example, session some sid, but after this session is over, this sid can be used for other session. Sid is analogy pid in OS.
Session# is a serial session number; it is a session counter. Server clear the counter at DB startup. So, session# is a really unique identifier for session.
I don’t understand why sid is mandatory for KILL SESSION command. I think, it is possible to use session# only.
Thanks.
I found it! Sequence for
serial#is cyclic. Numbers will be reused after 2 billions logins ifintused, or after 32k ifshortused. So, usingserial#without anything else doesn’t provide really unique enumerating.But
sidis unique at a moment. So, pairsid,serial#is really unique.You can’t use
serial#orsidto manage sessions, you should use it in a pair.Thank you for your time!