Wednesday, 28 May 2014

Installing Oracle 12c

Recently I've been chatting with Marco, a co-worker of mine, who is now working in another company, about lots of stuff. He has got a new job in this new company and he also has got lots of stuff to do including installing and migrating Oracle database 12c.

He used to work with Oracle database and now he is looking for a complete procedure to do it quickly and well, so I said : would it help if I did it ?

Let's help Marco, shall we ?

1) Requirements :

2 GB of RAM or more
6.5 GB of local disk space
Oracle Linux 6.x 

2) Required RPM module :

binutils-*         
glibc-*            
libgcc-*           
libstdc++-*        
libaio-*           
libXext-*          
libXtst-*          
libX11-*           
libXau-*           
libxcb-*           
libXi-*            
make-*             
sysstat-*          
compat-libcap1-*   
compat-libstdc++-* 
gcc-*              
gcc-c++-*          
glibc-devel-*      
ksh*               
libstdc++-devel*   
libaio-devel*   



 3) Required Kernel parameter :
      
#Oracle 12c x SGA (16G)
kernel.shmall = 4194304
#Oracle 12c x Server (64G)
kernel.shmmax = 68719476736
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

4) Set the following shell limits for Oracle and Grid user in the /etc/security/limits.conf file:

oracle              soft    nproc    2047
oracle              hard   nproc   16384
oracle              soft    nofile    1024
oracle              hard   nofile    65536
oracle              soft    stack    10240
oracle              hard   stack    10240
         
grid              soft    nproc    2047
grid              hard   nproc   16384
grid              soft    nofile    1024
grid              hard   nofile    65536
grid              soft    stack    10240
grid              hard   stack    10240


5) Create the user Oracle and Grid :
As root execute:
groupadd -g 1000 oinstall
groupadd -g 1200 dba
useradd -u 1100 -g oinstall -G dba grid
useradd -u 1101 -g oinstall -G dba oracle
mkdir -p /u01/app/grid
chown -R grid:oinstall /u01
mkdir /u01/app/oracle
chown oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/
passwd oracle
passwd grid

6) Add the following line to the oracle and grid profile:

--Oracle (.bash_profile)

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -u 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$PATH:$HOME/bin
#Setting $ORACLE_BASE (not $ORACLE_HOME) is recommended, 
#since it eases a few prompts  in the OUI runInstaller tool.
export ORACLE_BASE=/u01/app/oracle
#export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

--Grid (.bash_profile)

if [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -u 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

export ORACLE_BASE=/u01/app/grid
#export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

7) Ensure that the command "gcc -version" return 4.1.x :
[oracle@oracle12cvm07 ~]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3)
   

8) Install the ASMLib package :

ASMLib consist of the following packages :

oracleasm-support-2.1.8-1.el6.x86_64.rpm
oracleasmlib-2.0.4-1.el6.x86_64.rpm
kmod-oracleasm-x86_64.rpm

You can find the "oracleasm-support-2.1.8-1.el6.x86_64.rpm" in the Oracle Linux 6.x CD.

You can download the "oracleasmlib-2.0.4-1.el6.x86_64.rpm" from the Oracle site otherwise the
"kmod-oracleasm-x86_64.rpm"  is already loaded in the kernel UEK.

9) Configuring ASMLib and create ASMLib disks :

As root execute :     /etc/init.d/oracleasm configure

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
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:        [  OK  ]

Creating  ASMlib disk. 
 
/etc/init.d/oracleasm createdisk ORADATA1 /dev/sdb1
/etc/init.d/oracleasm createdisk ORAFRA1  /dev/sdc1
/etc/init.d/oracleasm createdisk OCRASM  /dev/sdd1
     
Be careful ! The disk / dev/sdb, /dev/sdc and /dev/sdd must be created and partitioned before.


10) Installing the Grid Infrastructure :

unzip linuxamd64_12c_grid_2of2.zip
Execute as grid : ./runInstaller

Follow the graphical interface and complete the installation process.

10) Creating the ASM Disk Group :

As grid execute the following command : asmca

Follow the graphical interface and create at least two ASM diskgroup : ORADATA, ORAFRA

11) Installing the Database binary :

unzip linuxamd64_12c_database_1of2.zip
unzip linuxamd64_12c_database_2of2.zip

Execute as Oracle : ./runInstaller

Follow the graphical interface and complete the installation process.
12) Creating the 12c database :

Execute as Oracle : dbca


Follow the graphical interface and complete the installation process.


NB: There is only one difference from the previous 11g process. With 12c version you also have to specify a container database, but this will be a topic later on.

See you in my next blog

Byeeeee

No comments:

Post a Comment