Wednesday, November 8, 2017

Getting Oracle Linux on Amazon EC2

Edit 08-Nov-2017:

As per Oracle's instructions - https://linux.oracle.com/switch/centos/ adding the GPG key is no longer neededthe bad news is - the procedure documented by Oracle throws a "Broken pipe" error, and the OS left in an unusable state (all Yum configuration disappears):



How to fix (basically just nohup the script).

Start with the CentOS 6 (x86_64) - with Updates HVM on the AWS Marketplace (provided by CentOS.org). After logging in (as the centos user) run the following commands as root:

1
2
curl -O https://linux.oracle.com/switch/centos2ol.sh
nohup sh centos2ol.sh &

The script does some package updating that cuts the SSH connection to the EC2 instance, and when the connection gets cut, the script dies in the middle with a "Broken pipe" and leaves the OS in an unusable state. By using nohup we avoid the broken pipe issue.

After the conversion script completes, run the following:

1
yum distro-sync

Step 4 will no longer be required, and you can proceed to install the Oracle software prerequisites.

Old Information Below:

If you feel the need to roll your own Oracle Linux install on Amazon EC2 (since Oracle no longer provides an officially-supported AMI, and you may not be too keen on using one of the community AMI's):

(1) launch an EC2 image using the CentOS 6.5 AMI from the Marketplace (which is free..) then log in as root (not ec2-user)

(2) import the Oracle GPG key
1
2
cd /etc/pki/rpm-gpg/
curl -O https://oss.oracle.com/ol6/RPM-GPG-KEY-oracle

(3) use the Oracle specific rules to convert the CentOS 6 to OL from this documentSpecifically, run the following commands as root:
1
2
curl -O https://linux.oracle.com/switch/centos2ol.sh
sh centos2ol.sh

(4) Synchronize the yum repository
1
yum -y upgrade

Once the command completes, the end-user should have a fully-patched Oracle Linux 6.7.

If you intend to install Oracle Database 11gR2, you can apply all the necessary packages and kernel parameters with this command:
1
yum install oracle-rdbms-server-11gR2-preinstall -y

and if you will install Oracle Database 12c R1, use the following:
1
yum install oracle-rdbms-server-12cR1-preinstall -y