Note
This view is available starting with V4.0.0.
Purpose
This view displays the overall status of the plan cache for the current tenant on all OBServer nodes.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SVR_IP | VARCHAR2(32) | NO | The IP address of the server. |
| SVR_PORT | NUMBER(38) | NO | The port number. |
| SQL_NUM | NUMBER(38) | NO | The number of SQL statements involved in the plan cache. |
| MEM_USED | NUMBER(38) | NO | The amount of memory used by the plan cache. |
| MEM_HOLD | NUMBER(38) | NO | The amount of memory held by the plan cache. |
| ACCESS_COUNT | NUMBER(38) | NO | The number of queries that accessed the plan cache. |
| HIT_COUNT | NUMBER(38) | NO | The number of times the plan cache was hit. |
| HIT_RATE | NUMBER(38) | NO | The hit rate of the plan cache. |
| PLAN_NUM | NUMBER(38) | NO | The number of plans. |
| MEM_LIMIT | NUMBER(38) | NO | The maximum memory size of the plan cache, in bytes. |
| HASH_BUCKET | NUMBER(38) | NO | The number of buckets in the hash map of the plan cache. |
| STMTKEY_NUM | NUMBER(38) | NO | The number of stmt_keys in the plan cache. |
Sample query
In the user tenant, query the overall status of the plan cache for the tenant on all nodes.
obclient [SYS]> SELECT * FROM SYS.GV$OB_PLAN_CACHE_STAT;
The query result is as follows:
+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
| SVR_IP | SVR_PORT | SQL_NUM | MEM_USED | MEM_HOLD | ACCESS_COUNT | HIT_COUNT | HIT_RATE | PLAN_NUM | MEM_LIMIT | HASH_BUCKET | STMTKEY_NUM |
+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
| 11.xxx.xxx.xxx | 28825 | 477 | 12644786 | 88080384 | 5381284 | 5377454 | 99 | 477 | 214748360 | 49157 | 0 |
+----------------+----------+---------+----------+----------+--------------+-----------+----------+----------+-----------+-------------+-------------+
1 row in set
