Installing An Oracle-Ready CentOS 6.2 Server
On this page
This is how to for installing an Oracle-ready Linux box with CentOS 6.2, It covers the steps involved on the preparation of an Oracle-ready server for the further installation of Oracle Database Server/Oracle Fusion Middleware Suite on a multi-role server deployment.
Requirements
- An USB stick with more than 4 GB of free storage
- A 64 bits server machine with plenty RAM and HDD storage
- Connectivity with CentOS Internet repositories or LAN mirrors
- A Linux client machine with an installed desktop environment: CentOS, Debian, Ubuntu, etc. + Gnome, KDE, etc.
Steps
- Download a CentOS-6.2-x86_64-bin-DVD1.iso (4.1GB) from the DVD mirrors or alternative download a minimal (322M), netinstall (227M), LiveCD (698M) or LiveDVD (1.6G) version. This how to uses CentOS-6.2-x86_64-bin-DVD1.iso (4.1GB).
- Store the downloaded ISO into de USB key via this guide. I prefer the alternatives section with livecd-iso-to-disk script.
- Connect the USB stick to one of the USB ports on the server machine and boot. Ensure that USB boot is enabled on the setup.
- On the CentOS installation wizard select Server and customize.
- Choose a wise partition schema depending on your hardware, for example 6 GB RAM + 2 x 500GB HDD:
/ ext4 60GB /boot ext4 130M /home xfs ~403GB /opt xfs ~240GB /var xfs ~210GB swap swap 12GB
- On the package selection step ensure that no desktop environment is selected and ensure that ssh is installed. Select any additional package you want.
- Choose a complex root password.
- Once the OS installation is completed, reboot, login as root and ensure that ssh is working via:
$ ssh localhost
- By default, the eth0 network interface is disabled. Configure networking settings:
- Login as root
- Edit the archive /etc/sysconfig/network-scripts/ifcfg-eth0 and configure the network interface to look like:
DEVICE="eth0" HWADDR="00:1C:C0:95:59:55" NM_CONTROLLED="yes" ONBOOT="yes" NETWORK=192.168.192.0 NETMASK=255.255.255.0 IPADDR=192.168.192.201 GATEWAY=192.168.192.1 DNS1=192.168.192.2 DNS2=192.168.192.2 PEERDNS="yes"
- Restart networking daemon and test for connectivity with ping or other tool.
- Add a sudoer user -for example bozz- to avoid the use of root.
- Login as root
- Create a new user and add it to wheel group:
$ adduser -G wheel bozz
- Reset the password for bozz user (NOTE: choose a password you won't forget):
$ passwd bozz
- Edit /etc/sudoers and uncomment the line starting with %wheel, it shall look like:
%wheel ALL=(ALL) ALL
- Logout, login again with bozz user and test sudoer's privileges:
$ sudo ls -hal
NOTE: From now, I only use the bozz user instead of root. You can also (optionally) disable the root account from remote access for security reasons.
- Login as bozz user
- Configure CentOS repositories via LAN mirrors:
- Ensure you can connect to the LAN mirror, example: http://mirrors.home.dev/centos
$ pushd /tmp $ wget http://mirrors.home.dev/centos $ popd
- Create a new repo file at /etc/yum.repos.d/CentOS-Mirror.repo
$ sudo nano /etc/yum.repos.d/CentOS-Mirror.repo
- Append the following entries pointing to the mirror:
[base] name=CentOS-$releasever - Base baseurl=http://mirrors.home.dev/centos/$releasever/os/$basearch/ gpgcheck=0 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://mirrors.home.dev/centos/$releasever/updates/$basearch/ gpgcheck=0 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras baseurl=http://mirrors.home.dev/centos/$releasever/extras/$basearch/ gpgcheck=0
- Comment or delete existing repository archives
- comment every line of /etc/yum.repos.d/CentOS-Base.repo with # or just:
- delete the repository file
$ sudo rm /etc/yum.repos.d/CentOS-Base.repo
- Update the system using the mirror:
$ sudo yum update
- Install Java JRE 7u1 64 bit on the server [Not required for Oracle Database, required for Oracle Fusion Middleware Suite]:
- Goto http://www.oracle.com/technetwork/java/javase/downloads/index.html and download jre-7u1-linux-x64.rpm
- Copy jre-7u1-linux-x64.rpm to the server via scp or other. Via scp from the Linux client:
$ scp jre-7u1-linux-x64.rpm bozz@SERVER:~/
- Login into server and run installer:
$ sudo rpm -Uvh jre-7u1-linux-x64.rpm
- Make use of Java JRE absolute version (/usr/java/jre1.7.0_01) in the alternatives configuration for java and javaws:
$ sudo alternatives --install /usr/bin/java java /usr/java/jre1.7.0_01/bin/java 20000 $ sudo alternatives --install /usr/bin/javaws javaws /usr/java/jre1.7.0_01/bin/javaws 20000
- Ensure the correct java version:
$ java -version java version "1.7.0_01" Java(TM) SE Runtime Environment (build 1.7.0_01-b08) Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode)
- Ensure that the alternatives is properly configured:
$ alternatives --config java There is 1 program that provides 'java'. Selection Command ----------------------------------------------- *+ 1 /usr/java/jre1.7.0_01/bin/java Enter to keep the current selection[+], or type selection number: $ alternatives --config javaws There is 1 program that provides 'javaws'. Selection Command ----------------------------------------------- *+ 1 /usr/java/jre1.7.0_01/bin/javaws
- Configure JRE_HOME system-wide environment variable. Edit /etc/environment:
$ nano /etc/environment
- Append the following content:
export JRE_HOME=/usr/java/jre1.7.0_01
- Logout and login again and test if JRE_HOME environment variable is correct:
$ echo $JRE_HOME /usr/java/jre1.7.0_01 $ ls -1 $JRE_HOME bin COPYRIGHT lib LICENSE man plugin README release THIRDPARTYLICENSEREADME.txt Welcome.html
- Prepare the CentOS server for installing Oracle products without sacrifice performance with a graphical environment. Oracle Fusion Middleware products use an X11 graphical environment on installation wizards. So the SSH X11 Forwarding should be installed and enabled.
- On the server, edit /etc/ssh/sshd_config:
$ sudo nano /etc/ssh/sshd_config
- Set the following values:
X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost yes
- On the server, install the packages xorg-x11-xauth and libXtst:
$ sudo yum install xorg-x11-xauth libXtst
- On the client, install the fontconfig packages xorg-x11-fonts-base and liberation-fonts:
- for a CentOS client:
$ sudo yum install xorg-x11-fonts-base liberation-fonts
- for Ubuntu client:
$ sudo apt-get install xfonts-base ttf-liberation
- On the client, try to login to the remote server using "-Y" option:
$ ssh -Y bozz@SERVER
- Remotely logged, try to run your X program, such as the xterm or other:
$ sudo yum install xterm $ xterm
- And you shall see the X program pop up in your local desktop. You can also add the following into your
$HOME/.ssh/config
- :
ForwardAgent yes ForwardX11 yes ForwardX11Trusted yes
References
- Networking on CentOS: http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s2-networkscripts-interfaces-eth0.html
- For Java: http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/ and http://wiki.centos.org/HowTos/JavaOnCentOS
- SSH X11 Forwarding: http://www.imminentweb.com/technologies/centos-ssh-x11-forwarding, http://wiki.centos.org/HowTos/VNC-Server and http://www.ndchost.com/wiki/server-administration/centos5-vnc-x11