Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Installing Oracle Database 12c R1 On Linux 6 With ASM

Download as pdf or txt
Download as pdf or txt
You are on page 1of 47

Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 1

Tutorial Target
Installing Oracle Database 12c R1 on Linux 6 with ASM

Required Software Oracle VirtualBox software, version 5. This tutorial was implemented on VirtualBox 5.0.20 for Windows which
and Packages can be downloaded from Oracle web site.
Oracle Virtualbox VM appliance which has a fresh installation of Oracle Linux 6.7 (seed VM).
o The procedure to create it from scratch is documented here, or can be watched at Youtube here.
o Alternatively, you can download a pre-built one from here.

Oracle Grid Infrastructure 12c R1 (12.1.0.2) installation files. This can be downloaded from Oracle site.
Search for a page titled Oracle Grid Infrastructure Downloads. At the time of this writing, its link is here.

Oracle Database 12c R1 (12.1.0.2) for Linux 64-bit installation files

WinSCP utility: to copy the files to and from the Oracle VM box
Xming : to display the GUI windows in your hosting Windows PC. Just look for its download page, download it,
and install it using Full Installation option. It is straight forward.

Putty : which provides a command line prompt to connect to a Linux server from Windows

Version / Date 1.0, Aug-2016


Required Hardware Memory to run the VM machine: 4 GB
Expected storage space needed to hold the VM appliance: 40 GB

Tutorial Target and Description


This tutorial describes the hands-on practical procedure to install Oracle Database 12c R1 (12.1.0.2) on a Linux server 64-bit (Oracle Linux 6.7).
This appliance will be later used in the practices of this course.

Note: If you have your own Virtual machine which has Oracle 12c Database installed in it, you can use it for the course practices and skip all
this practice. However, all the code examples in the course were derived from a virtual appliance that had been built using this practice.
Therefore, I recommend you to build a virtual appliance using this practice tutorial.

Practice Plan
1. Clone the Oracle Linux pre-built VM appliance from a seed

2. Create virtual hard disks for ASM

3. Alter network configuration and hostname

4. Set up environment variables for OS accounts: grid and oracle

5. Install Oracle ASM packages

6. Create ASM disk volumes

7. Install Oracle Grid Infrastructure software

8. Create ASM disk groups

9. Install Oracle database software

10. Create an Oracle database

Note: Download the required software and packages before you start implementing the tutorial.

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 2

Installation Architecture
The tutorial builds a system with the following architecture diagram:

Host

Database Instance ASM Instance

SID: ORADB
SID: +ASM
ver.: 12.1.0.2
ver.: 12.1.0.2
Non-CDB
/u01/app/12.1.0/grid
/u01/app/oracle/
owner: grid
product/12.1.0/db_1
owner:oracle

ASM Disk Group


Hostname: srv1.localdomain
OS: Linux 6.7 x86 64-bit +CRS ( 2GB )

+DATA ( 50GB )

+FRA ( 50GB )

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 3

Tutorial Procedure
1. Clone the Oracle Linux pre-built VM appliance from an Oracle VirtualBox which has a fresh
installation of Oracle Linux 6.7 64-bit
Make sure you have enough free disk space to clone the appliance

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 4

Depending on your hardware specs, it roughly may take between 10 and 40 minutes to finish.

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 5

2. Create virtual hard disks for ASM


We create 3 virtual disks CRSDISK1 (2GB), DATADISK1(50GB) & FRADISK1(50GB).

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 6

Repeat the procedure to create DATADISK1(50GB) & FRADISK1(50GB).

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 7

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 8

3. Alter network configuration and hostname

Make the Network Adapter Bridged:

First, make sure the Network adapter in the appliance settings is attached to Bridged Adapter. This will make your VM appliance appears in your
network as a separate host and will be assigned an IP address based on your network configuration. For more information, check out this
documentation.

Fix the MAC Address of the eth0

When you make a clone of a VM appliance, the MAC address of the network card of the cloned appliance will be changed. This will make Linux
add a new device eth1 and the old one eth0 will be inactive. You need to fix this later in the practice.

Obtain the new MAC address from the Settings of the Clone appliance:

Startup the VM appliance and login as root.

Make sure the firewall is disabled

service iptables stop


chkconfig iptables off

Open a terminal window and edit the udev rule for network devices /etc/udev/rules.d/70-persistent-net.rules

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 9

Delete the section lines in the file that belongs to the old MAC address, i.e. delete the rule for eth1

Copy the new mac address to the line of your eth0:

Enter the new MAC address in the file /etc/sysconfig/network-scripts/ifcfg-eth0 as well:

Reboot

