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

Wednesday, 14 May 2014

Quick Installation of MySQL Cluster NDB 7.3 - PART 4

Let's continue with the configuration, shall we ?

STEP 5 :  Configuring the Management node.

We have to create a directory like this : /home/mysql/mysqlCluster and the following config.ini in both the Management Nodes.

SECTION : [ndbd default] : Options affecting ndbd processes on all data nodes:
NoOfReplicas=2    # Number of replicas
DataMemory=80M    # How much memory to allocate for data storage
IndexMemory=18M   # How much memory to allocate for index storage


In this section we can config the option of the Data Nodes, for example we can decide the amount of memory for data and index storage.

Be careful ! These options are going to affect both Data Nodes.

SECTION : [tcp default] :  # TCP/IP options:
portnumber=2202  > Easy to understand !       

SECTION : [ndb_mgmd] : Management process options:
hostname=10.5.250.101           # Hostname or IP address of MGM node
datadir=/home/mysql/mysqlCluster  # Directory for MGM node log files


SECTION : [ndb_mgmd] :  Management process options:
hostname=10.5.250.102           # Hostname or IP address of MGM node
datadir=/home/mysql/mysqlCluster  # Directory for MGM node log files


In these sections we have to declare the IP address of both Management Nodes but according to the manual each Node has to be specified in a different section.

SECTION :  [ndbd] : Options for data node "A" :
hostname=10.5.250.103                   # Hostname or IP address
datadir=/home/mysql/mysqlClusterData    # Directory for this data node's data files


This section refers only to one Data Node, that we'll refer to it as Node A and in which we can config the hostname and data dir.


SECTION : [ndbd] :  Options for data node "B" :
hostname=10.5.250.104                   # Hostname or IP address
datadir=/home/mysql/mysqlClusterData    # Directory for this data node's data files


This section has the same meaning of the previous section.

SECTION [mysqld] :  SQL node "A" options:
hostname=10.5.250.103      # Hostname or IP address

This section refers only to one SQL Nodes, that we'll call it as SQL Node "A" and in which we can config the hostname and data dir.


SECTION : [mysqld] : # SQL node "B" options :

hostname=10.5.250.104           # Hostname or IP address 

This section has the same meaning as the previous section.

Now we are ready to start the MySQL Cluster but for today that's all.....

See you in my next blog.

Byeeeeee
                           

Thursday, 8 May 2014

Quick Installation of MySQL Cluster NDB 7.3 - PART 3

Let's continue with the installation, shall we ?

STEP 3: On every Data Nodes we have only to be sure of adding the binary directory of MySQL in the environment variable PATH :

PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/mysql/bin

To be honest only the ndbd executable file is necessary to start the Data Nodes because I haven't got enough resources on my virtual machine server so I have to share the Data Nodes and SQL Nodes on the same linux server.

On every Management Nodes we have only to apply the same procedure followed before.

Now we are ready to get down the configuration process of the Cluster.

STEP 4 : Configuring the SQL Nodes:

File :  /etc/my.cnf

[mysqld]
# Options for mysqld process:
ndbcluster                      # run NDB storage engine

[mysql_cluster]
# Options for MySQL Cluster processes:
ndb-connectstring=10.5.250.101,10.5.250.102  # location of management server


As you can see, we have only to declare the [mysqld] and [mysql_cluster] section, adding the storage engine NDB and the address of the management nodes.

Be careful ! Once the mysqld daemon is started with the option "ndbcluster" enabled, you can't execute a SQL command like "create table" if the other nodes of the cluster aren't started too.


To be continued ....



See you in my next Blog.

Byeeeeeee