S3 storage and Cloud Computing with Oracle 11g

I spent some time playing with the Amazon Cloud and Oracle today. I wanted to see if I could allocate some persistent storage with an instance so that I didn’t have to create a new repository every time I started an instance. I wanted to create an instance, store data there, and stop the instance. I didn’t want to have to reload the data or the instance every time I started.

I was reading LewisC’s blog and he suggested that you could not use the S3 storage for a file system. I didn’t think that was true so I thought I would play. It turns out that you can create a file system and even create a database in that area. Here are the steps.

1) create an S3 persistent storage area. I did this using the Elastifox extension to Firefox. This is done in the Volumes and Snapshots tab. If you click on the green + button it allows you to define a new storage. I created a 400G area just to see if I could create a file system of interest. When I did it assigned it to a VOL ID but did not populate anything else.

2) start an AMI. I did a simple search for an oracle instance and started an 11g 32-bit instance. Once I did this, I was able to use putty and login to the system as root and oracle. Setting this up did require downloading putty and puttygen. The puttygen was needed to convert the keys that aws generates into the right format for putty. Once I was able to do this, I could create to the public DNS instance name with the keys that aws generated.

3) once I had the instance started, I went back to the Volumes and Snapshots and associated storage with the running instance. I had to associate the storage with a device so I associated it with /dev/sdb. I chose this because /dev/sda is the default storage from the AMI.

4) After associating the S3 storage with the instance, I was able to treat it as a local disk. I partitioned it with fdisk and created a Linux partition and write the data to the partition. Since this was a simple test, I created one instance and only one instance thus I see /dev/sdb1.

5) Once I had a partition defined, I formatted the partition with a filesystem using the mkfs /dev/sdb1 command. This partitions the file system using the ext3 filesystem by default. I did not test any other file systems but I assume that you could do something like reiser or newer filesystem.

6) Once I had a formatted partition, I was able to mount it. I first had to create /u03 with the mkdir /u03 command. I then mounted the file system with the mount /dev/sdb1 /u03 command. To make this persistent I had to edit the /etc/fstab file with the following line:
/dev/sdb1 /u03 ext3 defaults 1 3

7) I can verify that the file system exists with the df -k command. I should see
/dev/sdb1 412843916 3434932 388437736 1% /u03
as one of the lines.

8) now that I have the file system created and mounted I can run_dbca.sh as root and create a database on the file system.