Perform the Network configuration


Obtain the DNS sever IP address configured in your network because later we will need to set the DNS server in the VM appliance.

Note: If you do not know the DNS IP address in your network, try the following command in the command prompt in the host machine

C:\>ipconfig /all | find "DNS"


..
Connection-specific DNS Suffix . :
DNS Servers . . . . . . . . . . . : 192.168.1.1
..

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 10

Obtain the IP address assigned to the VM appliance and take a note of it.

We are going to make the IP Address assigned to the appliance a static IP.

Login as root and open a terminal window.

Run system-config-network command.

The utility window will open. Make sure the Device Configuration select and press ENTER

Select eth0 and press ENTER

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 11

Enter the IP address of the machine and DNS and Gateway IP addresses taken from the previous step:
Note: if you find an asterisk symbol on the Use DHCP, you can remove it using the SPACE key on the keyboard.

Confirm the configuration modifications in /etc/sysconfig/network-scripts/ifcfg-eth0 :

[root@srv1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0


DEVICE=eth0
TYPE=Ethernet
UUID=92a5490b-1a26-46ea-8806-2d61037cdb56
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
#HWADDR=08:00:27:A0:83:DF
HWADDR=08:00:27:0a:a2:08
DEFROUTE=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
DNS2=192.168.1.1
DNS1=192.168.1.1
USERCTL=no

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 12

IPADDR=192.168.1.144
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

Update /etc/hosts file

vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.1.144 srv1.localdomain srv1

Test the changes:

[root@srv1 ~]# ping srv1


PING srv1.localdomain (192.168.1.144) 56(84) bytes of data.
64 bytes from srv1.localdomain (192.168.1.144): icmp_seq=1 ttl=64 time=0.015 ms
64 bytes from srv1.localdomain (192.168.1.144): icmp_seq=2 ttl=64 time=0.024 ms
^C

Reboot

Connect to the VM appliance using Putty


Putty is a nice utility which provides a command prompt from Windows client to connect to Linux server. Lets configure it here to connect to our
VM appliance.

Start Putty and connect to the VM:

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 13

Configure the connection to make alive, as follows:

You can control the font in the command prompt as follow:

Save the configuration and connect:

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 14

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 15

4. Set up environment variables for OS accounts: grid and oracle

Open terminal window and as oracle make a backup copy of the bash profile file:

su - oracle
mv ~/.bash_profile ~/.bash_profile_bkp

Add the following to the file:

vi ~/.bash_profile

Paste below code to /home/oracle/.bash_profile file

# .bash_profile

# ---------------------------------------------------
# .bash_profile
# ---------------------------------------------------
# OS User: oracle
# Application: Oracle Database Software Owner
# Version: Oracle 12c Release 1
# ---------------------------------------------------
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# ---------------------------------------------------
# ORACLE_SID
# ---------------------------------------------------
# Specifies the Oracle system identifier (SID) CASE SENSITIVE
ORACLE_SID=ORADB; export ORACLE_SID
# ---------------------------------------------------
# ORACLE_UNQNAME
# ---------------------------------------------------
# Set ORACLE_UNQNAME equal to the database unique name.
# ---------------------------------------------------
ORACLE_UNQNAME=ORADB; export ORACLE_UNQNAME
# ---------------------------------------------------
# JAVA_HOME
# ---------------------------------------------------
JAVA_HOME=/usr/bin/java; export JAVA_HOME
# ---------------------------------------------------
# ORACLE_BASE
# ---------------------------------------------------
# Specifies the base of the Oracle directory structure
# for Optimal Flexible Architecture (OFA) compliant
# database software installations.
# ---------------------------------------------------
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
# ---------------------------------------------------
# ORACLE_HOME
# ---------------------------------------------------
# Directory containing the Oracle Database software.
# ---------------------------------------------------
ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1;
export ORACLE_HOME

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 16

# ---------------------------------------------------
# ORACLE_TERM
# ---------------------------------------------------
# Defines a terminal definition. If not set, it
# defaults to the value of your TERM environment
# variable. Used by all character mode products.
# ---------------------------------------------------
ORACLE_TERM=xterm; export ORACLE_TERM
# ---------------------------------------------------
# NLS_DATE_FORMAT
# ---------------------------------------------------
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"
export NLS_DATE_FORMAT
# ---------------------------------------------------
# TNS_ADMIN
# ---------------------------------------------------
# Specifies the directory containing the Oracle Net
# Services configuration files like listener.ora,
# tnsnames.ora, and sqlnet.ora.
# ---------------------------------------------------
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# ---------------------------------------------------
# PATH
# ---------------------------------------------------
# Used by the shell to locate executable programs;
# must include the $ORACLE_HOME/bin directory.
# ---------------------------------------------------
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/local/bin
export PATH
# ---------------------------------------------------
# LD_LIBRARY_PATH
# ---------------------------------------------------
# Specifies the list of directories that the shared
# library loader searches to locate shared object
# libraries at runtime.
# ---------------------------------------------------
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
# ---------------------------------------------------
# CLASSPATH
# ---------------------------------------------------
# Specifies the directory or list of directories that
# contain compiled Java classes.
# ---------------------------------------------------
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
# ---------------------------------------------------
# THREADS_FLAG
# ---------------------------------------------------

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 17

# All the tools in the JDK use green threads as a


# default. To specify that native threads should be
# used, set the THREADS_FLAG environment variable to
# "native". You can revert to the use of green
# threads by setting THREADS_FLAG to the value
# "green".
# ---------------------------------------------------
THREADS_FLAG=native; export THREADS_FLAG
# ---------------------------------------------------
# TEMP, TMP, and TMPDIR
# ---------------------------------------------------
export TEMP=/tmp
export TMPDIR=/tmp
# ---------------------------------------------------
# UMASK
# ---------------------------------------------------
# Set the default file mode creation mask
# (umask) to 022 to ensure that the user performing
# the Oracle software installation creates files
# with 644 permissions.
# ---------------------------------------------------
umask 022

Switch back to root user and create grid user and assign it to its groups:

useradd -u 54323 -g oinstall -G dba grid


passwd grid

Switch to grid user and modify its bash profile as follows:

su - grid
mv ~/.bash_profile ~/.bash_profile_bkp
vi ~/.bash_profile

# .bash_profile

# OS User: grid
# Application: Oracle Grid Infrastructure
# Version: Oracle 12c Release 1
# ---------------------------------------------------
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# ---------------------------------------------------
# ORACLE_SID
# ---------------------------------------------------
# Specifies the Oracle system identifier (SID)
# for the Automatic Storage Management (ASM)instance
# running on this node.
# ---------------------------------------------------
ORACLE_SID=+ASM; export ORACLE_SID
# ---------------------------------------------------
# JAVA_HOME
# ---------------------------------------------------
# Specifies the directory of the Java SDK and Runtime

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 18

# Environment.
# ---------------------------------------------------
JAVA_HOME=/usr/bin/java; export JAVA_HOME
# ---------------------------------------------------
# ORACLE_BASE
# ---------------------------------------------------
# Specifies the base of the Oracle directory structure
# for Optimal Flexible Architecture (OFA) compliant
# installations. The Oracle base directory for the
# grid installation owner is the location where
# diagnostic and administrative logs, and other logs
# associated with Oracle ASM and Oracle Clusterware
# are stored.
# ---------------------------------------------------
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
# ---------------------------------------------------
# ORACLE_HOME
# ---------------------------------------------------
# Specifies the directory containing the Oracle
# Grid Infrastructure software. For grid
# infrastructure for a cluster installations, the Grid
# home must not be placed under one of the Oracle base
# directories, or under Oracle home directories of
# Oracle Database installation owners, or in the home
# directory of an installation owner. During
# installation, ownership of the path to the Grid
# home is changed to root. This change causes
# permission errors for other installations.
# ---------------------------------------------------
ORACLE_HOME=/u01/app/12.1.0/grid; export ORACLE_HOME
# ---------------------------------------------------
# ORACLE_TERM
# ---------------------------------------------------
ORACLE_TERM=xterm; export ORACLE_TERM
# ---------------------------------------------------
# TNS_ADMIN
# ---------------------------------------------------
# Specifies the directory containing the Oracle Net
# Services configuration files like listener.ora,
# tnsnames.ora, and sqlnet.ora.
# ---------------------------------------------------
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
# ---------------------------------------------------
# PATH
# ---------------------------------------------------
PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
PATH=${PATH}:/usr/bin:/bin:/usr/local/bin
export PATH
# ---------------------------------------------------
# TEMP, TMP, and TMPDIR
export TEMP=/tmp
export TMPDIR=/tmp
# ---------------------------------------------------
# UMASK
# ---------------------------------------------------

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 19

umask 022

Create Oracle software grid home directories. Logout from grid and login as root, then perform the following:

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

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 20

5. Install Oracle ASM packages


Verify oracleasm package is installed:

[root@srv1 ~]# rpm -qa | grep oracleasm


oracleasm-support-2.1.8-1.el6.x86_64

Install Oracle ASMLib package (it takes a few minutes to download and install, the VM machine should be able to connect to the Internet)

The oracleasm kernel driver for the 64-bit (x86_64) Red Hat Compatible Kernel for Oracle Linux 6 can be installed manually from ULN or
http://public-yum.oracle.com using the yum tool:

# yum install kmod-oracleasm

Further information can be obtained from a page in Oracle site titled:"Oracle ASMLib Downloads for Oracle Linux 6"

http://www.oracle.com/technetwork/server-storage/linux/asmlib/ol6-1709075.html

[root@srv1 ~]# yum install kmod-oracleasm


Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
public_ol6_UEKR3_latest | 1.2 kB 00:00
public_ol6_latest | 1.4 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package kmod-oracleasm.x86_64 0:2.0.8-6.el6_7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
kmod-oracleasm x86_64 2.0.8-6.el6_7 public_ol6_latest 35 k

Transaction Summary
================================================================================
Install 1 Package(s)

Total download size: 35 k


Installed size: 117 k
Is this ok [y/N]: y
Downloading Packages:
kmod-oracleasm-2.0.8-6.el6_7.x86_64.rpm | 35 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : kmod-oracleasm-2.0.8-6.el6_7.x86_64
1/1
Verifying : kmod-oracleasm-2.0.8-6.el6_7.x86_64
1/1
Installed:
kmod-oracleasm.x86_64 0:2.0.8-6.el6_7
Complete!

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 21

Configure and load the ASM kernel module:

[root@srv1 ~]# oracleasm configure -i


Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets ('[]'). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: grid


Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done

Load the oracleasm kernel module:

[root@srv1 ~]# /usr/sbin/oracleasm init


Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 22

6. Create ASM disk volumes

List the disks in the OS, you should see the disks created earlier:

[root@srv1 ~]# fdisk -l | grep "Disk /dev/sd"


Disk /dev/sda: 107.4 GB, 107374182400 bytes
Disk /dev/sdb: 2147 MB, 2147483648 bytes
Disk /dev/sdc: 53.7 GB, 53687091200 bytes
Disk /dev/sdd: 53.7 GB, 53687091200 bytes

In order to use those disks with ASM, partitions should be created in them.

use fdisk <device file>

then press: n, p, 1, ENTER, ENTER, w to apply changes

Do this for all the disks which have the sizes 2,50,50 GB. In my case they were sdb,sdc,sdd

Following is the output done on sdb:

[root@srv1 ~]# fdisk /dev/sdb


Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xd2973f79.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to


switch off the mode (command 'c') and change display units to
sectors (command 'u').

Command (m for help): n


Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261):
Using default value 261

Command (m for help): w


The partition table has been altered!

Calling ioctl() to re-read partition table.


Syncing disks.

Verify:

[root@srv1 ~]# fdisk -l | grep "/dev/s"


Disk /dev/sda: 107.4 GB, 107374182400 bytes
/dev/sda1 * 1 64 512000 83 Linux
/dev/sda2 64 13055 104344576 8e Linux LVM
Disk /dev/sdb: 2147 MB, 2147483648 bytes
/dev/sdb1 1 261 2096451 83 Linux

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 23

Disk /dev/sdc: 53.7 GB, 53687091200 bytes


/dev/sdc1 1 6527 52428096 83 Linux
Disk /dev/sdd: 53.7 GB, 53687091200 bytes
/dev/sdd1 1 6527 52428096 83 Linux

Create ASM disks:

oracleasm createdisk CRSDISK1 /dev/sdb1

oracleasm createdisk DATADISK1 /dev/sdc1

oracleasm createdisk FRADISK1 /dev/sdd1

[root@srv1 ~]# oracleasm createdisk CRSDISK1 /dev/sdb1


Writing disk header: done
Instantiating disk: done
[root@srv1 ~]# oracleasm createdisk DATADISK1 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@srv1 ~]# oracleasm createdisk FRADISK1 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@srv1 ~]# oracleasm listdisks
CRSDISK1
DATADISK1
FRADISK1

