четверг, 27 июня 2013 г.

MySQL table size statistics

If you need to monitor and analyze your MySQL databases size over time you can automate this process.
1) create the database
CREATE DATABASE stat   DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

2) create the table
CREATE  TABLE `stat`.`sizeTable` (
  `idsizeTable` INT NOT NULL AUTO_INCREMENT ,
  `insertdate` DATE NOT NULL ,
  `databaseName` VARCHAR(45) NOT NULL ,
  `sizeMB` DOUBLE NOT NULL ,
  PRIMARY KEY (`idsizeTable`) ,
  INDEX `dateIndex` (`insertdate` ASC) )
ENGINE = InnoDB;

3) schedule the sql to collect statistics:
create event stat_db_evt
on schedule
every 24 hour
do
insert into stat.sizeTable (insertdate,databaseName, sizeMB) SELECT NOW() as insertdate, table_schema databaseName, sum( data_length + index_length ) / 1024 / 1024 sizeMB  FROM information_schema.TABLES GROUP BY table_schema;

Thar is all. This script will run every 24 hours and collect the statistics into the table, which you can analyze later.

пятница, 14 июня 2013 г.

OCPJP 7 Passed!

Yesterday I have passed 1z0-804 and earned the OCPJP status! Yeah!
So, what did I use for my preparation:
  1. Book Oracle Certified Professional Java SE 7 Programmer Exams by Ganesh and Sharma.
  2. Tests from http://enthuware.com.
It took me 3 months for preparation.