待寫
MySQLslap
MySQLsla
xtrabackup
sysbench
iibench
innotop
MySQLimport
myisampack
myisamchk
sysbench
安裝步驟: 下載 http://sourceforge.Net/projects/sysbench/ cd sysbench-0.4.12 ./confiure --help rpm -ql MySQL-server-community-5.1.50-1.rhel5 |grep lib #(找到mysql-lib) find / -name mysql.h #(找到mysql header ,若沒有可能要安裝mysql-devel) ./configure --with-mysql-libs=/usr/lib64/mysql --with-mysql-includes=/usr/include/MySQL/ make make install
sysbench --test=oltp --oltp-table-size=100000 --mysql-socket=/data/mysql/mysql3306/var/mysql.sock --mysql-host=127.0.0.1 --mysql-db=temp --mysql-user=root --mysql-passWord= prepare sysbench --test=oltp --oltp-table-size=100000 --mysql-socket=/data/mysql/mysql3306/var/mysql.sock --mysql-db=temp --mysql-user=root --MySQL-passWord= --max-time=60 --oltp-read-only=on --max-requests=0 --num-threads=8 run
MySQLimport
Usage: MySQLimport [OPTIONS] database textfile...
head active_2009_09_10.log
1249956795232 36325587 99.233.0.121 http://home.xiaonei.com/Home.do
1249956988430 36325587 99.233.0.121 http://www.xiaonei.com/Logout.do?_os_type=1
1249956845460 36325587 99.233.0.121 http://xiaonei.com/MyEducationInfo.do
1249956983824 36325587 99.233.0.121 http://xiaonei.com/SysHome.do awk '{print $1"\t"$2}' active_2009_09_10.log > active_2009_09_10.step1.log
awk -F? '{print $1}' active_2009_09_10.step1.log > active_2009_09_10.new.log #去除'?'
MySQLimport -h pippen tmp --fIElds-terminated-by= --local active_2009_09_10.new.log
(3306/tmp)> insert into active_2009_09_10_stage select ta.uid,ta.link,tb.stage from active_2009_09_10 ta left join fb.user_basic tb on ta.uid=tb.id ;
Myisampack
運行myisampack後,必須運行myisamchk以重新創建索引。 shell> myisamchk -rq --sort-index --analyze tbl_name.MYI 將壓縮的表安裝到MySQL數據庫目錄中後,應執行mysqladmin flush-tables以強制MySQLd使用新的表。 要想解壓縮一個壓縮的表,使用myisamchk或isamchk的--unpack選項。
show table status like 'iplog_20090723'\G; alter table iplog_20090723 engine=MyISAM; shell> myisampack iplog_20090723 shell> myisamchk -rq iplog_20090723 #還原 myisamchk --unpack iplog_20090723 flush table iplog_20090723 show table status like 'iplog_20090723'\G; ls -lh iplog_200907*.MYD | sort +8Myisamchk
http://hi.baidu.com/webwuyou/blog/item/2ebdf444d7c9ee2fcffca381.Html
myisamchk -r -q tbl_name (-r -q means “quick recovery mode”).