Skip to main content

[SOLVED] who has locked mysql table?!

Occasionally appears error message “Lock wait timeout exceeded, INSERT INTO table failed.” between 01am and 05am in one of the applications. Can you imagine DBA the whole night long sitting  and waiting for error message? I also can’t, but need to find the reason of locks and discover process. Thus when new record in error log appears it must be performed some necessary SQL commands. In unix world you can use inotifywait/gamin to watch file changes and mysql client to execute sql commands.
 My biggest problem was the mysql server running on windows platform and absence of nice utilities. On my luck windows has FindFirstChangeNotification Win32 API function. I have created small tool which listens a directory for changes and execute

SHOW FULL PROCESSLIST

SHOW OPEN TABLES

SHOW ENGINE INNODB STATUS

 Results will be written to console.

Usage MySql_Monitor.exe -h HOST -u USERNAME -pSOMEPASS -d DBNAME c:\tmp\WATCHED_DIR\

Example: MySql_Monitor.exe -h localhost -u root -p -d somedb c:\tmp\log\ > output.txt

You can take exe file or sources here.
Enjoy!

Comments

Popular posts from this blog

OTRS add custom CSS style

Wrong way to add it directly to HTMLHead.dtl file.

Correct way to create new Custom.css file, save it into /var/httpd/htdocs/skins/Agent/default/css/ directory
and add Custom.css item to Loader::Agent::CommonCSS###000-Framework via SysConfig editor.



 Enjoy!

Function List for Notepad 5.x Unicode

OUT - OF - DATE
Obsolete. Please checknew post!




If you have issue with Function List plugin for Notepad++ 5.1 or later, please check first whether you have ANSI or UNICODE version of application. Just open About dialog and check at the top version. You can download here UNICODE or ANSI recompiled version of plugin and save it into NPP_HOME \plugins\ folder.








Enjoy!

HOWTO wipe space on Hetzner Root Server

If your worry about data left on dedicated/hosted root server and want to remove secure all files and bits,
you can clean complete disk slice or even better to overwrite with random bytes.

DATA CAN'T BE RECOVERED ANY MORE! YOU WILL PROCEED AT YOUR OWN RISK!

1. Start Rescue system from Robot.
The Rescue System can be activated from Robot. After choosing the desired server from the server overview (Menu "Server" -> click on the desired server) go to the tab "Rescue". Here you can activate the Rescue System. After activating the Rescue System an automatically generated password is displayed. Please make a careful note of it as this is the root password of the Rescue System.
2. Login into Rescue System using ssh
3a. If you use default server with RAID 1 (example for an EX server) execute
# dd if=/dev/urandom of=/dev/md2 bs=1M

3b. Or if you use a hardware RAID controller has been installed or the server only has one drive (VQ servers) execute
# dd if=/dev/urandom o…