Using DRITA functions v17
You can use DRITA functions to gather wait information and manage snapshots. DRITA functions are fully supported by EDB Postgres Advanced Server whether your installation is made compatible with Oracle databases or is in PostgreSQL-compatible mode.
Retrieving a list of current snapshots (get_snaps)
The get_snaps()
function returns a list of the current snapshots. The signature is:
This example uses the get_snaps()
function to display a list of snapshots:
The first column in the result list displays the snapshot identifier. The second column displays the date and time that the snapshot was captured.
Retrieving system wait information (sys_rpt)
The sys_rpt()
function returns system wait information. The signature is:
Parameters
beginning_id
An integer value that represents the beginning session identifier.
ending_id
An integer value that represents the ending session identifier.
top_n
The number of rows to return.
This example shows a call to the sys_rpt()
function:
Results
The information displayed in the result set includes:
Column name | Description |
---|---|
WAIT NAME | The name of the wait |
COUNT | The number of times that the wait event occurred |
WAIT TIME | The time of the wait event in seconds |
% WAIT | The percentage of the total wait time used by this wait for this session |
Retrieving session wait information (sess_rpt)
The sess_rpt()
function returns session wait information. The signature is:
Parameters
beginning_id
An integer value that represents the beginning session identifier.
ending_id
An integer value that represents the ending session identifier.
top_n
The number of rows to return.
This example shows a call to the sess_rpt()
function:
Results
The information displayed in the result set includes:
Column name | Description |
---|---|
ID | The processID of the session |
USER | The name of the user incurring the wait |
WAIT NAME | The name of the wait event |
COUNT | The number of times that the wait event occurred |
TIME | The length of the wait event in seconds |
% WAIT SES | The percentage of the total wait time used by this wait for this session |
% WAIT ALL | The percentage of the total wait time used by this wait for all sessions |
Retrieving ession ID information for a specified backend (sessid_rpt)
The sessid_rpt()
function returns session ID information for a specified backend. The signature is:
Parameters
beginning_id
An integer value that represents the beginning session identifier.
ending_id
An integer value that represents the ending session identifier.
backend_id
An integer value that represents the backend identifier.
This example shows a call to sessid_rpt()
:
Results
The information displayed in the result set includes:
Column name | Description |
---|---|
ID | The process ID of the wait |
USER | The name of the user that owns the session |
WAIT NAME | The name of the wait event |
COUNT | The number of times that the wait event occurred |
TIME | The length of the wait in seconds |
% WAIT SES | The percentage of the total wait time used by this wait for this session |
% WAIT ALL | The percentage of the total wait time used by this wait for all sessions |
Retrieving session wait information for a specified backend (sesshist_rpt)
The sesshist_rpt()
function returns session wait information for a specified backend. The signature is:
Parameters
snapshot_id
An integer value that identifies the snapshot.
session_id
An integer value that represents the session.
This example shows a call to the sesshist_rpt()
function:
Note
The example was shortened. Over 1300 rows are actually generated.
Results
The information displayed in the result set includes:
Column name | Description |
---|---|
ID | The system-assigned identifier of the wait |
USER | The name of the user that incurred the wait |
SEQ | The sequence number of the wait event |
WAIT NAME | The name of the wait event |
ELAPSED | The length of the wait event in microseconds |
File | The relfilenode number of the file |
Name | If available, the name of the file name related to the wait event |
# of Blk | The block number read or written for a specific instance of the event |
Sum of Blks | The number of blocks read |
Purging a range of snapshots from the snapshot tables (purgesnap)
The purgesnap()
function purges a range of snapshots from the snapshot tables. The signature is:
Parameters
beginning_id
An integer value that represents the beginning session identifier.
ending_id
An integer value that represents the ending session identifier.
purgesnap()
removes all snapshots between beginning_id
and ending_id
, inclusive:
A call to the get_snaps()
function after executing the example shows that snapshots 6
through 9
were purged from the snapshot tables:
Deleting records from the snapshot table (truncsnap)
Use the truncsnap() function to delete all records from the snapshot table. The signature is:
For example:
A call to the get_snaps()
function after calling the truncsnap()
function shows that all records were removed from the snapshot tables:
- On this page
- Retrieving a list of current snapshots (get_snaps)
- Retrieving system wait information (sys_rpt)
- Retrieving session wait information (sess_rpt)
- Retrieving ession ID information for a specified backend (sessid_rpt)
- Retrieving session wait information for a specified backend (sesshist_rpt)
- Purging a range of snapshots from the snapshot tables (purgesnap)
- Deleting records from the snapshot table (truncsnap)