Installing Oracle Linux 6.6, Prepping Linux OS for Oracle Database 12c Install, and Installing Oracle Database 12c

Installing Oracle Linux 6.6, Prepping Linux OS for Oracle Database 12c Install, and Installing Oracle Database 12c

I know it seems simple to install Linux and Oracle Dtaabase. But I felt a need to standardize on how we do it internally at Viscosity. So I provided this little note to our DBA team to build out a new Oracle Database 12c on Linux 6.6 server.  There are options also for configuring for VMWare as well.  PS, Thx to EMC folks for helping out w/the hardware config

In this example, we will be implementing 12c Grid Infrastructure/Automatic Storage Management and create two disk groups (data and deco)  using four-disks each.

Installing Oracle Linux 6.6
1. Insert the Oracle Linux 6.6 DVD into the server, and boot to it.
2. Select Install or upgrade an existing system
3. Skip
4. In the opening splash screen, select Next.
5. Choose the language you wish to use, and click Next.
6. Select the keyboard layout, and click Next.
7. Select Basic Storage Devices, and click Next.
8. Select Fresh Installation, and click Next.
9. Insert the hostname, and select Configure Network.
10. In the Network Connections menu, configure network connections.
11. After configuring the network connections, click Close.
12. Click Next.
13. Select the nearest city in your time zone, and click Next.
14. Enter the root password, and click Next.
15. Select Use All Space, and click Next.
16. When the installation prompts you to confirm that you are writing changes to the disk, select Write changes to disk.
17. Select Software Basic Server, and click Next. Oracle Linux installation begins.
18. When the installation completes, select Reboot to restart the server.

Initial configuration tasks
Complete the following steps to provide the functionality that Oracle Database requires. We performed all of these tasks as root.
Disable firewall services. In the command line (as root), type:
 # service iptables stop
# chkconfig iptables off
# service ip6tables stop
# chkconfig ip6tables off

Set SELinux:
 # vi /etc/selinux/config

SELINUX=permissive

Modify /etc/hosts to include the IP address of the internal IP and the hostname.
Edit 90-nproc.conf:

# vi /etc/security/limits.d/90-nproc.conf
 Change this:
 * soft nproc 1024

To this:
 * – nproc 16384

Install 12c RPM packages, resolve package dependencies, and modify kernel parameters:                                        

# yum install oracle-rdbms-server-12cR1-preinstall–y

Install automatic system tuning for database storage through yum:
 # yum install tuned
# chkconfig tuned on
# tuned-adm profile enterprise-storage

Using yum, install the following prerequisite packages for Oracle Database:
 # yum install elfutils-libelf-devel
# yum install xhost
# yum install unixODBC
# yum install unixODBC-devel
# yum install oracleasm-support oracleasmlib oracleasm

Create the oracle user account and groups and password:

 # groupadd -g 6003 oper
 # groupadd -g 6004 asmadmin
 # groupadd -g 6005 asmdba
 # groupadd -g 6006 asmoper
 # usermod -G dba,oper,asmadmin,asmdba,asmoper oracle # passwd oracle

Create the /u01 directory for Oracle inventory and software and give it to the oracle user:

 # mkdir -p /u01/app/oracle/product/12.1.0/grid
 # mkdir -p /u01/app/oracle/product/12.1.0/dbs                                                 
# chown -R oracle:oinstall /u01
 # chmod -R 775 /u01

Optionally, edit bash profiles to set up user environments:
# vim /home/oracle/.bash_profile

Adding the four data and four log drives to the VM and modifying the vmfx file
1. Power off the VM.
2. Right-click the VM in the vSphere Web Client, and choose Edit Settings…
3. Click on the VM Options tab, and expand the Advanced menu option.
4. Choose Edit Configuration…
5. Click Add Row, and enter disk.EnableUUID in the parameter field and TRUE in the value field.
6. Go back to the Virtual Hardware tab.
7. Click the drop-down menu for New device, and choose New Hard Disk.
8. Name the Hard Disk and choose the size that you want it to be.
9. Repeat steps 7 and 8 for all remaining drives.
10. Click OK.
11. Power the VM back on.

 Configuring disks for ASM
For each of the eight shared disks, create a GPT label, and create one partition. For example, see the following shell script:
 for disk in sdb sdc sdd sde sdf sdg sdh sdi; do
parted /dev/$disk mklabel gpt
parted /dev/$disk mkpart primary “1 -1″
 done

If desired, label the disk’s partition with its Oracle function. For example:
 # parted /dev/sdc name 1 DATA1
