Help Center > > Developer Guide> WDR Performance Analysis> Performance View Snapshot> Accessing Snapshots

Accessing Snapshots

Updated at: Sep 17, 2021 GMT+08:00

Snapshot data is stored in tables in dbms_om mode. For details, see System Catalogs for Performance View Snapshot.

  • To access performance snapshot tables, you must have the administrator rights.
  • Tables and objects related to performance snapshots are read-only. Do not modify or delete them. Otherwise, the snapshot function and WDR report will be abnormal.

Each snapshot is identified by snapshot_id. If you want to query the snapshot data at a certain time point, you can query the dbms_om.snapshot table, and find snapshot_id of the start_ts and end_ts fields that are closest to the time point. Then you can query the snapshot data of the target view based on snapshot_id.

For example, to query the snapshot data between 2021-02-21 00:00:00 and 2021-02-21 01:00:00, run the following command:

select * from dbms_om.snapshot where start_ts > '2021-02-21 00:00:00'::timestamptz and start_ts < '2021-02-21 01:00:00'::timestamptz;
 snapshot_id |           start_ts            |            end_ts             
-------------+-------------------------------+-------------------------------
        2129 | 2021-02-21 00:02:31.611664+08 | 2021-02-21 00:03:07.636161+08
        2132 | 2021-02-21 00:32:33.22689+08  | 2021-02-21 00:33:09.23794+08
        2131 | 2021-02-21 00:22:32.538075+08 | 2021-02-21 00:23:06.999122+08
        2133 | 2021-02-21 00:42:33.457503+08 | 2021-02-21 00:43:07.275433+08
        2130 | 2021-02-21 00:12:31.891252+08 | 2021-02-21 00:13:13.379809+08
        2134 | 2021-02-21 00:52:33.404626+08 | 2021-02-21 00:53:07.720633+08
(6 rows)

For example, to query the memory usage of the dn_6003_6004 node between 2021-02-21 00:20:00 and 2021-02-21 00:25:00, run the following command to query the memory view snapshot whose snapshot_id is 2131:

select snap_memorytype,snap_memorymbytes from dbms_om.snap_pgxc_total_memory_detail where snapshot_id=2131 and snap_nodename='dn_6003_6004' order by snap_memorymbytes desc limit 5;
   snap_memorytype   | snap_memorymbytes 
---------------------+-------------------
 max_process_memory  |             12288
 max_dynamic_memory  |              8912
 max_sctpcomm_memory |              4000
 process_used_memory |              2781
 max_shared_memory   |              2351
(5 rows)

The start_ts and end_ts fields in the dbms_om.snapshot view record the start time and end time of each snapshot. To obtain more accurate time information, you can query the dbms_om.tables_snap_timestamp table, which records the accurate start and end time of each view during each snapshot creation.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel