Purpose
v$sql displays the statistics about SQL plans that are updated in real time. It records the statistics about each plan and every execution of the plan. Each plan has one row in this view.
Related tables/views
gv$sql
Fields
| Field | Type | Nullable? | Description |
|---|---|---|---|
| CON_ID | bigint(20) | NO | The ID of the tenant. |
| SVR_IP | varchar(32) | NO | The IP address of the server. |
| SVR_PORT | bigint(20) | NO | The port number. |
| PLAN_ID | bigint(20) | NO | The ID of the execution plan. |
| SQL_ID | varchar(32) | NO | The ID of the SQL statement. |
| TYPE | bigint(20) | NO | The type of the SQL statement. Valid values: local, remote, and distribute. |
| SQL_TEXT | varchar(4096) | NO | The text of the SQL statement. |
| PLAN_HASH_VALUE | bigint(20) | NO | The hash value of the execution plan. |
| FIRST_LOAD_TIME | timestamp(6) | NO | The time when the plan was executed for the first time. |
| LAST_ACTIVE_TIME | timestamp(6) | NO | The time when the plan was last executed. |
| AVG_EXE_USEC | bigint(20) | NO | The average amount of time that it took to execute the plan. |
| SLOWEST_EXE_TIME | timestamp(6) | NO | The time when the slowest execution started. |
| SLOWEST_EXE_USEC | bigint(20) | NO | The amount of time consumed by the slowest execution. |
| SLOW_COUNT | bigint(20) | NO | The number of times that the current plan was identified as a slow query. |
| HIT_COUNT | bigint(20) | NO | The number of plan cache hits. |
| PLAN_SIZE | bigint(20) | NO | The ID that uniquely identifies a plan in the plan cache of a single OBServer node. It is an incremental value managed by the plan cache module. Each time a new plan is added to the plan cache, a new plan ID is assigned to the plan. |
| EXECUTIONS | bigint(20) | NO | The number of executions. |
| DISK_READS | bigint(20) | NO | The number of disk reads. |
| DIRECT_WRITES | bigint(20) | NO | The number of disk writes. |
| BUFFER_GETS | bigint(20) | NO | The number of logical reads. |
| APPLICATION_WAIT_TIME | bigint(20) unsigned | NO | The total amount of time spent on waiting for events of the application class. |
| CONCURRENCY_WAIT_TIME | bigint(20) unsigned | NO | The total amount of time spent on waiting for events of the concurrency class. |
| USER_IO_WAIT_TIME | bigint(20) unsigned | NO | The total amount of time spent on waiting for events of the user_io class. |
| ROWS_PROCESSED | bigint(20) | NO | The total amount of time spent on waiting for events of the schedule class. |
| ELAPSED_TIME | bigint(20) unsigned | NO | The amount of time elapsed from when the request was received to when the execution was completed. |
| CPU_TIME | bigint(20) unsigned | NO | The amount of CPU time consumed by the execution of the plan. |