Search notes:

Oracle: Real Time SQL Monitoring

By default, Oracle monitors the execution of SQL statements that
Oracle can be forced to monitor all executions with one of the following statements:
alter session set events 'sql_monitor force=true';
alter system  set events 'sql_monitor force=true';
In order to force monitoring an SQL statement identified by an SQL Id, one of the following statements will do:
alter session set events 'sql_monitor [sql:abc0123456789] force=true';
alter system  set events 'sql_monitor [sql:abc0123456789] force=true';
Monitoring can be turned off with
alter system  set events 'sql_monitor off';

Limits

The number of statement executions that will be monitored at a given time is limited to 20 times the number of cpus, but can be adjusted with the hidden init parameter _sqlmon_max_plan.
Statements whose execution plans exceed 300 lines are not monitored. This threshold can be altered with the parameter _sqlmon_max_planlines.
The minimal execution time of 5 seconds that an SQL statement must be running before monitoring kicks in can be adjusted with _sqlmon_threshold.

See also

v$sql_monitor
The monitor and no_monitor SQL hints.
Compare with v$sql_plan_statistics and dbms_xplan.display_cursor.

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...', 1740476356, '18.221.156.66', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/SQL/statement/execution/monitoring/index(69): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78