Archive

Archive for April 10th, 2009

How to optimize mysql database

April 10th, 2009 No comments

Recently I did run into issue where I just needed to optimize my database. Have few of them in mysql and then each of those databases have all bunch of tables. Now, I can issue:
mysql -u root -ppassword -e ‘show databases’
this will display list of all my databases, then I can connect to each individual database and issue the following sql statement:
OPTIMIZE TABLE tbl_name;
But this is quite manual process. Easier way is to just use mysqlcheck utility on the whole database rather than each individual tables.
mysqlcheck -o dspam -u root -ppassword
The mysqlcheck program can also be used to check (-c/-m/-C), repair (-r) and analyze (-a) the tables in a database. These commands can be done by using the CHECK, REPAIR and ANALYZE MySQL commands.

So anyway I did put this into some script and can easily execute it on every database that I have in my mysql
-=-=-=- END OF SCRIPT -=-=-=-
#!/usr/bin/ksh
STAMP=`date +%y%m%d.%H%M%S`
HOSTNAME=`/usr/bin/uname -n`
REMOTEHOSTNAME=”localhost”

mysqlpwd=’password’             ###This is why the file should be chmod 700
                                ###for the mysql user we are backing up.

for database in `/usr/local/mysql/bin/mysql -h $REMOTEHOSTNAME -u root -p$mysqlpwd -e ‘show databases’ | sed s/[\+\|]//g`
do
  if [ $database == Database ] || [ $database == test ]
  then
    echo $database
    continue
  else
    now=`date`
    echo “==========================================”
    echo “Optimizing $database on $REMOTEHOSTNAME:”
    echo “Start: $now”
    /usr/local/bin/mysqlcheck -h $REMOTEHOSTNAME -o $database -u root -p$mysqlpwd
    if [ $? -eq 0 ]
    then
      now=`date`
      echo “End:   $now”
      echo “Optimization of $database Successful.”
    else
      echo “!!! There was an error optimizing up MySQL $database on $REMOTEHOSTNAME”
    fi
    echo “”
    echo “==========================================”
    echo “”
    echo “”
fi     
done
-=-=-=- END OF SCRIPT -=-=-=-

Categories: mysql Tags: , ,

Canon EOS 5D Mark II

April 10th, 2009 No comments

Canon’s update to the wildly popular full frame EOS 5D is here, and it’s better than ever. The EOS 5D Mark II has a stunning 21.1-megapixel full-frame CMOS sensor with DIGIC 4 Image Processor,Canon EOS 5D Mark II front shot a vast ISO Range of 100-6400 (expandable to ISO L: 50, H1: 12800 and H2: 25600), plus EOS technologies like Auto Lighting Optimizer and Peripheral Illumination Correction. It supports Live View shooting, Live View HD videos (how cool is that!), and more. It can shoot up to 3.9 fps, has 9 AF points plus 6 AF assist points, a new 98% coverage viewfinder, a 3.0-inch Clear View LCD (920,000 dots/VGA) and a rugged build. Full-frame shooters rejoice!

  • 21.1 Megapixel Full-frame CMOS sensor, 14-bit A/D conversion (16,384 colors/each of 3 primary color), wide range ISO setting of 100-6400 (expandable L: 50, H1: 12800 and H2: 25600).
  • Full HD Video capture at 1920 x 1080 resolution for up to 4GB per clip with HDMI output for HD viewing of stills and video.
  • Next generation DIGIC 4 Image Processor for faster processing of fine detail and color reproduction as well as reduced image noise.
  • High performance with 3.9 fps continuous shooting, new shutter with a durability of 150,000 cycles and improved weather-resistant body.
  • Live View Function for stills (Quick, Live and Face Detection AF modes) and video.
  • 3.0-inch Clear View LCD (920,000 dots/VGA) monitor with anti-reflective and scratch-resistant coatings for improved viewing and smudge protection.
  • Updated EOS Integrated Cleaning System specifically designed to work with a full-frame sensor.
  • Compatible with over 60 Canon EF Lenses and most EOS System accessories.
  • Highest ISO Range to Date

The EOS 5D Mark II features a huge, full-frame sensor. A 21.1-megapixel CMOS sensor delivers images of up to 5616 x 3744 pixels. And since it is full-frame, all lenses will deliver the angle of view they would on a 35mm camera without a conversion factor. This comes in handy especially when shooting with wide-angle lenses. For the flexibility to shoot in even the most dimly lit situations, the EOS 5D Mark II offers Canon’s highest ISO sensitivity to date, ranging from 100-6400 (expandable to ISO L: 50, H1: 12800 and H2: 25600). Thanks to improved noise reduction technologies, images shot even at highest sensitivity will be remarkably smooth.

Categories: canon, Personal Tags: , , ,

Powered by WP Robot

Stop SOPAPowered by Yahoo! Answers