How to create a snapshot and generate awr analysis report in DM7

In the process of using the database, if you want to monitor the parameters of the database at various points in time, you need to use database snapshots. After the database is installed, the database snapshot function is disabled by default. The database snapshot is a read-only static database. The DM snapshot function is implemented based on the database, and each snapshot is a read-only mirror based on the database. By retrieving the snapshot, you can obtain the relevant data information of the source database at the point in time when the snapshot was created. This article will show you how to generate database snapshots and AWR reports.

 

Note: The demonstration environment of this article: DM Database Server x64V7.1.6.43-Build(2018.01.29-88741)ENT

 

To enable DM snapshots, you need to call the DBMS_WORKLOAD_REPOSITORY package

[Note: DBMS_WORKLOAD_REPOSITORY package is not supported under DM MPP environment]

-Create the DBMS_WORKLOAD_REPOSITORY system package.

SP_INIT_AWR_SYS (1);

--Enable status detection.

SELECT SF_CHECK_AWR_SYS;

--The following statement sets the interval to 10 minutes, or other values:

CALL DBMS_WORKLOAD_REPOSITORY.AWR_SET_INTERVAL(10);

--Manually create a snapshot:

DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT();

Here we can try it several times and create several different snapshots.

 --View the created snapshot information, including the snapshot id:

SELECT * FROM SYS.WRM$_SNAPSHOT;

 

 

 

If we want to know the operating status of the database at each point in time, we can use the AWR_REPORT_HTML method in the DBMS_WORKLOAD_REPOSITORY package to generate the AWR report in HTML format.

 

 --View the content with html format of the AWR analysis report whose snapshot id is in the range of 1~3.

SELECT * FROM TABLE (DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML(1,3));

--Generate the AWR analysis report with the snapshot id in the range of 1~3 to the awr1.html file in the /home/dmdba directory.

 

SYS.AWR_REPORT_HTML(1,3,'/home/dmdba','awr1.html'); [modify according to the actual path]

The generated report format is as follows

 

 

The above is about some usages of database snapshots in DM7. If you want to have a deeper understanding of this aspect, you can refer to the DBMS_WORKLOAD_REPOSITORY package chapter in the DM7 installation directory /doc/special/DM7 system package manual.

 

Guess you like

Origin blog.csdn.net/qq_42726883/article/details/108528482