Archive for May 2008

Sun xVM VirtualBox is released!

VirtualBox 1.6 is out. Note that now you can use Mac OS X and Solaris as a host platform. Naturally, having Mac OS X support excites me.

I tried installing a Ubuntu 8.04 server guest. Found a tiny issue – 64-bit guests aren’t supported yet :( So I pulled in the 32-bit ISO, and that installed just fine. Note that PAE support for guests exist now, and this is a good step in the right direction.

Sun’s building an OpenxVM community, which currently focus on xVM and xVM VirtualBox. It also harnesses technologies like Open Service Tag. All in all, I think a lot of MySQL users should be interested in virtualization, as there is a growing amount of hardware out there with many, many cores available for use.

Installing Ubuntu 8.04 server and getting past the kernel not booting
This is more of an Ubuntu problem, than a VirtualBox problem, but I faced an issue:

The kernel requires the following features not present on the CPU
0:6
Unable to boot - please use a kernel appropriate for your CPU

Turns out, the problem was the wrong kernel was installed. Rescue Ubuntu, and install linux-generic. For reference, look at Unable to boot 8.04 Alpha 3 Server install on laptop and also the fix.

Playing with MySQL’s Online Backup

Something that has excited me for a long time with upcoming features in the MySQL Server, is online backup. Since seeing it first being demonstrated by Chuck Bell at the Heidelberg Developers Conference in 2007, I’ve been enthralled. Now you too, can try online backup.

If you’ve not read the Forge Wiki page about it yet, please head over to Online Backup on the Wiki. You can grab the latest source from mysql-6.0-backup from mysql.bkbits.net. If you’ve never built MySQL from source before, go ahead and read Building MySQL from source. And you naturally need to test it once built, so I suggest making use of MySQL Sandbox.

NOTE: mysql-6.0-backup is the MySQL Backup Team Tree, and frequently changes and can break sometimes. This is not for production use. It can eat babies.

So, you’ve got BitKeeper (bkf) built, you’ve checked out the code, you’ve built it, and you have a binary distribution.

Place the built version in a location that sanbox likes (/opt/mysql in my case). Now, run ./express-install.pl /opt/mysql/mysql-6.0.6-alpha-darwin9.2.1-i386.tar.gz. Once the install is completed, head over to ~/msb_6_0_6 and run ./use.

Backing up…

I now loaded the sakila sample database. Then, I proceeded to backup the database.

BACKUP DATABASE sakila TO 'sakila-backup.sql';
+-----------+
| backup_id |
+-----------+
| 1         | 
+-----------+
1 row in set (0.37 sec)

sakila-backup.sql is saved in your MySQL “data” directory, and in the case of the sandbox, its kept in your home directory.

du -sh ~/msb_6_0_6/data/sakila-backup.sql
1.9M	/Users/ccharles/msb_6_0_6/data/sakila-backup.sql

Out of curiosity, I ran file on the backup, and it was reported to be data (not ASCII English text, with very long lines):

file ~/msb_6_0_6/data/sakila-backup.sql
/Users/ccharles/msb_6_0_6/data/sakila-backup.sql: data

Once you’ve done the backup, you might want to check the state:

SELECT * FROM mysql.online_backup WHERE backup_id = 1 \G
*************************** 1. row ***************************
          backup_id: 1
         process_id: 0
         binlog_pos: 0
        binlog_file: NULL
       backup_state: complete
          operation: backup
          error_num: 0
        num_objects: 16
        total_bytes: 1654492
validity_point_time: 2008-05-03 18:55:19
         start_time: 2008-05-03 18:55:18
          stop_time: 2008-05-03 18:55:19
host_or_server_name: localhost
           username: msandbox
        backup_file: sakila-backup.sql
       user_comment:
            command: BACKUP DATABASE sakila TO 'sakila-backup.sql'
            engines: Default
1 row in set (0.00 sec)

online_backup provides statistics and metadata about a backup or restore. There is another table in the mysql database, that allows you to find progress information, and its called online_backup_progress.

If you run SELECT * FROM mysql.online_backup_progress WHERE backup_id = 1 \G, you’ll see notes changing from starting, running, validity point, running to complete.

Restoring…

Now, its time to restore. Note that the restore is what is known as a destructive restore (i.e. it will replace the current version of the database).

RESTORE FROM 'sakila-backup.sql';
+-----------+
| backup_id |
+-----------+
| 2         |
+-----------+
1 row in set (3.04 sec)

That’s it! You’ve restored your database. For posterity, here’s some statistics on the restore:

SELECT * FROM mysql.online_backup WHERE backup_id = 2 \G
*************************** 1. row ***************************
          backup_id: 2
         process_id: 0
         binlog_pos: 0
        binlog_file: NULL
       backup_state: complete
          operation: restore
          error_num: 0
        num_objects: 16
        total_bytes: 1654492
validity_point_time: NULL
         start_time: 2008-05-03 19:01:25
          stop_time: 2008-05-03 19:01:28
host_or_server_name: localhost
           username: msandbox
        backup_file: sakila-backup.sql
       user_comment:
            command: RESTORE FROM 'sakila-backup.sql'
            engines: Default
1 row in set (0.00 sec)

There you have it, MySQL 6.0’s Backup and Restore functionality. Still in its early stages of development, but very, very cool! All these features will also be available in MySQL 6.0.5, when this gets released…

Stewart and I on LugRadio

Stewart (Melbourne, Australia) and I (Kuala Lumpur, Malaysia) are featured in LugRadio Live! USA 2008. Why? We were one of the few people that travelled far enough to get to LugRadio Live.

27:30-27:40 in case you want to fast forward. “I don’t even know where Malaysia is!” exclaims someone on LugRadio. Definitely, grab the show, Season 5, Episode 16.

In the end we all get gifts… an Ubuntu book which I will eventually read.

For me, its an interesting change, writing “Kuala Lumpur, Malaysia” on things.

google visitor

NetBeans 6.1 with GlassFish, MySQL bundle

I couldn’t resist downloading NetBeans 6.1, with GlassFish and the MySQL bundle, the moment I found out it was released. Pulling it down while at the Star Alliance Gold lounge in Singapore was easy enough, and it only took me an hour (its a pretty big bundle – 164MB, as opposed to 6.0.1 where it only weighed in at 143MB for the OS X bundle).

Instead of the 4 packages in 6.0.1, I now only see 2 files – MySQL.prefPane (because we only fixed this in 5.0.51b, which probably didn’t make the release cut-off – the included version is 5.0.51a-community), and NetBeans IDE with MySQL.mpkg. The install is slated to take 526MB and takes a good two minutes.

I noticed that it doesn’t uninstall NetBeans 6.0.1, so my Applications folder now has two versions, including two versions of Glassfish (UR1 from 6.0.1 versus UR2 in 6.1). Upon starting 6.1, it does ask if I’d like to import settings from a previous version of NetBeans; of course I would.

You are then asked to register. I never looked at registering software as important, but I’m starting to think a lot more about it. One has to provide value, for a user to register – and we’ll explore this in another blog post. I’m writing this while on a plane, so it doesn’t make sense to register, anyway.

The first thing I do? Jump to the Services tab, make a connection to MySQL (look under Drivers -> MySQL (Connector/J driver)), and play with the sakila sample database.

NetBeans IDE 6.1 does queries in a GUI!
Design a query, using a GUI

Drill down into tables, find a table name (say, store if using the sakila sample database), drill down into a row, like store_id, right-click, and select Design Query. Now, feel free to drag tables and drop them, only to find that it now helps you create an ER diagram of your tables, while helping you design an appropriate query!

NetBeans IDE 6.1 does ER diagrams too!
ER diagrams for free

Play with the database tool a lot more. It looks like its got plenty of potential. It also looks like NetBeans is a great IDE for all your web development needs (PHP included). I’m certainly going to use it a lot more, even though I’m notably a vim guy.

OpenSolaris Summit, CommunityOne, JavaOne – big week ahead

I’m headed to the OpenSolaris Developers Summit right now.

After that, I’ll be at CommunityOne, with the rest of the MySQL team. Just check out the schedule (its in PDF format though). Its truly packed, so if you’ve not signed up to come, do so, immediately. I’m also particularly interested in participating in the RedMonk Unconference. All in all, I think CommunityOne looks like it would be well suited for a week-long event, rather than a day-long event – so many places to be, so little time!

And after that, JavaOne! Its going to be packed all week long, but the good news is that I’ll be in downtown San Francisco for most of it.

Expect plenty of notes soon.

Technorati Tags: , , , ,


i