Showing posts with label Grid Control. Show all posts
Showing posts with label Grid Control. Show all posts

Tuesday, December 22, 2015

Oracle Cloud Control 13c R1 Basic Installation on Oracle Linux 6.5

- Source Links:

- Download the following software:
Oracle Database (x86_64) 12.1.0.2 Enterprise Edition
Enterprise Manager Cloud Control 13c Release 1 (13.1.0.0) (x86_64)
13.1.0.0 DB Template for EM 13.1.0.0 on Linux x86-64
Oracle Linux 6.5 (x86_64)

- OS Installation
Install Oracle Linux (OL) in the same way you would for a regular Oracle Database installation. You can see examples of this type of installation below. Remember to check database installation article (listed below) for the specific package group selection.
During this installation I used a virtual machine with 10G RAM and 100G disk space. The swap size was set at 8G, the firewall was disabled and SELinux was set to permissive.

- Database Installation (Software-Only)
For this installation you will need 12.1.0.2 for the repository database, so use the installation instructions from one of the following articles.

- OMS Server Virtual Machine details:
hostname: em131.example.com
IP Address: 1.0.3.71
CPU: 2x2 Cores
RAM: 11GB (minimal 10GB or just ignore warning during installation)
HDD: 120G -> /boot 500MB
-> /root 110GB
-> swap 10GB

- Install VMware guest tools
 # tar -zxvf /media/iso/VMwareTools-10.0.5-3228253.tar.gz -C /tmp
 # /tmp/vmware-tools-distrib/vmware-install.pl -d
 # reboot

- Mount shared folder in Linux guests with oracle software directory in host
 # mkdir /mnt/hgfs
 # vim /etc/fstab
 .host :/ /mnt/hgfs vmhgfs defaults 0 0

- Stop postfix service that hang system at boot time
# chkconfig postfix off
# /etc/init.d/postfix stop

- Disable and shutdown network manager to avoid reset network settings
# service NetworkManager stop
# chkconfig NetworkManager off

- Edit "/etc/hosts" file must contain a fully qualified name for the server
127.0.0.1   localhost.localdomain   localhost
1.0.3.71    em131.example.com       em131

- Set secure Linux to permissive by editing the "/etc/selinux/config" file
# setenforce Permissive
# vim /etc/selinux/config
SELINUX=permissive

- If you have the Linux firewall enabled, you will need to disable or configure it
# service iptables stop
# chkconfig iptables off

- Edit "/etc/sysconfig/network" file
vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=em131.example.com
NOZEROCONF=yes

- Set network interface file -ifcfg-eth0
# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
IPADDR=1.0.3.71
NETMASK=255.255.255.0
GATEWAY=1.0.3.2
USERCTL=no

- Edit /etc/resolv.conf file
# vim /etc/resolv.conf
search example.com
nameserver 1.0.3.2

- Add or amend the following lines in the "/etc/sysctl.conf" file
# vim /etc/sysctl.conf
#### Oracle Cloud Control 13cr1 settings
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 11000 65500
kernel.panic_on_oops = 1

- Run the following command to apply the current kernel parameters.
/sbin/sysctl -p
/etc/init.d/network restart

- Add the following lines to the "/etc/security/limits.conf" file
# vim /etc/security/limits.conf
#### Oracle Cloud Control 13cr1 settings
oracle   soft           nofile          4096
oracle   hard           nofile          65536
oracle   soft           nproc           16384
oracle   hard           nproc           16384
oracle   soft           stack           10240
oracle   hard           stack           32768
oracle   soft           memlock         4095746
oracle   hard           memlock         4095746

- Create the new groups and users
groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper
groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin
useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,asmoper,asmadmin,wheel oracle
passwd oracle

- Create the directories in which the Oracle software will be installed
rm -rf /u01
mkdir -p /u01/app/12102/grid
mkdir -p /u01/app/oracle/grid
mkdir -p /u01/app/oracle/product/12102/db_1
mkdir -p /u01/app/oracle/oms13cr1
mkdir -p /u01/app/oracle/agent13c
chown -R oracle:oinstall /u01
chmod -R 775 /u01/

- Amend the "/etc/security/limits.d/90-nproc.conf" file
# vim /etc/security/limits.d/90-nproc.conf
#### Change this
*          soft    nproc    1024

#### To this
* - nproc 16384

- Add the following lines at the end of the "/home/oracle/.bash_profile" file
# vim /home/oracle/.bash_profile
#### Oracle Cloud Control 13cr1 settings
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
alias adrci='rlwrap adrci'
alias asmcmd='rlwrap asmcmd'

export TMP=/tmp;
export TMPDIR=$TMP;

export ORACLE_HOSTNAME=`hostname`
export ORACLE_UNQNAME=emrep
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12102/db_1
export GRID_HOME=/u01/app/oracle/grid
#export GRID_HOME=/u01/app/12102/grid
export OMS_HOME=/u01/app/oracle/oms13cr1
export AGENT_HOME=/u01/app/oracle/agent13c
export ORACLE_SID=emrep
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export PATH=$OMS_HOME/bin:$PATH
export PATH=$AGENT_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

- Install required packages
# mv /etc/yum.repos.d/public-yum-ol6.repo /etc/yum.repos.d/public-yum-ol6.repo.bk
# mount
# vim /etc/fstab
/dev/sr0             /media/iso           iso9660 defaults         0 0

# mkdir /media/iso
# mount -a
# rpm --import /media/iso/RPM-GPG-KEY
# rpm --import /media/iso/RPM-GPG-KEY-oracle
# cd /etc/yum.repos.d/
# vim dvd.repo

[Server]  
name=Server
baseurl=file:///media/iso/Server  
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[HighAvailability]  
name=HighAvailability
baseurl=file:///media/iso/HighAvailability  
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[LoadBalancer]  
name=LoadBalancer
baseurl=file:///media/iso/LoadBalancer
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[ResilientStorage]  
name=ResilientStorage
baseurl=file:///media/iso/ResilientStorage
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[ScalableFileSystem]  
name=ScalableFileSystem
baseurl=file:///media/iso/ScalableFileSystem
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1  

