当前位置:网站首页>DB2 database generates HTML patrol Report

DB2 database generates HTML patrol Report

2022-06-24 02:26:00 DBA collection of Wheat Seedlings

1、 Introduction to patrol scripts

The database patrol script is pure SQL Script development , As shown below :

At present, it includes 14 Script , If the script extension is “.sql” Indicates that the script is sql Script ; If the script extension is “.pl” Indicates that the script is perl Script ; If the script extension is “.sh” Indicates that the script is shell Script .

about Oracle Of SQL In terms of scripts , Script DB_Oracle_HC_lhr_v7.0.0_10g.sql Apply to Oracle 10g database , Script DB_Oracle_HC_lhr_v7.0.0_11g.sql Apply to Oracle 11g The database of , Script DB_Oracle_HC_lhr_v7.0.0_12c.sql Apply to Oracle 12c And above , this 3 It's all scripts read-only edition , this 3 A script will only query the database , Can not do DML and DDL operation , That's what many friends are looking forward to .

Script DB_OS_HC_lhr_v7.0.0.pl yes perl Script , After implementation, it will be helpful to OS To collect information from , And output to html in . Script DB_OS_HC_lhr_v7.0.0.sh yes shell Script , After implementation, it will be helpful to OS To collect information from .

Script DB_MySQL_HC_lhr_v7.0.0.sql yes MySQL Script , After execution, it will produce MySQL Health check html The report , The script is read-only Script .

Script DB_MSSQL_HC_lhr_v7.0.0_2005.sql and DB_MSSQL_HC_lhr_v7.0.0_2008R2.sql yes SQL Server Script , The part of being DDL and DML operation , After execution, it will produce SQL Server Health check html The report . Script DB_MSSQL_HC_lhr_v7.0.0_2005.sql The minimum support 2005 edition , And the script DB_MSSQL_HC_lhr_v7.0.0_2008R2.sql The minimum support 2008R2 edition .

Script DB_PG_HC_lhr_v7.0.0.sql yes PG Database script , After execution, it will produce PostgreSQL Database health check html The report .

Script DB_DM_HC_lhr_v7.0.0 It's a Damon database script , After execution, the health check of Damon database will be generated html The report .

Script DB_TiDB_HC_lhr_v7.0.0.sql yes TiDB Database script , After execution, it will produce TiDB Database health check html The report .

Script DB_openGauss_HC_lhr_v7.0.0.sql yes openGauss Database script , After execution, it will produce openGauss Database health check html The report .

Script DB_DB2_HC_lhr_v7.0.0 yes DB2 Database script , After execution, it will produce DB2 Database health check html The report .

Please refer to... For full introduction :https://www.xmmup.com/shujukuxunjianjiaoben.html

2、 Patrol script features

1、 It can be inspected Oracle、MySQL、SQL Server、PostgreSQL、TiDB、openGauss、DB2 And domestic dream etc. 8 A database , You can also patrol Linux operating system ( The follow-up will be free and gradually increased MongoDB、OceanBase、PolarDB、TDSQL、GBase、 National People's Congress Jincang and other databases )

2、 The script is green 、 Installation free 、 pure SQL Text

3、 Cross platform , As long as there is SQL*Plus(Oracle)、mysql(MySQL、TiDB)、MSSQL client (SSMS、Navicat All can )、psql(PG、openGauss)、gisql( Home made Da Meng )、gsql(openGauss)、db2(DB2 database ) Environment to run the script

4、 Script content visualization , You can see the script content , So it can be used for learning database

5、 compatible Oracle 10g、11g、12c、18c、19c、20c、21c Wait for the higher version Oracle database

6、 Yes Oracle 10g、11g、12c、18c、19c、20c、21c And other versions provide read-only versions respectively ( Only query the database , Do not do DDL and DML operation )

7、MySQL The minimum support 5.5 edition

8、SQL Server The minimum support 2005 edition

9、 It's very convenient to add and delete monitoring items , Just provide the relevant information SQL that will do

10、 Buy at once , All scripts are free to upgrade for life

11、 The inspection is very comprehensive

12、 For each database , Only 1 individual SQL Script , There are no other issues such as nested call scripts

13、 The resulting html Health check results in file format

14、Oracle The database filters the patrol inspection results , List the database problems

15、 Yes OS The information provided by the collection ( Individual scripts )

3、DB2 Database operation mode

Need to have db2 Database client , The operation mode is as follows :

① The client is in Windows platform , Connect to local db2 database :

db2cmd
db2 connect to lhrdb && db2 -txf D:\DB_DB2_HC_lhr_v7.0.0.sql >  d:\lhr_db2_health_check.html

② The client is in Linux platform , Connect to local db2 database :

db2 connect to lhrdb; db2 -txf DB_DB2_HC_lhr_v7.0.0.sql > lhr_db2_health_check_`date +'%Y%m%d%H%M%S'`.html

③ The client is in Windows platform , You need to connect to a remote linux The server :

db2cmd
db2 connect to test user db2inst1 using lhr && db2 -txf D:\DB_DB2_HC_lhr_v7.0.0.sql >  D:\lhr_db2_health_check.html

Be careful :

1、 It is recommended to run directly on the server , Because individual patrol commands only support running on the server .

2、 The script can only detect the current database , Check other databases if necessary , Please run the script again , And modify the name of the database connected to , for example :db2 connect to test;

4、html Patrol inspection results

Here are just some of the results , For other details, please refer to :https://share.weiyun.com/5lb2U2M

Others are not listed .

原网站

版权声明
本文为[DBA collection of Wheat Seedlings]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/10/20211029180744644D.html