Installing Oracle GI12c for a Standalone Server on OEL6

Categories: Oracle Database · Linux · Installation and upgrades · Storage · ASM

Translated from Portuguese. Read the original

Hi everyone. In this article we’re finally going to install Grid Infrastructure and create the Oracle ASM instance.

If you’ve already installed Linux, great. If not, you can follow the article Installing Oracle Linux 6.4

To install GI 12c we need to download the media from the Oracle website at this link. You should start by downloading the .zip packages linuxamd64_12c_grid_1of2.zip and linuxamd64_12c_grid_2of2.zip.

To learn a bit more about Grid Infrastructure and one of its components, Oracle ASM, read A Brief Look at ASM.

Let’s power on the virtual machine we created in the article Installing Oracle Linux 6.4 to start the Grid Infrastructure 12c installation.

Linux configuration

1 – After powering on the VM, log in as root and open a terminal by right-clicking on the desktop.

Screen Shot 2015-12-27 at 4.50.07 PM

2 – To find out your IP and hostname, type the following commands:

# ifconfig
# hostname

Screen Shot 2015-12-27 at 5.12.25 PM

3 – Let’s adjust the /etc/hosts file, where we need to enter our IP and hostname.

# vi /etc/hosts

To insert text in vi, use the command i; you’ll see the word insert appear in the status bar.

Enter your hostname and IP as shown below and also in the figure.

# Oracle Server
192.168.25.138 loredata-srv.localdomain loredata-srv

Then press the “Esc” key on your keyboard and then the commands “:wq” to save your hosts file and exit vi. Screen Shot 2015-12-27 at 5.16.29 PMScreen Shot 2015-12-27 at 6.14.07 PM

4 – Test your internet connection.

# ping google.com

Ctrl+C to stop the ping command.

Screen Shot 2015-12-27 at 6.26.50 PM

5 – Now let’s install the Oracle ASM Support package.

# yum install -y oracleasm-support

Screen Shot 2015-12-27 at 6.33.49 PM

6 – If you are using the Red Hat Compatible Kernel for Oracle Linux 6, you can install the ASM driver with the command below. Some required packages will be downloaded and installed when you run the command.

# yum install -y kmod-oracleasm

Screen Shot 2015-12-27 at 6.48.05 PM

If you need the Oracle ASM packages for another Linux, you’ll find them here.

7 – To install Oracle ASMLib 2.0 we’ll download it directly from the Oracle website. To make it easier I’ll open the Linux Firefox browser and download straight from it. Choose the option for your platform, which in our case is the x86_64 architecture. When the download option appears on the screen, choose to save the file.

Screen Shot 2015-12-27 at 7.00.39 PM

8 – After downloading the package we need to install it. By default it will be saved in the /root/Downloads directory.

# rpm -ivh /root/Downloads/oracleasmlib-2.0.12-1.el6.x86_64.rpm

Screen Shot 2015-12-27 at 7.04.43 PM

9 – Now let’s install the pre-installation package for the Oracle software. It will configure a lot of things for us, from Kernel parameters to creating the oracle user.

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

Screen Shot 2015-12-27 at 7.25.23 PM

10 – We need to configure the Oracle ASM module.

# oracleasm configure -i

You can answer the prompts as shown below and also in the image:

oracle
oinstall
y
y

Screen Shot 2015-12-27 at 7.28.26 PM

11 – Let’s shut down our VM to add the disks that will be presented to ASM.

# shutdown -h now

Screen Shot 2015-12-27 at 7.31.25 PM

Creating the disks

12 – We need to create the virtual disks in Virtual Box, which simulates new physical disks being added. Follow the images below to complete the procedure in Virtual Box.

12.1 Click storage

12.2 Click +HDD on the SATA controller

12.3 Click to create a new disk

12.4 Select the VDI format and continue

12.5 Select “Fixed Size”

12.6 Click the little folder icon, choose where you want to store your new disk and give it a name

12.7 Set the size to 4GB and click to create the new disk

12.8 Create one more disk

12.9 Again choose the VDI format

12.10 Fixed Size

12.11 Store it wherever you prefer

12.12 This will be our data disk, so give it a considerable size and move on to create the disk


