Search notes:

Oracle Session

Identification of sessions

Each session is uniquely identified by a combination of two numbers: a (session) id (SID) and a serial number.
See also Identification of one's session

Terminating sessions

Terminating sessions with alter system.
The PL/SQL procedure KILL_MY_SESSION can be used to terminate a session.
Alternatively, on Windows, there is also the orakill utility.
The current session can also be terminated like so
SQL> alter session set events 'immediate crash';
…
ORA-03113: end-of-file on communication channel
…
SQL> select * from dual;
…
ORA-03114: not connected to ORACLE
See also

TODO

Find memory hungry sessions

select
   sid,
   name,
   value
from
   v$statname n                                  join
   v$sesstat  s on n.statistic# = s.statistic#
where
   name like 'session%memory%'
order by
   value desc;

See also

Information, data and metadata that is shared among sessions is stored in the Shared Pool (metadata) and buffer cache (data)
System privileges and roles that are enabled in the current session can be queried frmo session_roles and session_privs.
The SQL noun session.
The SQL*Plus command connect disconnects the current session and starts a new one.
v$session shows all sessions.
v$session_wait shows what each session is waiting for.
v$mystat records statistical data about the session that accesses it.
Similarly, v$sesstat provides these statics for all current session.
x$ksuse
Active Session History
sys_context('sys_session_roles', role_name) allows to determine if a given role is enabled in a session.
The functions current_session_id and current_session_serial in dbms_debug_jdwp provide a session's id (SID) and serial#.
dbms_session
dbms_pipe allows two or more sessions to communicate with each other.
dbms_system allows to modify parameters and diagnostic events in other sessions.
dbms_transaction.local_transaction_id returns the transaction ID of the current session.
Resources that are shared among sessions are protected by latches from being corrupted.
v$sess_time_model reports accumulated times for various categories of waiting operations.
The init parameter session_cached_cursors controls the number of cursors to cache in a session.
A session is associated with a time zone, see the function sessiontimezone and alter session set time_zone.
The maximum number of active sessions seen in the system is recorded in dba_high_water_mark_statistics.
v$context lists the attributes that are set in the current session. Compare with DBA_CONTEXT.
The SES PL/SQL package
Private temporary tables are stored in memory and exist no longer than the session in which they were created.
Other temporary data which is only required during the livetime of a session might be stored in a temporary tablespace.
PGA
When a session process dies, the client is notified with the error message ORA-03113: end-of-file on communication channel
This query selects the begin and end of sessions that have at least one entry in dba_hist_active_sess_history.

Index