Wednesday, November 18, 2015

Creating a test Oracle Database on Amazon web Services

So, the latest buzzword is 'Cloud', and Oracle are pushing this at OpenWorld. With this in mind, I thought I'd see if I could create an Oracle database on Amazon Web Services.

Is is surprisingly easy...

Create an AWS account

If you don't already have one, create an account:


Click on the 'Get Started for Free' button.

Enter an email address or mobile number and select 'I am a new user' and click on 'Sign in using our secure server'.

Fill in the fields in the Login credentials page and click 'Create Account'

Check the 'Personal' box and fill in the fields.

Note – you need to enter your real phone number because it calls you and asks to enter a verification code.

Click on 'Create Account and Continue'.

It will show you the plan details which should be plenty for a test database. You also need to credit card details so they can bill you if you exceed the terms, so try not to.

Click on 'Continue'.

It will then call your phone and ask you to enter a verification code.


Once done, you will also be sent confirmation emails and can then sign into the console.

Sign into the console

If not redirected, go here : http://aws.amazon.com/

Click on 'Sign In to the Console', enter the username and password and click on 'Sign in using our secure server'.

You will be presented with a page full of stuff:


The one you are interested in is the 'RDS' under 'Database', middle left of the page:


So click on that.

Then click on the 'Get Started Now' button.

At the next page, click on Oracle


At the next screen, select 'Oracle SE One' – I don't know if it will prompt for licence details for the others, and since this is a test, SE One is fine.




At the next page, check the 'No' box – otherwise it might charge your credit card - it might not, but I'm not game to try...

Click 'Next Step'

Fill in the fields – I've made it the smallest so that my credit card doesn't get charged.


Click 'Next Step'

I don't know what most of these are, so I let them default except for the name. I also selected 'default (VPC)'.




Click 'Launch DB Instance'

Click on the 'View Your DB Instances' link.

You should see this:


It will take around 20-30 minutes to create, so you can't do anything for a while.

Viewing your instances later

I had a bit of trouble finding the main status page later – this is where it is.


Click on 'Sign into the Console'

Enter your username and password and click on 'Sign in to our secure server'.

At the main AWS page, click on the 'RDS' icon (middle-left of page).

Click on 'Instances'

You should see this:



You can then click on the 'Show Monitoring' button to see charts of the activity, create alerts etc (which I'll do next time).

Connecting to the database with SQL Developer

The database won't be available for a while as it's being created, maybe 30 minutes or so.

After that time, click on the small arrow next to the database and you will see a field 'Endpoint'. 

If this says 'Not Yet Available' then you need to wait.

If it's ready, it will show something like this (I've obscured mine for obvious reasons):


Go to SQL Developer (or SQL Plus) and enter this as the connection info, using the username / password when you set it up:



Click on 'Test', if all is OK it will work.

Mine stopped working because it created another security group for some reason.

So if you get a 'file I/O' error when trying to connect, the same thing may have happened to you.


Go to the RDS Console, show the instance details and hover the mouse over the 'I' icon next to 'Endpoint':


Note the Security Group – click on the link.


It will open a new page with the security group shown. Click on 'Actions' and select 'Edit inbound rules':



Use the drop-down to select 'Anywhere' under the source, then Save:



Click on 'Save' and then 'Connect'..

Congratulations, you now have an Oracle database in the cloud. 

Next time I'll look at monitoring and alerting.




















Tuesday, October 6, 2015

Installing Oracle using a response file

Another day, another task that I haven't had to do for ages.

I was asked to install Oracle (Standard Edition, but that's not important) onto a unix host, so copied the files, fired up my X-windows server (I use MobaXterm, it can run off a USB), logged into the host, set the DISPLAY variable and ran ./runInstaller.

And nothing happened for a while until this:

Checking monitor: must be configured to display at least 256 colors
    >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.    Failed <<<<

I figured it could be the firewall rules on my PC which I don't have admin rights on.

After trying a few things I decided it wasn't going to work, so looked at running the install in silent mode with a response file, something I haven't done for a while.

There are sample response files in the directory where the software was extracted:

/comms/oracle/orabackup/software/database/response

The install one is called

db_install.rsp

I copied that as a backup and moved it to the parent directory.

The instructions are really good, although there are a couple of things that caught me out.

Edit the file and scroll through, making the appropriate changes.

These are the options I changed:

oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=hostname_goes_here

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/comms/oracle/oraInventory

SELECTED_LANGUAGES=en

ORACLE_HOME=/comms/oracle/product/11.2.0.2/cmssse

ORACLE_BASE=/comms/oracle/product

oracle.install.db.InstallEdition=SE

oracle.install.db.EEOptionsSelection=false

oracle.install.db.DBA_GROUP=dba

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE


I didn't want to create a database at the time of install, so left all the stuff about the starter database blank or default, then carried on with the changes.

MYORACLESUPPORT_USERNAME=someone@somewhere.com

MYORACLESUPPORT_PASSWORD=xxxxxxxxxxxx


The rest I left alone.

The ones that caught me out were the ORACLE_BASE - it was the same as the user home directory and the installer objected to that so I changed it in the file.

It also needs something in the MYORACLESUPPORT fields - even though the host can't connect to the outside world, the installer failed when I left it blank.

Once the file had been saved, but before I ran the installer, I backed up the existing oraInventory directory just in case things went pear-shaped.

Then I ran the command (this is all on one line):

./runInstaller -silent -noconfig -responseFile /comms/oracle/orabackup/software/database/db_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 3302 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 49359 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-10-07_01-28-05AM. Please wait ...


It didn't take long, and then prompted for root.sh to be run:

As a root user, execute the following script(s):
        1. /comms/oracle/product/11.2.0.2/cmssse/root.sh

Successfully Setup Software.

I checked the new ORACLE_HOME location and all the binaries were there, so it looked as if it worked OK.

Next thing I did was to create a dummy database to make sure it was all good.