13 – Start your VM again and log in as root again.

14 – Open the terminal by right-clicking on the desktop.

15 – Check whether the disks we added were identified by Linux.

# fdisk -l

Screen Shot 2015-12-27 at 10.49.22 PM

We can see there are 3 disks: /dev/sda, /dev/sdb and /dev/sdc. Only /dev/sda has partitions, and those we set up during the Linux installation.

16 – Let’s create the partitions on the disks /dev/sdb and /dev/sdc so we can create the ASM logical disks.

# fdisk /dev/sdb

The prompt sequence is:

n
p
1
<enter>
<enter>
w

Screen Shot 2015-12-27 at 10.54.25 PM

Check the partitions of the /dev/sdb disk.

# fdisk -l /dev/sdb

Screen Shot 2015-12-27 at 10.57.20 PM

Now let’s do the same for the /dev/sdc disk.

# fdisk /dev/sdc

Same prompt sequence:

n
p
1
<enter>
<enter>
w

Screen Shot 2015-12-27 at 11.02.59 PM

Check the partitions of the /dev/sdc disk.

# fdisk -l /dev/sdc

Screen Shot 2015-12-27 at 11.05.50 PM

17 – Set SELinux to permissive by changing the file /etc/selinux/config

# vi /etc/selinux/config

Screen Shot 2015-12-27 at 11.23.52 PM

18 – Stop and disable the firewall.

# service iptables stop
# chkconfig iptables off

Screen Shot 2015-12-27 at 11.28.40 PM

19 – Reboot Linux.

# reboot

20 – After partitioning the disks, configuring SELinux, disabling the firewall and rebooting Linux, open the terminal. Now we’re going to create the ASM logical disks, and for that we need to use the partitions created on each disk.

We’ll create /dev/sdb1 as CRS and /dev/sdc1 as DATA.

# oracleasm createdisk CRS /dev/sdb1
# oracleasm createdisk DATA /dev/sdc1

Screen Shot 2015-12-27 at 11.38.06 PM

21 – List the logical disks created in ASM.

# oracleasm listdisks
# oracleasm querydisk CRS
# oracleasm querydisk /dev/sdb1
# oracleasm querydisk DATA
# oracleasm querydisk /dev/sdc1

Screen Shot 2015-12-27 at 11.41.08 PM

Installing Grid Infrastructure 12c

22 – If, like me, you downloaded the Grid Infrastructure media with the Linux Firefox while logged in as root, I suggest moving the files to another directory and then making oracle their owner.

# cd /root/Downloads
# mv linuxamd64_12102_grid_* /u01

Screen Shot 2015-12-30 at 8.59.26 PM

23 – Let’s create the directory structure that will be the ORACLE_BASE and ORACLE_HOME environment variables, and then change the owner of the /u01 directories and subdirectories.

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

Screen Shot 2015-12-30 at 9.22.27 PM

24 – We need to set a password for the oracle user and log in to Linux with it.

# passwd oracle

Screen Shot 2015-12-30 at 9.09.38 PM

25 – We log out of root and log in as oracle.

25.1 root > quit

25.2 Log out of root

25.3 Log in as oracle


26 – Let’s open a terminal and navigate to the directory where we moved the installation media.

$ cd /u01
$ ls -lh

Screen Shot 2016-01-01 at 7.28.19 PM

Screen Shot 2016-01-01 at 7.28.51 PM

27 – Now we need to unzip the .zip files. The extracted content will be stored in a new directory called grid. Let’s unzip file 1 first and then file 2.

$ unzip linuxamd64_12102_grid_1of2.zip
$ unzip linuxamd64_12102_grid_2of2.zip
$ ls -lh

Screen Shot 2016-01-01 at 7.41.35 PM

Screen Shot 2016-01-01 at 7.42.56 PM

Screen Shot 2016-01-01 at 7.43.25 PM

28 – Let’s adjust the environment variables so they’re loaded automatically through the .bash_profile file. Add the following lines at the end of the file /home/oracle/.bash_profile.

