Tuesday, July 10, 2007

DB2 on a vmware guest linux OS

we are working with DB2 UDB v9. Since we are still on the bleeding edge the changes to database schema are very frequent and huge. we do not even attempt to publish the patches. For QA and production we are maintaining a set of magic unix shell scripts that creates the database and all the related stuff in one shot. so far so good. Run a script and everything is fine. Only issue is, these scripts are supposed to be used on a unix box.

Unfortunately, my development box is windows XP. I was in need of a local copy of DB2 so that i can work even when i am not connected to office databases. I tried running DB2 on my XP laptop but maintenance was a big nightmare. (Because of the way we are doing things, nothing else!)

So finally, one fine day , I decided to ditch windows copy of DB2 in favor of DB2 running on a linux guest OS using vmware on my XP box. The advantages are
  • I can decide when i want to run DB2. Not like my windows copy of DB2 that keeps running so many services no matter that. ( I could not figure out a way to turn them off when not in use)
  • RAM is adjustable . so far i have given my linux guest 512 MB out of my 2 GB.
  • Looks like a clean solution , I can keep running both the OS.
  • Most important of all, maintenance is easy for me, I can just run the unix scripts used by QA and production guys.
Now for the installation and how to do it on your machine.

Install vmware server on your windows XP box. You will need a key for your copy of vmware server. The keys can be obtained from the vmware website. Once you have punched in the keys and started vmware server, Add a new virtual machine. The steps are very straight forward. Only thing you have to think about is , how to do the networking stuff and the size of your virtual machine on disk . I went with the bridge mode in networking. I want to assign one IP to my XP box and one IP to my guest OS.

After creating the virtual machine, pop in the linux distro CD inside your CD drive. ( I used open suse but i guess you can work with other distros as well) After that it was usual suse install process. I wanted a small system so i had assigned 8 GB for my guest OS. I did not install 1000+ utilities also , just the basic stuff. Once the guest OS install is over, you should verify that you can connect to the outside world from your guest OS and vice versa. Like I said, i have two IPs , one for my vmware interface and one for my XP interface.

After that , just start the guest OS and it is like any other linux machine to the outside world.
© Life of a third world developer
Maira Gall