Friday, June 1, 2018

Installing Oracle XE 11g r2 on Amazon EC2

Add a disk via EC2 console and setup it up in linux

mkfs -t ext4 /dev/xvdb
mkdir /u01

Find out the uuid of the disk
ls -al /dev/disk/by-uuid/

Add the following line to /etc/fstab to mount the disk at boot time
UUID=82497d4a-9507-47db-b19c-c4473827ead6 /u01   ext4    defaults,nofail        0       2

Mount the disk and verify fstab syntax
mount -a

Add Swap space

dd if=/dev/zero of=/swapfile bs=1024 count=3072000
mkswap /swapfile
swapon /swapfile

Add the following line to /etc/fstab to enable swap at boot time
/swapfile swap swap defaults 0 0

Mount the swap and verify fstab syntax
mount -a

Add oracle group and user

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba,oinstall oracle
chown -R oracle:oinstall /u01
passwd oracle

Add the following lines to /etc/security/limits.conf
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240

Install Oracle

yum install glibc make binutils gcc libaio
rpm -i oracle-xe-11.2.0-0.5.x86_64.rpm
/etc/init.d/oracle-xe configure

Add the following lines to ~oracle/.bash_profile

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE

PATH=$PATH:$ORACLE_HOME/bin:$HOME/.local/bin:$HOME/bin
export PATH

No comments:

Post a Comment