iT邦幫忙

2017 iT 邦幫忙鐵人賽
DAY 24
0
自我挑戰組

MariaDB 的使用與管理系列 第 24

DBA Daily Check Report 的製作 [7]

今天介紹的是 Session List。

只要看 information_schema.PROCESSLIST 就可以了。

select '<tr><td>', id,
'</td><td>', user, 
'</td><td>', host, 
'</td><td>', db, 
'</td><td>', command, 
'</td><td>', REPLACE(REPLACE(info,'<','&lt;'), '>', '&gt;'),
'</td><td>', state, 
'</td><td>', memory_used, 
'</td><td>', time, 
'</td><td>', query_id, 
'</td></tr>' from information_schema.PROCESSLIST order by id;

中間的 replace 是因為用到這個 Powershell 時,也是會在 information_schema.PROCESSLIST 呈現的,如果沒有替換一下,就會混亂了,所以要先 escape。


上一篇
DBA Daily Check Report 的製作 [6]
下一篇
DBA Daily Check Report 的製作 [8]
系列文
MariaDB 的使用與管理30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言