Search notes:

Oracle Session

Identification of sessions

At a given time, each session is identified by a session id or SID.
This SID is shown in v$session.
Since the SID is reused, a past session is identified by the combination of the SID and a serial number.
The functions current_session_id and current_session_serial in dbms_debug_jdwp provide a session's id (SID) and serial#.
A session's sid, serial number (and instance id) can also be calculated from dbms_session.unique_session_id.
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 from 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.
development/databases/Oracle/installed/dynamic-performance-views/session/blockers displays the blocker sessions for each blocked session.
x$ksuse
The state of active sessions is recorded in intervals of seconds in theActive Session History.
sys_context('sys_session_roles', role_name) allows to determine if a given role is enabled in a session.
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.
UGA is the memory being used by sessions.
The init parameter sessions

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758205146, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/architecture/session/index(186): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78