# parted /dev/sdd name 1 DATA2
# parted /dev/sde name 1 DATA3
# parted /dev/sdf name 1 DATA4
# parted /dev/sdg name 1 LOG1
# parted /dev/sdh name 1 LOG2
# parted /dev/sdh name 1 LOG3
# parted /dev/sdi name 1 LOG4

Initialize Oracle ASM on each server by executing the following commands as root on each node.
 oracleasm init
oracleasm configure -e -u grid -g oinstall -s y -x sda

Label each shared disk-partition with an appropriate ASM name. For example, following the OS partition names
created above, execute the following commands on one system:
 # oracleasm createdisk DATA1 /dev/sdc1
# oracleasm createdisk DATA2/dev/sdd1
# oracleasm createdisk DATA3 /dev/sde1
# oracleasm createdisk DATA4 /dev/sdf1
# oracleasm createdisk LOG1 /dev/sdg1
# oracleasm createdisk LOG2 /dev/sdh1
# oracleasm createdisk LOG3 /dev/sdi1
# oracleasm createdisk LOG4 /dev/sdj1

On each server, scan the disks to make the disks immediately available to Oracle ASM.
 # oracleasm scandisks
# oracleasm listdisks

Installing Oracle Grid Infrastructure 12c
1. Log in as the oracle user.
2. Unzip linuxamd64_12c_grid_1of2.zip and linuxamd64_12c_grid_2of2.zip
3. Open a terminal to the unzipped database directory.
4. Type grid_env to set the Oracle grid environment.
5. To start the installer, type./runInstaller
6. At the Updates screen, select Skip updates.
7. In the Select Installation Option screen, select Install and Configure Grid Infrastructure for a Standalone Server,and click Next.
8. Choose the language, and click Next.
9. In the Create ASM Disk Group screen, choose the Disk Group Name, and change redundancy to External.
10. Select the four disks that you are planning to use for the database, and click Next.
11. In the Specify ASM Password screen, choose Use same password for these accounts, write the passwords for the ASM users, and click Next.
12. Leave the default Operating System Groups, and click Next.
13. Leave the default installation, and click Next.
14. Leave the default inventory location, and click Next.
15. Under Root script execution, select Automatically run configuration scripts and enter root credentials.
16. In the Prerequisite Checks screen, make sure that there are no errors.
17. In the Summary screen, verify that everything is correct, and click Finish to install Oracle Grid Infrastructure.
18. At one point during the installation, the installation prompts you to execute two configuration scripts as root.

Follow the instructions to run the scripts.
19. At the Finish screen, click Close.
20. To run the ASM Configuration Assistant, type asmca.
21. In the ASM Configuration Assistant, click Create.
22. In the Create Disk Group window, name the new disk group log, choose redundancy External (None), and select the four disks for redo logs.
23. Click Advanced Options, and type 12.1.0.0.0 in ASM Compatibility and Database Compatibility. Click OK.
24. Right-click the DATA drive, and choose Edit Attributes. Make sure both ASM and Database Compatibility fields list 12.1.0.0.0, and click OK.
25. Exit the ASM Configuration Assistant.

Installing Oracle Database 12c
1. Unzip linuxamd64_12c_database_1_of_2.zip and linuxamd64_12c_database_2_of_2.zip.
2. Open a terminal to the unzipped database directory.
3. Type db_env to set the Oracle database environment.
4. Run ./runInstaller.sh.
5. Wait for the GUI installer loads.
6. On the Configure Security Updates screen, enter the credentials for My Oracle Support. If you do not have an account, uncheck the box I wish to receive security updates via My Oracle Support, and click Next.
7. At the warning, click Yes.
8. On the Download Software Updates screen, enter the desired update option, and click Next.
9. On the Select Installation Option screen, select Install database software only, and click Next.
10. On the Grid Installation Options screen, select Single instance database installation, and click Next.
11. On the Select Product Languages screen, leave the default setting of English, and click Next.
12. On the Select Database Edition screen, select Enterprise Edition, and click Next.
13. On the Specify Installation Location, leave the defaults, and click Next.
14. On the Create Inventory screen, leave the default settings, and click Next.
15. On the Privileged Operating System groups screen, keep the defaults, and click Next.
16. Allow the prerequisite checker to complete.
17. On the Summary screen, click Install.
18. Once the Execute Configuration scripts prompt appears, ssh into the server as root, and run the following command:

# /home/oracle/app/oracle/product/12.1.0/dbs/root.sh
19. Return to the prompt, and click OK.
20. Once the installer completes, click Close.