Exporting and Viewing the WDR

Accessing WDR snapshot data requires the sysadmin or monadmin permission. Therefore, to generate a WDR, you must use the root account or other accounts with the aforementioned permissions.

  1. Run the following command to create a report file:

    touch  /home/om/wdrTestNode.html
  2. Connect to the Postgres system database.

    gsql -d postgres -p [*Port number*] -r
  3. Select two different snapshots in the snapshot.snapshot table. If no service restart occurs between the two snapshots, use the two snapshots to generate a report.

    gsql> select * from snapshot.snapshot order by start_ts desc limit 10;
  4. Run the following commands to generate a WDR in HTML format on the local PC:

    1. Run the following commands to set the report format. \a indicates that table row and column symbols are not displayed. \t indicates that column names are not displayed. \o specifies an output file.

      gsql> \a      
      gsql> \t 
      gsql> \o {*Report path*}
    2. Run the following command to generate a WDR in HTML format:

      gsql> select generate_wdr_report(begin_snap_id Oid, end_snap_id Oid, int report_type, int report_scope, int node_name );

      Example 1: Generate a cluster-level report.

      select generate_wdr_report(1, 2, 'all', 'cluster',null);

      Example 2: Generate a report for a node.

      select generate_wdr_report(1, 2, 'all', 'node', pgxc_node_str()::cstring);

      NOTE: Currently, the name of the openGauss node is fixed to dn_6001_6002_6003. You can also replace it with the actual node name.

      Table 1 Parameter description



      Value Range


      ID of a snapshot that starts at a performance period (snapshot_id in the snapshot.snaoshot table)



      ID of the end snapshot. By default, the value of end_snap_id is greater than the value of begin_snap_id (snapshot_id in the snapshot.snaoshot table).



      Specifies the type of the generated report.

      • summary
      • detail
      • all: Both summary and detail types are included.


      Specifies the scope for the report to be generated.

      • cluster: cluster
      • node: a node in the cluster


      • When report_scope is set to single node, set this parameter to the name of the corresponding node.
      • When report_scope is set to cluster, this parameter can be omitted or set to NULL.


  5. Run the following command to disable the output options and format the output:

    \o \a \t 
  6. View the WDR in /home/om/ as required.

    Table 2 Main content of the WDR



    Database Stat (cluster scope)

    Database performance statistics: transactions, read and write operations, row activities, write conflicts, and deadlocks

    Load Profile (cluster scope)

    Cluster performance statistics: CPU time, DB time, logical or physical read, I/O performance, login and logout, load strength, and load performance

    Instance Efficiency Percentages (cluster or node scope)

    Cluster-level or node-level cache hit ratio

    I/O Profile (cluster or node scope)

    I/O usage in the cluster or node dimension

    Top 10 Events by Total Wait Time (node scope)

    Most time-consuming event

    Wait Classes by Total Wait Time (node scope)

    Category of the wait time that is most time-consuming

    Host CPU (node scope)

    CPU usage of the host

    Memory Statistics (node scope)

    Kernel memory usage distribution

    Time Model (node scope)

    Time distribution information about the statements on a node

    Wait Events (node scope)

    Statistics on wait events at the node level

    Cache I/O Stats (cluster or node scope)

    I/O statistics on user tables and indexes

    Utility Status (node scope)

    Status information about the replication slot and background checkpoint

    Object Stats (cluster or node scope)

    Performance statistics in the index and table dimensions

    Configuration settings (node scope)

    Node configuration

    SQL Statistics (cluster or node scope)

    SQL statement performance statistics: end-to-end time, row activities, cache hit, CPU consumption, and time consumption

    SQL Detail (cluster or node scope)

    SQL statement text details

编组 3备份
    openGauss 2024-04-25 00:46:51