[UEK3]  
name=UEK3
baseurl=file:///media/iso/UEK3
gpgkey=file:///media/iso/RPM-GPG-KEY  
gpgcheck=1  
enabled=1   
 
# yum clean all  
# yum makecache  
# yum repolist  

- Install the following packages if they are not already present.
# yum install -y binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc.i686 glibc-devel.i686 glibc-devel glibc-common glibc-headers glibc-utils glibc ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat unixODBC unixODBC-devel 

- Install Extra packages
Flash Player
JDK7U80
rlwarp
# rpm -Uvh flash-plugin-11.2.202.540-release.x86_64.rpm jdk-7u80-linux-x64.rpm rlwrap-0.42-1.el6.x86_64.rpm

- Extract Oracle Database files to virtual Machine using VMware shared folder
$ su - oracle
$ cd /mnt/hgfs/shared/db/db_121012_lnx64/ (shared folder in physical machine)
$ unzip -d /tmp linuxamd64_12102_database_1of2.zip && unzip -d /tmp linuxamd64_12102_database_2of2.zip

- Install Oracle Database software only
$ export ORACLE_SID=emrep
$ export ORACLE_HOME=/u01/app/oracle/product/12102/db_1
$ /tmp/database/runInstaller &

- run root scripts
# /u01/app/oraInventory/orainstRoot.sh
# /u01/app/oracle/product/12102/db_1/root.sh

- unzip repository template under ORACLE_HOME
$ cd /mnt/hgfs/shared/em/em13100_linux64/
$ unzip -d $ORACLE_HOME/assistants/dbca/templates/ 12.1.0.2.0_Database_Template_for_EM13_1_0_0_0_Linux_x64.zip

- use Oracle OUI to install "emrep" repository database using templates
$ dbca &

- start Oracle database Cloud Control installer
$ cd /mnt/hgfs/shared/em/em13100_linux64/
$ chmod +x em13100_linux64.bin
$ ./em13100_linux64.bin

 install details - 

 OMS_HOME=/u01/app/oracle/oms13cr1
 AGENT_HOME=/u01/app/oracle/agent13c
 hostname=em131.example.com


- Open a terminal and switch to root, and run the root script.
/u01/app/oracle/oms13cr1/allroot.sh

- Edit the "/etc/oratab" file setting.
$ vim /etc/oratab
emrep:/u01/app/oracle/product/12102/db_1:Y

- Cloud Control summary:
Use the following URL to access:

 1. Enterprise Manager Cloud Control URL: https://em131.example.com:7802/em
 username: sysman

 2. Admin Server URL: https://em131.example.com:7102/console
 username: weblogic

 3. BI Publisher URL: https://em131.example.com:9803/xmlpserver
 username: sysman


- Configure Oracle database to use archivelog mode, force logging and controlfiles trace and get a clean backup

SQL> shutdown immediate  
$ sqlplus / as sysdba
SQL> startup mount;  
SQL> alter database archivelog;  
SQL> alter database force logging;  
SQL> alter database backup controlfile to trace;  
SQL> alter database open';  
SQL> exit
RMAN> report schema; # check schema  
RMAN> configure controlfile autobackup on; # set controlfiles to be backup with database  
RMAN> backup database plus archivelog; # backuped database with archivelogs   

- Shutdown Oracle Cloud Control 13c with it's repo database
$ vim shutdown.sh
#!/bin/bash
# shutdown Oracle database Server && Cloud Control && Cloud Agent
export ORACLE_HOME=/u01/app/oracle/product/12102/db_1
export OMS_HOME=/u01/app/oracle/oms13cr1
export AGENT_HOME=/u01/app/oracle/agent13c/agent_13.1.0.0.0

# Stop everything
$OMS_HOME/bin/emctl stop oms -all

$AGENT_HOME/bin/emctl stop agent

$ORACLE_HOME/bin/dbshut $ORACLE_HOME

echo "*************** BYE BYE ***************"

$ chmod +x shutdown.sh


- Startup Oracle Cloud Control with it's repo database
$ vim startup.sh
#!/bin/bash
# Startup Oracle database Server && Cloud Control && Cloud Agent
export ORACLE_HOME=/u01/app/oracle/product/12102/db_1
export OMS_HOME=/u01/app/oracle/oms13cr1
export AGENT_HOME=/u01/app/oracle/agent13c/agent_13.1.0.0.0

# Start everything
$ORACLE_HOME/bin/dbstart $ORACLE_HOME

$OMS_HOME/bin/emctl start oms

$AGENT_HOME/bin/emctl start agent

echo "**************** WELLCOME *****************"

$ chmod +x startup.sh

Tuesday, December 23, 2014

Oracle Database 12c Release 1 RAC On CentOS 6.4 Using VMWare Workstation


Resources:
https://gruffdba.wordpress.com/2013/07/10/oracle-12cr1-12-1-0-1-2-node-rac-on-centos-6-4-on-vmware-workstation-9-introduction/
http://oracle-base.com/articles/12c/oracle-db-12cr1-rac-installation-on-oracle-linux-6-using-virtualbox.php 
http://www.unixmen.com/dns-server-installation-step-by-step-using-centos-6-3/


             rac1                  rac2
        ----------------      --------------------
HDD        40GB                   40GB
eth0       1.0.2.5                1.0.2.6  vment2 Host-Only 
eth1       1.0.3.5                1.0.3.6  vmnet3 Host-Only
eth2       1.0.8.5                1.0.8.6  vmnet8 Nat


- install OS CentOS 6.4 64-bit

http://oracle-base.com/articles/linux/oracle-linux-6-installation.php
Desktop Environments > GNOME Desktop Environment
Applications > Editors
Applications > Graphical Internet
Development > Development Libraries
Development > Development Tools
Servers > Server Configuration Tools
Base System > Administration Tools
Base System > Base
Base System > System Tools
Base System > X Window System

- install VirtualBox additions
 

chmod +x ./VBoxLinuxAdditions.run
./VBoxLinuxAdditions.run


- install Packages using local yum repo
 