Reboot!

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 24

7. Install Oracle Grid Infrastructure software


Copy the installation files to the VM appliance:

Use WinSCP to copy Oracle Grid Infrastructure installation files to the VM appliance. As grid user, I created the directory /home/grid/source
to copy the installation files to it

su - grid
mkdir source

After the files were copied, as root, make grid user and oinstall group the owner of the installation files:

su -
chown grid:oinstall /home/grid/source/linuxamd64_12102_grid_*

Run Xming and configure Putty for it

Run Xming to view Oracle GUI Installer windows in your host Windows client machine. You should see its icon in the task bar mini icons.

Then, you need to configure PyTTY session with port forwarding enabled to be able to display GUI windows via Xming server and test it with
xclock command.

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 25

Xclock is not installed in our appliance. To install it, simply run the following command:

yum install xclock

Run xclock to test the configuration changes. You should see the clock application running in your host Windows machine:

Switch to grid user install the software

Switch to grid user then use xauth command to set our session cookies for X11 forwarding to work

[root@srv1 ~]# xauth list


srv1.localdomain/unix:10 MIT-MAGIC-COOKIE-1 1f999629ceb74de9c492b1129e243877
[root@srv1 ~]# su - grid
[grid@srv1 ~]$ xauth add srv1.localdomain/unix:10 MIT-MAGIC-COOKIE-1 1f999629ceb74de9c492b1129e243877
xauth: creating new authority file /home/grid/.Xauthority
[grid@srv1 ~]$ export DISPLAY=localhost:10.0

