標籤:
先安裝orzdba,連結:
http://blog.itpub.net/28939273/viewspace-1875895/
安裝依賴的包:
[[email protected] servers]# yum install perl-TermReadKey.x86_64
否則報錯如下:
[[email protected] servers]# ./orztop -u=root -p=‘yoon‘ -S=/export/data/mysql/tmp/mysql.sock
Can‘t locate Term/ReadKey.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./orztop line 14.
BEGIN failed--compilation aborted at ./orztop line 14.
[[email protected] servers]# yum search ReadKey
yum install perl-TermReadKey.x86_64
[[email protected] servers]# ./orztop -help
==========================================================================================
Info :
Created By [email protected]
Usage :
Command line options :
-help Print Help Info.
-h,--host Hostname/Ip to use for mysql connection.
-u,--user User to use for mysql connection.
-p,--pwd Password to use for mysql connection.
-P,--port Port to use for mysql connection(default 3306).
-S,--socket Socket to use for mysql connection.
-t Time(second) Interval.
==========================================================================================
[[email protected] servers]# ./orztop -u=root -p=‘yoon‘ -S=/export/data/mysql/tmp/mysql.sock
資訊中還包括了資料庫的每秒的insert/update/delete/select,邏輯讀,命中率,當前活動線程等,可以大致看到資料庫的當前壓力情況;
當你的執行個體出現效能瓶頸時,不妨用該工具看看,抓取一下當前正在跑的慢sql
MySQL監控工具-orztop