cd /etc/yum.repo.d/
mkdir oldrepo
mv ./* oldrepo
vim dvd.repo
[dvd]
name=dvd
baseurl=file:///media/CentOS_6.4_Final
gpgcheck=0
enabled=1
yum clean all
yum makecache
yum repolist


- install required packages for oracle RAC installation
 

yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
cd /
eject


- Amend the hostname in the "/etc/sysconfig/network" file.
 

vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=rac1.example.com


- Enter following data to “/ect/hosts”, comment rac-scan must be resolv by DNS server
 

vim /etc/hosts
127.0.0.1       localhost.localdomain   localhost

# Public
1.0.2.5   rac1.example.com   rac1
1.0.2.6   rac2.example.com   rac2

# Private
1.0.3.5   rac1-priv.example.com      rac1-priv
1.0.3.6   rac2-priv.example.com      rac2-priv

# Virtual
1.0.2.11   rac1-vip.example.com       rac1-vip
1.0.2.12   rac2-vip.example.com       rac2-vip

# SCAN
#1.0.2.15   rac-scan.example.com       rac-scan
#1.0.2.16   rac-scan.example.com       rac-scan
#1.0.2.17   rac-scan.example.com       rac-scan


- Edit "/etc/resolv.conf" file in clients in rac1, rac2
 

vim /etc/resolv.conf
nameserver 1.0.2.5
nameserver 1.0.2.6
nameserver 8.8.8.8
search example.com


- edit Network Additions for DNS Server in rac1, rac2ifcfg-eth2
 

vim /etc/sysconfig/network-scripts/ifcfg-eth0 >> PEERDNS=no
vim /etc/sysconfig/network-scripts/ifcfg-eth1 >> PEERDNS=no
vim /etc/sysconfig/network-scripts/ifcfg-eth2 >> PEERDNS=no


- Linux Kernel Parameters for Oracle 11gR2 on RHEL 5, Edit the /etc/sysctl.conf and add following lines:
 

vim /etc/sysctl.conf
# added for Oracle 12cR1
kernel.shmall = 2097152
kernel.shmmax = 3221225472
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

- Now execute “sysctl -p” command to apply the new settings:
 

/sbin/sysctl -p


- Edit the /etc/security/limits.conf file and add following lines:
 

vim /etc/security/limits.conf
# added for Oracle 12cR1
oracle              soft   nproc   2047
oracle              hard   nproc   16384
oracle              soft   nofile  1024
oracle              hard   nofile  65536
oracle              soft   stack   10240
oracle              hard   stack   10240


- Edit the /etc/pam.d/login file and add following line:
 

vim /etc/pam.d/login
# added for Oracle 12cR1
session    required     pam_limits.so


- To make the change permanent, modify the /etc/sysconfig/selinux change value of SELINUX variable to disabled:
 

vim  /etc/sysconfig/selinux
SELINUX=disabled


- To permanently disable the firewall we will disable the service:
 

service iptables stop
chkconfig iptables off


- create the user oracle account and the OS groups:
 

groupadd dba
groupadd oper
groupadd oinstall
groupadd asmdba
groupadd asmadmin
useradd -g oinstall -G dba,oper,asmdba,asmadmin oracle
passwd oracle


- Create the directories in which the Oracle software will be installed.
 

mkdir -p /u01/app/12102/grid
mkdir -p /u01/app/oracle/product/12102/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01/


- Login as the "oracle" user and add the following lines at the end of the "/home/oracle/.bash_profile" file.
 

vim /home/oracle/.bash_profile
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=rac1.example.com
export ORACLE_UNQNAME=cdbrac.example.com
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/12102/grid
export DB_HOME=$ORACLE_BASE/product/12102/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=cdbrac1
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

alias grid_env='. /home/oracle/grid_env'
alias db_env='. /home/oracle/db_env'


- Create a file called "/home/oracle/grid_env" with the following contents.
 

vim /home/oracle/grid_env
export ORACLE_SID=+ASM1
export ORACLE_HOME=$GRID_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


- Create a file called "/home/oracle/db_env" with the following contents.
 

vim /home/oracle/db_env
export ORACLE_SID=cdbrac1
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



##################### clone Virtual Machine rac1 to rac2 #######################

- in rac1 after poweroff click Edit Virtual Machine Settings > Add > Hard Disk > SCSI >
- Create New Virtual Disk > Space 20 GB, Check Allocate All disk Space now ,
- Store Virtual Disks As Single file > Finish
- from settings > Advanced > select SCSI 1:0 Indepedent , Persisent > Close
- Add same disk to rac2
- edit .vmx file for rac1, rac2
 

- $ vim /data/vmware/rac121-node1/rac121-node1.vmx (in phyiscal machine)

disk.EnableUUID = "TRUE"
disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
scsi1.sharedBus = "virtual"


after this line in .vmx file
 

replay.supported = "FALSE"


- $ vim /data/vmware/rac121-node2/rac121-node2.vmx (in phyiscal machine) add theses lines
 

disk.EnableUUID = "TRUE"
disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
scsi1.sharedBus = "virtual"


after this line in .vmx file
 

replay.supported = "FALSE"


################ edit changes after clone rac1 to rac2 (in rac2) #################
- Amend the hostname in the "/etc/sysconfig/network" file.
 

vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rac2.example.com


- Edit the "/etc/sysconfig/network-scripts/ifcfg-eth0, eth1 to change ip address for rac2
 

eth0    1.0.2.6       255.255.255.0           internal Network
eth1    1.0.3.6       255.255.255.0           internal Network
eth2    1.0.8.6       255.255.255.0    1.0.8.2    nat


- Edit the "/home/oracle/.bash_profile" file on the "rac2" node to correct the ORACLE_SID and ORACLE_HOSTNAME values.
 

ORACLE_SID=cdbrac2; export ORACLE_SID
ORACLE_HOSTNAME=rac2.example.com; export ORACLE_HOSTNAME


- Also, amend the ORACLE_SID setting in the "/home/oracle/db_env" and "/home/oracle/grid_env" files.
- Create a file called "/home/oracle/grid_env" with the following contents.
 

vim /home/oracle/grid_env
ORACLE_SID=+ASM2; export ORACLE_SID


- edit a file called "/home/oracle/db_env" with the following contents.
 

vim /home/oracle/db_env
ORACLE_SID=cdbrac2; export ORACLE_SID


############### Configure Shared Disks and UDEV rules ###############
-Use the "fdisk" command to partition the disks sdb to sde in rac1.
 

fdisk /dev/sdb > n > p > 1 > w


- Add the following to the "/etc/scsi_id.config" file to configure SCSI devices as trusted. Create the file if it doesn't already exist.
 

/sbin/scsi_id -g -u -d /dev/sdb
36000c29552c32294599f95242522e11a


- Using these values above, edit the "/etc/udev/rules.d/99-oracleasm.rules" in rac1
 

vim /etc/udev/rules.d/99-oracleasm.rules
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29552c32294599f95242522e11a", NAME="asm-disk1", OWNER="oracle", GROUP="asmadmin", MODE="0660"



- start UDEV and list shared disks in rac1
 

/sbin/start_udev
ls -al /dev/asm*


- just refersh disk table and add rules in rac2
 

fdisk /dev/sdb > u > p > w


- Edit "/etc/udev/rules.d/99-oracleasm.rules" file
 

vim /etc/udev/rules.d/99-oracleasm.rules
KERNEL=="sd?1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="36000c29552c32294599f95242522e11a", NAME="asm-disk1", OWNER="oracle", GROUP="asmadmin", MODE="0660"



- start UDEV and list shared disks in rac2
 

/sbin/start_udev
ls -al /dev/asm*



############ install NTP server #################
 

1.0.2.5       rac1.example.com    NTP Server
1.0.2.6       rac6.example.com    NTP Server


- NTP Server configure in rac1, rac2 same steps
 

chkconfig ntpd on


- Edit "/etc/ntp.conf" file
 

vim /etc/ntp.conf
restrict 1.0.2.0 mask 255.255.255.0 nomodify notrap
server  1.0.2.5
server  1.0.2.6
fudge   1.0.2.6 stratum 10
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
 

- Edit /etc/sysconfig/ntpd file:
 

vim /etc/sysconfig/ntpd
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid -g"
SYNC_HWCLOCK=no

chown ntp:ntp /etc/ntp

/etc/init.d/ntpd restart

ntpq -p

    remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
rac1.example.co .INIT.          16 u    - 1024    0    0.000    0.000   0.000
rac2.example.co .INIT.          16 u  592 1024    0    0.000    0.000   0.000


############# DNS Master & Slave Server configuration #################
 

1.0.2.5       rac1.example.com    DNS Master
1.0.2.6       rac2.example.com    DNS Slave


############ DNS Master configuration (rac1) ################
 

yum install -y bind bind-libs bind-utils


- Edit main DNS file "named.conf"
 

vim /etc/named.conf
options {
       listen-on port 53 { 1.0.2.5; };
       directory       "/var/named";
       dump-file       "/var/named/data/cache_dump.db";
       statistics-file "/var/named/data/named_stats.txt";
       memstatistics-file "/var/named/data/named_mem_stats.txt";
       allow-query     { 1.0.2.0/24; };
       allow-transfer { 1.0.2.6;};
       recursion yes;

       dnssec-enable yes;
       dnssec-validation yes;
       dnssec-lookaside auto;

       bindkeys-file "/etc/named.iscdlv.key";
       managed-keys-directory "/var/named/dynamic";
};

logging {
       channel default_debug {
               file "data/named.run";
               severity dynamic;
       };
};

zone "." IN {
       type hint;
       file "named.ca";
};

zone "example.com." IN {
       type master;
       file "example.fwd";
       allow-update { none; };
};

zone "2.0.1.in-addr.arpa." IN {
       type master;
       file "example.rev";
       allow-update { none; };
};

include "/etc/named.root.key";


- Create "example.fwd" and "example.rev" files:
 

cd /var/named/
cp -v localdomain.zone example.fwd
cp -v named.local example.rev


- Edit "/var/named/example.fwd" to set forward zone
 

vim /var/named/example.fwd

$TTL 86400
@   IN  SOA     rac1.example.com. root.rac1.example.com. (
       2011071001  ;Serial
       3600        ;Refresh
       1800        ;Retry
       604800      ;Expire
       86400       ;Minimum TTL
)
@          IN NS   rac1.example.com.
@          IN NS   rac2.example.com.
@               IN A    1.0.2.5
@              IN A    1.0.2.6
@           IN A    1.0.2.11
@           IN A    1.0.2.12
@           IN A    1.0.2.15
@          IN A    1.0.2.16
@           IN A    1.0.2.17
rac1            IN A    1.0.2.5
rac2            IN A    1.0.2.6
rac1-vip        IN A    1.0.2.11
rac2-vip        IN A    1.0.2.12
rac-scan        IN A    1.0.2.15
rac-scan        IN A    1.0.2.16
rac-scan        IN A    1.0.2.17


- Edit "/var/named/example.rev" to set reverse zone
 

vim /var/named/example.rev
$TTL    86400
@       IN      SOA     rac1.example.com. root.rac1.example.com.  (
                                     1997022700 ; Serial
                                     28800      ; Refresh
                                     14400      ; Retry
                                     3600000    ; Expire
                                     86400 )    ; Minimum
@          IN NS   rac1.example.com.
@          IN NS   rac2.example.com.
@          IN PTR    example.com.
rac1            IN A    1.0.2.5
rac2            IN A    1.0.2.6
rac1-vip        IN A    1.0.2.11
rac2-vip        IN A    1.0.2.12
rac-scan        IN A    1.0.2.15
rac-scan        IN A    1.0.2.16
rac-scan        IN A    1.0.2.17
5          IN PTR  rac1.example.com.
6          IN PTR  rac2.example.com.
11         IN PTR  rac1-vip.example.com.
12         IN PTR  rac2-vip.example.com.
15            IN PTR  rac-scan.example.com.
16         IN PTR  rac-scan.example.com.
17         IN PTR  rac-scan.example.com.


- change chroot premission to "named" group
 

chgrp named /etc/named.conf
chgrp named /var/named/example.fwd
chgrp named /var/named/example.rev


- Test DNS configuration and zone files for any syntax errors
 

named-checkconf  /etc/named.conf
named-checkzone example.com /var/named/example.fwd
named-checkzone example.com /var/named/example.rev


############### Configure Slave DNS Server ##############
 

yum install -y bind bind-libs bind-utils


- Edit main DNS file "named.conf"
 

vim /var/named.conf
options {
       listen-on port 53 { 1.0.2.6; };
       directory       "/var/named";
       dump-file       "/var/named/data/cache_dump.db";
       statistics-file "/var/named/data/named_stats.txt";
       memstatistics-file "/var/named/data/named_mem_stats.txt";
       allow-query     { 1.0.2.0/24; };
       recursion yes;

       dnssec-enable yes;
       dnssec-validation yes;
       dnssec-lookaside auto;

       bindkeys-file "/etc/named.iscdlv.key";
       managed-keys-directory "/var/named/dynamic";
};

logging {
       channel default_debug {
               file "data/named.run";
               severity dynamic;
       };
};

zone "." IN {
       type hint;
       file "named.ca";
};

zone "example.com." IN {
       type slave;
       file "slaves/example.fwd";
       allow-update { none; };
       masters { 1.0.2.5; };
};
zone "2.0.1.in-addr.arpa." IN {
       type slave;
       file "slaves/example.rev";
       allow-update { none; };
       masters { 1.0.2.5; };
};

include "/etc/named.root.key";


- restart DNS server in rac1, rac2
 

/etc/init.d/named restart


- Verfiy DNS Server working in rac1, rac2
 

dig rac1.example.com
dig rac2.example.com
dig -x 1.0.2.5
dig -x 1.0.2.6
nslookup rac1
nslookup rac2
nslookup rac1-vip
nslookup rac2-vip
nslookup rac-scan


############### install grid software ##################
- Extract grid software to rac1 and extract it to gird as user oracle
 

[oracle@rac1 ~]$ cd /media/CDROM/
[oracle@rac1 ~]$ unzip -d /tmp/ ./linuxamd64_12102_grid_1of2.zip
[oracle@rac1 ~]$ unzip -d /tmp/ ./linuxamd64_12102_grid_2of2.zip
[oracle@rac1 ~]$ unzip -d /tmp/ ./linuxamd64_12102_database_1of2.zip
[oracle@rac1 ~]$ unzip -d /tmp/ ./linuxamd64_12102_database_2of2.zip


- set up password sharing:
 

cd /tmp/grid/sshsetup/
./sshUserSetup.sh -user oracle -hosts "rac1 rac2" -noPromptPassphrase -confirm -advanced

- runcluvfy.sh script is used to ensure your cluster is ready for the grid install
cd grid
./runcluvfy.sh stage -pre crsinst -n rac1,rac2
./runInstaller


################## install database software ##################
 

cd /tmp/database/
./runInstaller


################# Verify RAC installation ###################
 

srvctl config database -d cdbrac
srvctl status database -d cdbrac
srvctl status listener
srvctl status asm
sqlplus as sysdba
SELECT inst_name FROM v$active_instances;


################# shutdown RAC database ######################
 

srvctl stop database -d cdbrac
srvctl stop instance -d cdbrac -i cdbrac1,cdbrac2
srvctl stop asm -n rac1 -o immediate


Saturday, December 20, 2014

Oracle Database 11g Release 2 RAC On Oracle Linux 5.5 Using VirtualBox

Resources:



Software
Enterprise Linux 5.4 64-bit: https://edelivery.oracle.com/linux/


- Install Enterprise Linux 5.5 x64 Bit:


rac1.example.com
rac2.example.com
internal Network (eth0)
1.0.5.5
1.0.5.6
internal Network (eth1)
1.0.6.5
1.0.6.6
Nat (eth2)
10.0.4.5
10.0.4.6
HDD
50GB
50GB
RAM
4GB
4GB

Desktop Environments > GNOME Desktop Environment
Applications > Editors
Applications > Graphical Internet
Development > Development Libraries
Development > Development Tools
Servers > Server Configuration Tools
Base System > Administration Tools
Base System > Base
Base System > System Tools
Base System > X Window System

- install Packages
 


# From Oracle Linux 5 DVD
cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh elfutils-libelf-0.*
rpm -Uvh elfutils-libelf-devel-*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh-2*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh pdksh-5*
cd /
eject



- Linux Kernel Parameters for Oracle 11gR2 on RHEL 5, Edit the /etc/sysctl.conf and add following lines:
 

vim /etc/sysctl.conf
# kernel parameters for 11g installation
kernel.shmmni = 4096 
kernel.shmmax = 4398046511104
kernel.shmall = 1073741824
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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 = 1048586


- Now execute “sysctl -p” command to apply the new settings:
 

/sbin/sysctl -p


- Edit the /etc/security/limits.conf file and add following lines:
 

vim /etc/security/limits.conf
# shell limits for users oracle 11gR2
oracle   soft   nproc    131072
oracle   hard   nproc    131072
oracle   soft   nofile   131072
oracle   hard   nofile   131072
oracle   soft   core     unlimited
oracle   hard   core     unlimited
oracle   soft   memlock  50000000
oracle   hard   memlock  50000000


- Edit the /etc/pam.d/login file and add following line:
 

vim /etc/pam.d/login
session    required     pam_limits.so


- To make the change permanent, modify the /etc/sysconfig/selinux change value of SELINUX variable to disabled:
 

vim  /etc/sysconfig/selinux
SELINUX=disabled


- To permanently disable the firewall we will disable the service:
 

service iptables stop
chkconfig iptables off


- create the user oracle account and the OS groups:
 

groupadd dba
groupadd oper
groupadd oinstall
groupadd asmdba
groupadd asmadmin
useradd -g oinstall -G dba,oper,asmdba,asmadmin oracle
passwd oracle


- Create the directories in which the Oracle software will be installed.
 

mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01/


- Login as the "oracle" user and add the following lines at the end of the "/home/oracle/.bash_profile" file.
 

vim /home/oracle/.bash_profile
# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR


ORACLE_HOSTNAME=rac1.example.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=racdb.example.com; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
GRID_HOME=/u01/app/11.2.0/grid; export GRID_HOME
DB_HOME=$ORACLE_BASE/product/11.2.0/db_1; export DB_HOME
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
ORACLE_SID=racdb1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
BASE_PATH=/usr/sbin:$PATH; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH


LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


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'


- Create a file called "/home/oracle/grid_env" with the following contents.
 

vim /home/oracle/grid_env
ORACLE_SID=+ASM1; export ORACLE_SID
ORACLE_HOME=$GRID_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


- Create a file called "/home/oracle/db_env" with the following contents.
 

ORACLE_SID=racdb1; export ORACLE_SID
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH


- Amend the hostname in the "/etc/sysconfig/network" file.
 

vim /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=rac1.example.com


- Enter following data to “/ect/hosts”, rac-scan section is commented to avoid error "oracle cluster verification utility failed" must be resolved be DNS Server
 

vim /etc/hosts
127.0.0.1       localhost.localdomain   localhost


# Public
1.0.5.5   rac1.example.com   rac1
1.0.5.6   rac2.example.com   rac2


# Private
1.0.6.5   rac1-priv.example.com      rac1-priv
1.0.6.6   rac2-priv.example.com      rac2-priv


# Virtual
1.0.5.11   rac1-vip.example.com       rac1-vip
1.0.5.12   rac2-vip.example.com       rac2-vip


# SCAN
#1.0.5.15   rac-scan.example.com       rac-scan
#1.0.5.16   rac-scan.example.com       rac-scan
#1.0.5.17   rac-scan.example.com       rac-scan


- install oracle asm packages for os kernel
 

uname -rm # to know os kernel &  arch
rpm -Uvh oracleasm-support-2.1.7-1.el5.x86_64.rpm oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm
/etc/init.d/oracleasm disable 
/etc/init.d/oracleasm enable
/etc/init.d/oracleasm configure -i
Default user to own the driver interface []: oracle
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]: 


- Install Guest Additions: Log into the VM as the root user and add the "divider=10" option to the kernel boot options in "/etc/grub.conf" file to reduce the idle CPU load.
 


vim /etc/grub.conf
kernel /vmlinuz-2.6.18-308.24.1.0.1.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet numa=off divider=10




######### clone Virtual Machine rac1 to rac2 #######################
######## in rac1
-Use the "fdisk" command to partition the disks sdb to sde.
 

# fdisk /dev/sdb > n > p > 1 > w
# fdisk /dev/sdc > n > p > 1 > w
# fdisk /dev/sdd > n > p > 1 > w
# fdisk /dev/sde > n > p > 1 > w


- in rac1 create ASM disks, Mark the five shared disks as follows.
 

# /usr/sbin/oracleasm createdisk DISK1 /dev/sdb1
# /usr/sbin/oracleasm createdisk DISK2 /dev/sdc1
# /usr/sbin/oracleasm createdisk DISK3 /dev/sdd1
# /usr/sbin/oracleasm createdisk DISK4 /dev/sde1


###### in rac1, rac2 scan for refersh ASM disks
 

/usr/sbin/oracleasm scandisks
/usr/sbin/oracleasm listdisks


- Amend the hostname in the "/etc/sysconfig/network" file.
 

vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=rac2.example.com


- Edit the "/etc/sysconfig/network-scripts/ifcfg-eth0, eth1 to change ip address for rac2
 

eth0 1.0.5.6  255.255.255.0   internal Network
eth1 1.0.6.6  255.255.255.0   internal Network
eth2 10.0.4.6 255.255.255.0   10.0.4.2 nat


- Edit the "/home/oracle/.bash_profile" file on the "rac2" node to correct the ORACLE_SID and ORACLE_HOSTNAME values.
 



ORACLE_SID=racdb2; export ORACLE_SID
ORACLE_HOSTNAME=rac2.example.com; export ORACLE_HOSTNAME


- Also, amend the ORACLE_SID setting in the "/home/oracle/db_env" and "/home/oracle/grid_env" files. - Create a file called "/home/oracle/grid_env" with the following contents.
 

vim /home/oracle/grid_env
ORACLE_SID=+ASM2; export ORACLE_SID


- edit a file called "/home/oracle/db_env" with the following contents.
vim /home/oracle/db_env
ORACLE_SID=racdb2; export ORACLE_SID



############ install NTP server #################

 

1.0.5.6  rac2.example.com NTP Server
1.0.5.5  rac1.example.com NTP Server



- NTP Server configure rac1,rac2 to load in boot startup
 
      
chkconfig ntpd on


- edit NTP server configuration file "/etc/ntp.conf"
 

vim /etc/ntp.conf
restrict 1.0.5.0 mask 255.255.255.0 nomodify notrap
server  1.0.5.5
server  1.0.5.6
fudge   1.0.5.6 stratum 10
driftfile /var/lib/ntp/drift
keys /etc/ntp/keys
   

- edit "/etc/sysconfig/ntpd" by add '-x' and '-g'
 

 vim /etc/sysconfig/ntpd
OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid -g"
SYNC_HWCLOCK=no


- start NTP server in rac1, rac2 and verify it's working
 

/etc/init.d/ntpd start
ntpdate -u 1.0.5.6  
ntpq -p



############# DNS Master & Slave Server configuration #################

 

1.0.5.5  rac1.example.com DNS Master
1.0.5.6  rac2.example.com DNS Slave



########### DNS Master configuration (rac1) ################
 

yum install -y bind bind-libs bind-utils system-config-bind
system-config-bind # to generate configuration files just run one time


- Edit main DNS file "named.conf"
 

vim /etc/named.conf 
options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
};


zone "." IN {
        type hint;
        file "named.root";
};


zone "example.com." IN {
        type master;
        file "example.fwd";
        allow-update { none; };
        allow-transfer { 1.0.5.6; };
};


zone "5.0.1.in-addr.arpa." IN {
        type master;
        file "example.rev";
        allow-update { none; };
        allow-transfer { 1.0.5.6; };
};

include "/etc/rndc.key";


- Create "example.fwd" for forward zone
 

cd /var/named/
cp -v localdomain.zone example.fwd
cp -v named.local example.rev


vim /var/named/example.fwd
$TTL    86400
@               IN SOA  rac1.example.com. root.rac1.example.com. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
         IN NS   rac1.example.com.
         IN NS   rac2.example.com.
rac1            IN A    1.0.5.5
rac2            IN A    1.0.5.6   
rac1-vip        IN A    1.0.5.11      
rac2-vip        IN A    1.0.5.12       
rac-scan        IN A    1.0.5.15       
rac-scan        IN A    1.0.5.16      
rac-scan        IN A    1.0.5.17



- create file "example.rev" for reverse zone:
 

vim /var/named/example.rev
$TTL    86400
@       IN      SOA     rac1.example.com. root.rac1.example.com.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN NS   rac1.example.com.
        IN NS   rac2.example.com.
5       IN PTR  rac1.example.com.
6      IN PTR  rac2.example.com.
11     IN PTR  rac1-vip.example.com.
12     IN PTR  rac2-vip.example.com.
15     IN PTR  rac-scan.example.com.
16     IN PTR  rac-scan.example.com.
17     IN PTR  rac-scan.example.com.


- change chroot premission to "named" group
 

chgrp named /etc/named.conf
chgrp named /var/named/example.fwd
chgrp named /var/named/example.rev


- Test DNS configuration and zone files for any syntax errors
 

named-checkconf  /etc/named.conf 
named-checkzone example.com /var/named/example.fwd
named-checkzone example.com /var/named/example.rev



########### Configure Slave DNS Server ##############
 


yum install -y bind bind-libs bind-utils system-config-bind
system-config-bind # to generate configuration files just run one time


- Edit main DNS file "named.conf"
 


vim /var/named.conf 
options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
};
zone "." IN {
        type hint;
        file "named.root";
};


zone "example.com." IN {
        type slave;
        file "slaves/example.fwd";
        allow-update { none; };
        masters { 1.0.5.5; };
};
zone "5.0.1.in-addr.arpa." IN {
        type slave;
        file "slaves/example.rev";
        allow-update { none; };
        masters { 1.0.5.5; };
};
include "/etc/rndc.key";



- Edit "/etc/resolv.conf" file in clients in rac1, rac2
 

vim /etc/resolv.conf
nameserver 1.0.5.5
nameserver 1.0.5.6
nameserver 8.8.8.8
search example.com



- Network Additions for DNS Server in rac1, rac2
 

vim /etc/sysconfig/network-scripts/ifcfg-eth0 >> PEERDNS=no
vim /etc/sysconfig/network-scripts/ifcfg-eth1 >> PEERDNS=no
vim /etc/sysconfig/network-scripts/ifcfg-eth2 >> PEERDNS=no


- restart DNS server in rac1, rac2
 

/etc/init.d/named restart


- Verfiy DNS Server working in rac1, rac2
 

dig rac1.example.com
dig rac2.example.com
dig -x 1.0.5.5
dig -x 1.0.5.6
nslookup rac1
nslookup rac2
nslookup rac1-vip
nslookup rac2-vip
nslookup rac-scan



############### install grid software ##################
- Extract grid software to rac1 and extract it to gird as user oracle
 

unzip -d /tmp /media/db_112010_lnx64/linux.x64_11gR2.zip
unzip -d /tmp /media/db_112010_lnx64/linux.x64_11gR2_database_1of2
unzip -d /tmp /media/db_112010_lnx64/linux.x64_11gR2_database_2of2


- generate ssh keys between rac1,rac2 using grid software utility (sshUserSetup.sh)
 

cd /tmp/grid/sshsetup/
./sshUserSetup.sh -user oracle -hosts "rac1 rac2" -noPromptPassphrase -confirm -advanced

 - test rac1,rac2 using grid software utility (runcluvfy.sh)
cd /tmp/grid/
./runcluvfy.sh stage -pre crsinst -n rac1,rac2
./runInstaller




########## Verify RAC installation ###########

 


srvctl config database -d racdb
srvctl status database -d racdb
srvctl status listener
srvctl status asm


Status of your database can be visible in OEM 
https://rac1.example.com:1158/em/



########## shutdown RAC databases #############

 


emctl stop dbconsole
srvctl stop database -d racdb
srvctl stop instance -d racdb -i racdb1,racdb2
srvctl stop asm -n rac1 -o immediate


Sunday, October 12, 2014

Installing Oracle Enterprise Manager Grid Control 11g Linux x86

- Source:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/emgc1110/installemgc11101linux/emgc11101install.htm?print=preview&imgs=visible

http://www.gokhanatil.com/2011/07/how-to-install-oracle-grid-control-11g-step-by-step-guide.html

http://www.oracle-base.com/articles/11g/grid-control-11gr1-installation-on-oracle-linux-5.php#db_installation

- Software

Enterprise-R5-U5-Server-i386-dvd.iso
jdk-6u18-linux-i586-rpm.bin
linux_11gR2_database_1of2.zip
linux_11gR2_database_2of2.zip
wls1032_linux32.bin
GridControl_11.1.0.1.0_Linux_1of3.zip
GridControl_11.1.0.1.0_Linux_2of3.zip
GridControl_11.1.0.1.0_Linux_3of3.zip



### Red Hat Enterprise Linux 5 and CentOS 5 Installation
http://www.oracle-base.com/articles/linux/rhel-5-installation.php

### Database Installation
Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 5
http://www.oracle-base.com/articles/11g/grid-control-11gr1-installation-on-oracle-linux-5.php#db_installation

- Set Hostname & IP Address for Virtual Machine


[root@em111srv7 ~]# vim /etc/hosts
10.0.5.7        em111srv7.localdomain   em111srv7
:wq

[root@em111srv7 ~]# vim /etc/sysconfig/network
HOSTNAME=em111srv7.localdomain
:wq

[root@em111srv7 ~]# vim /etc/redhat-release
redhat-4
:wq

[root@em111srv7 ~]# hostname em111srv7.localdomain

[root@em111srv7 ~]# /etc/init.d/network restart



- Creating Required Operating System Groups and Users

# /usr/sbin/groupadd -g 501 oinstall
# /usr/sbin/groupadd -g 502 dba
# /usr/sbin/groupadd -g 503 oper
# /usr/sbin/useradd -u 502 -g oinstall -G dba,oper oracle
# passwd oracle


- Creating Required Directories

# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# mkdir -p /u01/app/oracle/Middleware/oms11g
# mkdir -p /u01/app/oracle/Middleware/agent11g
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01


- Create .bash_profile for user oracle

[root@em111srv7 ~]# vim /home/oracle/.bash_profile
# Oracle Settings
export ORACLE_UNQNAME=em11db
export ORACLE_SID=em11db
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export OMS_HOME=/u01/app/oracle/Middleware/oms11g
export AGENT_HOME=/u01/app/oracle/Middleware/agent11g
export PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
[root@em111srv7 ~]# source /home/oracle/.bash_profile


- Change kernel parameters to /etc/sysctl.conf

[root@em111srv7 ~]# vim /etc/sysctl.conf
# kernel parameters for 11g installation
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
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=1048586

[root@em111srv7 ~]# /sbin/sysctl -p

- Set shell limits in file /etc/security/limits.conf
[root@em111srv7 ~]# vim /etc/security/limits.conf
oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

- Packages Enterprise Linux 5 from DVD
# From Oracle Linux 5 DVD
cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-*
rpm -Uvh compat-db-4*
rpm -Uvh compat-libstdc++-296*
rpm -Uvh rng-utils-2*
rpm -Uvh setarch-2*
cd /
eject

- Disable SELinux & Firewall and reboot server
[root@em111srv7 ~]# vim /etc/selinux/config
SELINUX=disabled

[root@em111srv7 ~]# setup







- Copy all Software files to Virtual Machine
[oracle@rhel7 GridControl_11]$ # Physical Machine
[oracle@rhel7 GridControl_11]$ ll
total 10000120
-rw-------. 1 oracle oracle 1346829079 Oct  3 01:50 GridControl_11.1.0.1.0_Linux_1of3.zip
-rw-------. 1 oracle oracle 1504566656 Oct  3 04:08 GridControl_11.1.0.1.0_Linux_2of3.zip
-rw-------. 1 oracle oracle 1336577721 Oct  3 02:59 GridControl_11.1.0.1.0_Linux_3of3.zip
-rw-------. 1 oracle oracle   80314190 Oct  8 21:13 jdk-6u18-linux-i586-rpm.bin
-rw-------. 1 oracle oracle 1285396902 Aug 19  2009 linux_11gR2_database_1of2.zip
-rw-------. 1 oracle oracle  995359177 Aug 19  2009 linux_11gR2_database_2of2.zip
-rwxr-xr-x. 1 oracle oracle  633454825 Oct 21  2009 wls1032_linux32.bin

[oracle@rhel7 GridControl_11]$ # copy all software at once to Virtual Machine
[oracle@rhel7 GridControl_11]$ du -chs
9.6G    .
9.6G    total
[oracle@rhel7 GridControl_11]$ scp -v -r ./* oracle@10.0.5.7:/tmp/
oracle@10.0.5.7's password:

- Start Database Software & Instance installation

[oracle@em111srv7 ~]$ cd /tmp/
[oracle@em111srv7 tmp]$ unzip linux_11gR2_database_1of2.zip
[oracle@em111srv7 tmp]$ unzip linux_11gR2_database_2of2.zip 
[oracle@em111srv7 ~]$ cd /tmp/database/
[oracle@em111srv7 database]$ ./runInstaller 


























[root@em111srv7 ~]# /u01/app/oraInventory/orainstRoot.sh 
[root@em111srv7 ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh 




- Drop Enterprise Manager Database Control repository 
[oracle@em111srv7 ~]$ emctl stop dbconsole
[oracle@em111srv7 ~]$ emca -deconfig dbcontrol db -repos drop -SYS_PWD oracle -SYSMAN_PWD oracle

Enter the following information:
Database SID: em11db
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

Do you wish to continue? [yes(Y)/no(N)]: yes

- Change database initialization parameter:
[oracle@em111srv7 ~]$ sqlplus / as sysdba

SQL> ALTER SYSTEM SET log_buffer=10485760 SCOPE=SPFILE;  

System altered.

SQL> ALTER SYSTEM SET processes=500 SCOPE=SPFILE;

System altered.

SQL> ALTER SYSTEM SET session_cached_cursors=200 SCOPE=SPFILE;

System altered.

SQL> SELECT name FROM v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/em11db/system01.dbf
/u01/app/oracle/oradata/em11db/sysaux01.dbf
/u01/app/oracle/oradata/em11db/undotbs01.dbf
/u01/app/oracle/oradata/em11db/users01.dbf
/u01/app/oracle/oradata/em11db/example01.dbf

SQL> ALTER DATABASE DATAFILE '/u01/app/oracle/oradata/em11db/undotbs01.dbf' RESIZE 200M;

Database altered.
SQL> shutdown immediate
SQL> startup

- install Java JDK
[root@em111srv7 ~]# cd /tmp/
[root@em111srv7 tmp]# chmod +x jdk-6u18-linux-i586-rpm.bin 
[root@em111srv7 tmp]# ./jdk-6u18-linux-i586-rpm.bin
q
yes


### Install Oracle WebLogic Server
[oracle@em111srv7 ~]$ cd /tmp/
[oracle@em111srv7 tmp]$ chmod +x wls1032_linux32.bin 
[oracle@em111srv7 tmp]$ ./wls1032_linux32.bin 










### Grid Control Installation
[oracle@em111srv7 ~]$ cd /tmp/
[oracle@em111srv7 ~]$ mkdir em111
[oracle@em111srv7 tmp]$ unzip -d em111 GridControl_11.1.0.1.0_Linux_1of3.zip [oracle@em111srv7 tmp]$ unzip -d em111 GridControl_11.1.0.1.0_Linux_2of3.zip [oracle@em111srv7 tmp]$ unzip -d em111 GridControl_11.1.0.1.0_Linux_3of3.zip [oracle@em111srv7 tmp]$ cd /tmp/em111/ [oracle@em111srv7 em111]$ ./runInstaller