Pages

Wednesday, April 13, 2016

Installing Oracle Linux 7 For Oracle Software Deployments

Installing Oracle Linux 7 For Oracle Software Deployments

This demo shows installation process of Oracle Linux 7 in virtual machine (VirtualBox) and basic OS configuration for further Oracle software deployments e.g., Oracle Databases, WebLogic Servers.

oracle_linux-7
1. Download Oracle Linux ISO image from Oracle Software Delivery Cloud
2. Download and install VirtualBox software, create new virtual machine and mount Oracle Linux ISO image.
3. Boot the virtual machine and install Oracle Linux.
4. Set SELinux to permissive mode
If the OS is to be used for an Oracle installation, it is easier if Secure Linux (SELinux) is disabled or switched to permissive. To do this edit the /etc/selinux/config file, making sure the SELINUX flag is set as follows.
SELINUX=permissive
If SELinux is configured after installation, the server will need a reboot for the change to take effect.
5. Stop the firewall
[root@localhost ~]#
systemctl stop firewalld
systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
6. Install oracle-rdbms-server-12cR1-preinstall and execute oracle-rdbms-server-12cR1-preinstall-verify
[root@demo ~]# yum install oracle-rdbms-server-12cR1-preinstall
...
[root@demo ~]# oracle-rdbms-server-12cR1-preinstall-verify
By installing oracle-rdbms-server-12cR1-preinstall package we automate the following:
  • installation of required software packages needed for database installation, with all dependencies
  • oracle account creation and groups: oinstall, dba
  • kernel parameters modification in /etc/sysctl.conf
  • settings for hard and soft shell resource limits in /etc/security/limits.conf
  • set of numa=off in the kernel boot parameters (for x86_64)
Let’s take a look and verify oracle user account:
[root@demo ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba)
Create additional groups and user account “grid”
[root@demo ~]# 
groupadd -g 54323 oper
groupadd -g 54324 grid
groupadd -g 54325 asmdba
groupadd -g 54326 asmoper
groupadd -g 54327 asmadmin

#user account grid (ASM admin and grid software owner)
[root@demo ~]# useradd -m -u 54322 -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -s /bin/bash grid
Alter oracle account for Job Role Separation (JRS) environments (Doc ID 1177483.1)
[root@demo ~]# usermod -m -u 54321 -g oinstall -G asmdba,dba oracle
We run Virtual Machine. Let’s set the x86 as the default boot kernel:
Display the menu entries that are defined in the configuration file, for example:
# grep '^menuentry' /boot/grub2/grub.cfg
menuentry 'Oracle Linux Server 7.1, with Linux 3.10.0-229.el7.x86_64' ...
menuentry 'Oracle Linux Server 7.1, with Unbreakable Enterprise Kernel 3.8.13-55.1.6.el7uek.x86_64' ...
menuentry 'Oracle Linux Server 7.1, with Linux 0-rescue-...

In this example for a BIOS-based system, the configuration file is /boot/grub2/grub.cfg, which contains menu entries 0, 1, and 2 that correspond to the x86, UEK, and the rescue kernel respectively.
Enter the following commands to make the x86 (entry 0) the default boot kernel:
# grub2-set-default 0
# grub2-mkconfig -o /boot/grub2/grub.cfg
Allow regular users to switch to oracle account by issuing sudo command as it has been described in this article Oracle user account – Linux good practice
Our existing regular user account is “neo”
[root@demo ~]# id neo
uid=500(neo) gid=500(users) groups=500(users)
Assign user “neo” to the following groups; “dba” and “wheel”
[root@demo ~]# usermod -g users -G dba,wheel,asmdba neo
[root@demo ~]# id neo
uid=500(neo) gid=500(users) groups=500(users),10(wheel),54322(dba),54325(asmdba)
Now we have to modify /etc/sudoers file to allow users in dba and wheel groups (optional) to use sudo (do not edit that file manually, use visudo tool instead):
[root@demo ~]# visudo
visudo: /etc/sudoers.tmp unchanged

#Add the following lines and save changes

#dba
%dba ALL = /bin/su - oracle, !/bin/su *root*

#asmdba
%asmdba ALL = /bin/su - grid, !/bin/su *root*

#wheel (optional)
%wheel ALL = /bin/su -
Login again as “neo” and test switching between oracle, grid and root accounts:
#Sudo to oracle account
[neo@demo ~]$ sudo su - oracle
[sudo] password for neo:******* 
[oracle@demo ~]$ logout
[neo@demo ~]$

#sudo to grid account:
[neo@demo ~]$ sudo su - grid
[grid@demo ~]$ logout

#sudo to root account

[neo@demo ~]$ sudo su -
[root@demo ~]# logout
[neo@demo ~]$
Create directory structure for future Oracle software deployments:
[root@demo ~]# 
mkdir -p /u01/app/oracle/product
chown -R oracle:oinstall /u01
chmod -R 775 /u01
Now Oracle Linux 7 server “seed” ready to be cloned and used for Oracle software installations.

No comments:

Post a Comment