$ number=0
$ let number="$RANDOM % 15 + 45"
$ sleep $number
Monday, March 14, 2011
Wednesday, January 26, 2011
Friday, November 12, 2010
MySQL buffer cheat sheet
myisam_sort_buffer_size used for ALTER TABLE, OPTIMIZE TABLE, REPAIR TABLE commands.
for session
set @@local.myisam_sort_buffer_size=4294967296
Setting innodb_buffer_pool_size
InnoDB optimization basics
http://www.mysqlperformanceblog.com/2008/11/21/how-to-calculate-a-good-innodb-log-file-size
for session
set @@local.myisam_sort_buffer_size=4294967296
Setting innodb_buffer_pool_size
InnoDB optimization basics
http://www.mysqlperformanceblog.com/2008/11/21/how-to-calculate-a-good-innodb-log-file-size
Tuesday, October 26, 2010
Transferring using ssh and pipes.
# no compression, use remote mysqlcommand to run script.
$ mysqldump -u username -p'password' db-name | ssh user@remote.box.com mysql -u username -p'password db-name
# create tarball on remote system
$ sudo tar zcvf - /wwwdata | ssh root@192.168.1.201 "cat > /backup/wwwdata.tar.gz"# other example from http://blog.gr80.net/post/transfer-your-website-across-servers-using-ssh-tar-mysqldump/
$ sudo tar -zcf – {local_dir} | ssh {remote_user}@{remote.domain} tar -C {/path/to/remote/dir} -zxf -$ sudo mysqldump -h{local_dbserver} -u{local_dbuser} -p{local_dbpass} {local_dbname} > – | ssh {ssh_username}@{your.domain} mysql -u{remote_dbuser} -p{remote_dbpass} {remote_dbname} < -
Tuesday, October 19, 2010
MySQL temp files in data
Alter table w/ keys disabled creates temp tables w/ names starting w/ #. Copies table to this and then copies over original.
enable keys - no temp files in data while "repair by sorting". Why? done in RAM.
enable keys - no temp files in data while "repair by sorting". Why? done in RAM.
Friday, October 15, 2010
Thursday, October 14, 2010
Verify that a file has constant number of fields.
# awk -F~ '{print NF}' < 20100912PATLAB.txt | sort | uniq
25
add -c to uniq to get count of occurrences.
# awk -F'\t' '{print NF}' < PTINFO.EXT | sort | uniq -c
4420846 38
3 39
3 40
1 41
3 42
25
add -c to uniq to get count of occurrences.
# awk -F'\t' '{print NF}' < PTINFO.EXT | sort | uniq -c
4420846 38
3 39
3 40
1 41
3 42
Subscribe to:
Posts (Atom)