Unzip the installation files and run the installer:

cd source
unzip linuxamd64_12102_grid_1of2.zip > /dev/null
unzip linuxamd64_12102_grid_2of2.zip > /dev/null
rm linuxamd64_12102_grid_*
cd grid
./runInstaller

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 26

In the next wizard window, we expect to see the ASM disks. But they actually did not appear in our case, as shown below:

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 27

To fix this, we need to change the discovery path. Click on Change Discovery Path button and change it to /dev/oracleasm/disks/*

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 28

Configure the CRS disk, as follows:

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 29

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 30

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 31

Check CRS services status:

crsctl status resource -t

Do not close the Putty command prompt window at this stage. Go to next section and execute the commands over there using the same Putty
window. If you have already closed it, start it, login as root, and re-run the xauth list again, switch to grid, and re-run the commands xauth add
and export DISPLAY as shown earlier.

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 32

8. Create ASM disk groups

As grid initiate ASM Configuration Assistant:

asmca

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 33

Although it is optional, if your disk free space allows it, Id recommend shutting down the VM and taking a backup copy of it at this stage.

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 34

9. Install Oracle database software

Switch to oracle user and create a directory to save the installation files in it:

su - oracle
mkdir source

Using WinSCP copy the installation files to that folder.

Unzip the installation zip files:

cd source
unzip linuxamd64_12102_database_1of2.zip > /dev/null
unzip linuxamd64_12102_database_2of2.zip > /dev/null
rm linuxamd64_12102_database_*

Similar to what we have done with grid, get the Xming working for current oracle user session, as follows:

[root@srv1 ~]# xauth list


srv1.localdomain/unix:10 MIT-MAGIC-COOKIE-1 06e8d60356207d4e15c7e1a4f4185ad3
[root@srv1 ~]# su - oracle
[oracle@srv1 ~]$ xauth add srv1.localdomain/unix:10 MIT-MAGIC-COOKIE-1 06e8d60356207d4e15c7e1a4f4185ad3
xauth: creating new authority file /home/oracle/.Xauthority
[oracle@srv1 ~]$ export DISPLAY=localhost:10

To test, issue xclock command:

Run the installer:

cd database/
./runInstaller

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 35

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 36

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 37

When prompt, the run following script as root in a separate prompt window:

/u01/app/oracle/product/12.1.0/db_1/root.sh

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 38

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 39

10. Create an Oracle database


Create the Database

Run dbca (Database Creation Assistant) to create a database

dbca

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 40

Enter the SID. Make sure it is in uppercase, because it should be the same value as the ORACLE_SID environment variable.

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 41

No need to create a listener here. The database will be registered in the listener created in the Grid home. Just click on Next button.

I had issues with selecting from the drop list items in the following windows with my mouse. It worked fine with me using the keyboard.

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 42

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 43

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 44

Set the control files parameter to ("+DATA/{DB_UNIQUE_NAME}/control1.ctl","+FRA/{DB_UNIQUE_NAME}/control2.ctl")

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 45

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 46

Connect to the database using sqlplus utility for testing:

echo $ORACLE_SID
ORADB
sqlplus system

Test the Enterprise Manager Database Express (EM Express)

If you want to test from hosting machine, use the IP address based url, for example: https://192.168.1.144:5500/em

by Ahmed Baraka
Practice Installing Oracle Database 12c R1 on Linux 6 with ASM | page: 47

Configure the sqlnet.ora and tnsnames.ora files

vi /u01/app/oracle/product/12.1.0/db_1/network/admin/sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

vi /u01/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora
ORADB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = srv1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORADB.localdomain)
)
)

Test the configuration:

sqlplus system/oracle@oradb

Shutdown the system.

#as root:
shutdown -h now

by Ahmed Baraka

You might also like