$ vi /home/oracle/.bash_profile
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=loredata-srv.localdomain
export ORACLE_UNQNAME=loredb
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/oracle/product/12.1.0.2/grid
export DB_HOME=$ORACLE_BASE/product/12.1.0.2/dbhome_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=loredb
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
alias grid_env='. /home/oracle/grid_env'
alias db_env='. /home/oracle/db_env'

Screen Shot 2016-01-01 at 7.54.39 PM

Screen Shot 2016-01-01 at 8.00.22 PM

29 – To make things easier, let’s also create the grid_env and db_env files, which will set our variables according to which one we want to work with.

$ vi /home/oracle/grid_env
export ORACLE_SID=+ASM
export ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/grid
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Screen Shot 2016-01-01 at 8.07.45 PM

Screen Shot 2016-01-01 at 8.08.18 PM

$ vi /home/oracle/db_env
export ORACLE_SID=loredb
export ORACLE_HOME=$DB_HOME
export PATH=$ORACLE_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Screen Shot 2016-01-01 at 8.08.45 PM

Screen Shot 2016-01-01 at 8.09.14 PM

30 – Then we reload the environment variables to finally start the installation.

$ source /home/oracle/.bash_profile

Screen Shot 2016-01-01 at 8.18.59 PM

31 – To start the installer, we navigate to the directory where it is and run it.

$ cd /u01/grid
$ ls -lh
$ ./runInstaller

Screen Shot 2016-01-01 at 8.23.50 PM

32 – Now we proceed through the following screens to install Grid Infrastructure 12c for a Standalone Server.

32.1 Select to install and configure Grid Infrastructure for a Standalone Server

32.2 Choose a language (English is preferable)

32.3 Rename the diskgroup to be created to CRS, check External redundancy and also the CRS disk

32.4 Set a password

32.5 Leave it unchecked and move on

32.6 Set the groups as shown in the image

32.7 Confirm the configuration

32.8 Set the directories as shown in the image

32.9 Set the directory as shown in the image

32.10 Check the option to run the scripts automatically and enter the root user password

32.11 Check the option to ignore this error

32.12 Confirm the configuration

32.13 Just move on

32.14 The installation has started

32.15 Confirm to run the configuration scripts

32.16 Installation finished successfully

In this long article we saw how to configure Linux and then installed Grid Infrastructure 12c for a Standalone Server. A Standalone Server means a non-cluster infrastructure: a single server with Oracle ASM and Oracle Restart to provide an infrastructure with better availability. Oracle Restart makes the installed environment restart if a fatal failure occurs at the software or hardware level, and when the server is powered on or restarted the services are started automatically. During the startup procedure, Oracle Restart starts all the components of the database server in the correct order, including ASM, the Listener, the database instance itself and the Database services.

Grid Infrastructure is also used when we want a database cluster, and it serves both a cluster with single-instance databases and RAC (Real Application Clusters) databases.

That’s all for today, and see you in the next article, where we’ll install Oracle Database 12c. Questions or suggestions, leave a comment.

Earlier comments

  1. David Figueiredo de Simas

    Parabéns pelo artigo.

    1. Franky Weber Faust

      Valeu David. Já vai testando aí as dicas. Abraço.

  2. Rodrigo Pereira

    Parabens pelo artigo!! Porque apenas o disco crs foi selecionado?

    1. Franky Weber Faust

      Fala aí Rodrigo. Legal que você está acompanhando. O motivo de ter selecionado somente o disco CRS é porque como instalamos somente o Grid Infrastructure eu quis separar um diskgroup exclusivo pra ele. Neste novo artigo que acabei de publicar criamos o diskgroup DATA e usamos o disco DATA que aparece aí.

      http://loredata.com.br/2016/01/18/criando-o-banco-de-dados-com-o-dbca-e-usando-o-asmca/

  3. Rodrigo Pereira

    Deu um problema na instalação do grid, agora como faço pra desinstalar o mesmo, porque tentei proceder a instalação novamente e não consigo devido possuir uma instalação!!!

    Desde já agradeço!!!

    1. Franky Weber Faust

      Rodrigo, dependendo em que etapa ocorreu o erro a tratativa é diferente. Esta documentação mostra as opções de desinstalação: https://docs.oracle.com/database/121/CWLIN/rem_orcl.htm#CWLIN345

Comments