DEV Community

leo
leo

Posted on

openGauss routine maintenance: export and view wdr diagnostic report

Export and view wdr diagnostic report
The parameter enable_wdr_snapshot=on is required to generate snapshot data, and sysadmin or monadmin authority is required to access WDR snapshot data, so root account or other account with authority needs to be used to generate WDR diagnosis report.

1、Execute the following command to create a new report file.

touch /home/om/wdrTestNode.html
2、Connect the system library postgres.

gsql -d postgres -p 端口号 -r
3、Select two different snapshots in the snapshot.snapshot table. When no service restart occurs between the two snapshots, the two snapshots can be used to generate reports.

openGauss=# select * from snapshot.snapshot order by start_ts desc limit 10;
4、Run the following command to generate a WDR report in HTML format locally.

Run the following command to set the report format. \a: do not display table row and column symbols, \t: do not display column names, \o: specify the output file.

openGauss=# \a \t \o {报告路径}
Example:

openGauss=# \a \t \o /home/omm/wdrTestNode.html
Run the following command to generate a WDR report in HTML format.

openGauss=# 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:

openGauss=# select generate_wdr_report(1, 2, 'all', 'cluster',null);
Example 2, generate a report for a node:

openGauss=# select generate_wdr_report(1, 2, 'all', 'node', pgxc_node_str()::cstring);
illustrate:

The current node name of openGauss is fixed as "dn_6001", which can also be substituted directly.

5、Execute the following command to close the output option and format the output command.

\o \a \t
6、View the content of the WDR report under /home/om/ as required.

Top comments (0)