xxxx-xx-xx系统应用(周)巡检报告模版

​ xxxx-xx-xx系统应用(周)巡检报告模版

1、巡检概述与总结

系统名称 巡检时间
巡检人 联系方式
巡检单位
巡检结论

2、巡检项目

(一)系统容量巡检

1.1 CPU使用率 低

image-20220902104641231

1.2 内存使用率 正常

image-20220902104804391

1.3 文件系统使用率 /cmcc 使用率高

image-20220902105007441

(二)应用检查

2.1 服务巡检

image-20220902105345458

2.2 应用日志(报错、告警等) 未见异常

tail -f catalina.out 

image-20220902105910336

(三) 数据库巡检 mysql

3.1 数据库命中率

key_reads / key_read_requests应该尽可能的低,至少是1:100,1:1000更好

 show status like 'key_read%';

image-20220902110733642

show global status like 'open%tables%';

image-20220902111617487

Opened_tables数值非常大,说明cache太小,导致要频繁地open table,可以查看下当前的table_open_cache设置:

show variables like '%table_open_cache%';

image-20220902111706849

table_open_cache 默认是64 已调大到2048

3.2 数据盘空间利用率

SELECT
  TABLE_SCHEMA,
  CONCAT(
    TRUNCATE(SUM(data_length) / 1024 / 1024, 2),
    ' MB'
  ) AS data_size,
  CONCAT(
    TRUNCATE(SUM(index_length) / 1024 / 1024, 2),
    'MB'
  ) AS index_size
FROM
  information_schema.tables
GROUP BY TABLE_SCHEMA;

image-20220902112038328

3.3 数据库死锁及进程状态

 show status like 'innodb_row_lock_%';

image-20220902112400770

解释如下:
Innodb_row_lock_current_waits : 当前等待锁的数量
Innodb_row_lock_time : 系统启动到现在,锁定的总时间长度
Innodb_row_lock_time_avg : 每次平均锁定的时间
Innodb_row_lock_time_max : 最长一次锁定时间
Innodb_row_lock_waits : 系统启动到现在总共锁定的次数
mysql> desc information_schema.innodb_locks;
+-------------+---------------------+------+-----+---------+-------+
| Field       | Type                | Null | Key | Default | Extra |
+-------------+---------------------+------+-----+---------+-------+
| lock_id     | varchar(81)         | NO   |     |         |       |#锁ID
| lock_trx_id | varchar(18)         | NO   |     |         |       |#拥有锁的事务ID
| lock_mode   | varchar(32)         | NO   |     |         |       |#锁模式
| lock_type   | varchar(32)         | NO   |     |         |       |#锁类型
| lock_table  | varchar(1024)       | NO   |     |         |       |#被锁的表
| lock_index  | varchar(1024)       | YES  |     | NULL    |       |#被锁的索引
| lock_space  | bigint(21) unsigned | YES  |     | NULL    |       |#被锁的表空间号
| lock_page   | bigint(21) unsigned | YES  |     | NULL    |       |#被锁的页号
| lock_rec    | bigint(21) unsigned | YES  |     | NULL    |       |#被锁的记录号
| lock_data   | varchar(8192)       | YES  |     | NULL    |       |#被锁的数据
+-------------+---------------------+------+-----+---------+-------+
10 rows in set (0.09 sec)

3.3 缓存使用率

show global status like 'innodb%read%';

image-20220902112906553

3.4 查询无主键的表


SELECT
	table_schema,
	table_name 
FROM
	information_schema.TABLES 
WHERE
	table_name NOT IN ( SELECT DISTINCT table_name FROM information_schema.COLUMNS WHERE column_key = "PRI" ) 
	AND table_schema IN ( 'caoss' );

image-20220902113134061

3.4表碎片检查

select TABLE_SCHEMA,TABLE_NAME,ENGINE,concat(splinter,'G') '碎片(G)' from (

SELECT TABLE_SCHEMA,TABLE_NAME,ENGINE,ROUND((DATA_LENGTH+INDEX_LENGTH-TABLE_ROWS*AVG_ROW_LENGTH)/1024/1024/1024) splinter from information_schema.`TABLES` where TABLE_TYPE='BASE TABLE'

)a WHERE splinter >1 ORDER BY splinter DESC;

image-20220902113648090

3.5 慢sql查询

show variables like 'slow_query_log';
SELECT * FROM `slow_log` where start_time > '2019/05/19 00:00:00';

image-20220902113810804

posted @ 2022-09-02 11:44  机猿巧合  阅读(272)  评论(0编辑  收藏  举报