quarta-feira, 6 de julho de 2016

Linux OEL 6 or OEL 7 Configuration for Oracle Single or RAC



# ------------------------------------------------------------------------
# Configuration ON Linux
# ------------------------------------------------------------------------
# Installation
# ------------------------------------------------------------------------
# Set parameters on /etc/hosts
# ------------------------------------------------------------------------
#
echo "# Public" >> /etc/hosts
echo "#" >> /etc/hosts
echo "10.0.1.21         srv01.dbnitro.net          srv01" >> /etc/hosts
echo "10.0.1.22         srv02.dbnitro.net          srv02" >> /etc/hosts
echo "10.0.1.23         srv03.dbnitro.net          srv03" >> /etc/hosts
echo "10.0.1.24         srv04.dbnitro.net          srv04" >> /etc/hosts
echo "# Private" >> /etc/hosts
echo "#" >> /etc/hosts
echo "192.168.2.21          srv01-priv.dbnitro.net          srv01-priv" >> /etc/hosts
echo "192.168.2.22          srv02-priv.dbnitro.net          srv02-priv" >> /etc/hosts
echo "192.168.2.23          srv03-priv.dbnitro.net          srv03-priv" >> /etc/hosts
echo "192.168.2.24          srv04-priv.dbnitro.net          srv04-priv" >> /etc/hosts
echo "# Virtual" >> /etc/hosts
echo "#" >> /etc/hosts
echo "10.0.1.31          srv01-vip.dbnitro.net          srv01-vip" >> /etc/hosts
echo "10.0.1.32          srv02-vip.dbnitro.net          srv02-vip" >> /etc/hosts
echo "10.0.1.33          srv03-vip.dbnitro.net          srv03-vip" >> /etc/hosts
echo "10.0.1.34          srv04-vip.dbnitro.net          srv04-vip" >> /etc/hosts
echo "# SCAN" >> /etc/hosts
echo "#" >> /etc/hosts
echo "10.0.1.41          production.dbnitro.net          production" >> /etc/hosts
echo "10.0.1.42          production.dbnitro.net          production" >> /etc/hosts
echo "10.0.1.43          production.dbnitro.net          production" >> /etc/hosts
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Disable SELINUX
# ------------------------------------------------------------------------
vim /etc/sysconfig/selinux
# ------------------------------------------------------------------------
echo "# This file controls the state of SELinux on the system."                  > /etc/sysconfig/selinux
echo "# SELINUX= can take one of these three values:"                          >> /etc/sysconfig/selinux
echo "#     enforcing - SELinux security policy is enforced."                    >> /etc/sysconfig/selinux
echo "#     permissive - SELinux prints warnings instead of enforcing."   >> /etc/sysconfig/selinux
echo "#     disabled - No SELinux policy is loaded."                                  >> /etc/sysconfig/selinux
echo "SELINUX=disabled"                                                                        >> /etc/sysconfig/selinux
echo "# SELINUXTYPE= can take one of these two values:"                   >> /etc/sysconfig/selinux
echo "#     targeted - Targeted processes are protected,"                             >> /etc/sysconfig/selinux
echo "#     mls - Multi Level Security protection."                                      >> /etc/sysconfig/selinux
echo "SELINUXTYPE=targeted"                                                               >> /etc/sysconfig/selinux
cat /etc/sysconfig/selinux
###################################################################################################
#REGRA BASICA
******************************
kernel.shmmax=(METADE DA MEMORIA TOTAL) (ALOCACAO MAXIMA)
kernel.shmmni=(MULTIPLOS DE 4) (BLOCO DE ALOCACAO MINIMA)
kernel.shmall=(1/4 da memoria total)
vm.nr_hugepages=(1/4 da memoria total)/1024 – (HUGE PAGES)
******************************
# ------------------------------------------------------------------------
# Sistemas 64-bit com 128GB de RAM:
echo "# ORACLE RAC PARAMETERS"                    >> /etc/sysctl.conf
echo "#"                                                                          >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                                    >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                                        >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                                       >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                       >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                       >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                         >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                     >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                       >> /etc/sysctl.conf
echo "kernel.shmall = 33554432"                                 >> /etc/sysctl.conf
echo "kernel.shmmax = 68719476736"                        >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 32768"                          >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Sistemas 64-bit com 96GB de RAM:
echo "# ORACLE RAC PARAMETERS"                        >> /etc/sysctl.conf
echo "#"                                              >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                        >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                          >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                 >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                    >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                    >> /etc/sysctl.conf
echo "kernel.shmall = 25165824"                       >> /etc/sysctl.conf
echo "kernel.shmmax = 51539607552"                    >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 32768"                     >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Sistemas 64-bit com 64GB de RAM:
echo "# ORACLE RAC PARAMETERS"                        >> /etc/sysctl.conf
echo "#"                                              >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                        >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                          >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                 >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                    >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                    >> /etc/sysctl.conf
echo "kernel.shmall = 16777216"                       >> /etc/sysctl.conf
echo "kernel.shmmax = 34359738368"                    >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 16384"                     >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Sistemas 64-bit com 32GB de RAM:
echo "# ORACLE RAC PARAMETERS"                        >> /etc/sysctl.conf
echo "#"                                              >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                        >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                          >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                 >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                    >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                    >> /etc/sysctl.conf
echo "kernel.shmall = 8388608"                        >> /etc/sysctl.conf
echo "kernel.shmmax = 17179869184"                    >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 8192"                      >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Sistemas 64-bit com 24GB de RAM:
echo "# ORACLE RAC PARAMETERS"                        >> /etc/sysctl.conf
echo "#"                                              >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                        >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                          >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                 >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                    >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                    >> /etc/sysctl.conf
echo "kernel.shmall = 6291456"                        >> /etc/sysctl.conf
echo "kernel.shmmax = 12884901889"                    >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 6144"                      >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Sistemas 64-bit com 16GB de RAM:
echo "# ORACLE RAC PARAMETERS"                        >> /etc/sysctl.conf
echo "#"                                              >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                        >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                          >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                 >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                    >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                    >> /etc/sysctl.conf
echo "kernel.shmall = 4194304"                        >> /etc/sysctl.conf
echo "kernel.shmmax = 8589934592"                     >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 4096"                      >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Sistemas 64-bit com 8GB de RAM:
echo "# ORACLE RAC PARAMETERS"                        >> /etc/sysctl.conf
echo "#"                                              >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                        >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                          >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                 >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                    >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                    >> /etc/sysctl.conf
echo "kernel.shmall = 2097152"                        >> /etc/sysctl.conf
echo "kernel.shmmax = 4294967295"                     >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 2048"                      >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Sistemas com 4GB de RAM:
echo "# ORACLE RAC PARAMETERS"                        >> /etc/sysctl.conf
echo "#"                                              >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                        >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                          >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                 >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                    >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                    >> /etc/sysctl.conf
echo "kernel.shmall = 1048576"                        >> /etc/sysctl.conf
echo "kernel.shmmax = 2147483648"                     >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 1024"                      >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Sistemas com 1GB of RAM:
echo "# ORACLE RAC PARAMETERS"                        >> /etc/sysctl.conf
echo "#"                                              >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576"                        >> /etc/sysctl.conf
echo "fs.file-max = 6815744"                          >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128"                 >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500"      >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304"                    >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144"                 >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586"                    >> /etc/sysctl.conf
echo "kernel.shmall = 8388608"                        >> /etc/sysctl.conf
echo "kernel.shmmni = 4096"                           >> /etc/sysctl.conf
echo "kernel.shmall = 262144"                         >> /etc/sysctl.conf
echo "###vm.nr_hugepages = 1024"                      >> /etc/sysctl.conf
/sbin/sysctl -p
# ------------------------------------------------------------------------
# Configure limits.conf
# ------------------------------------------------------------------------
#
echo "* soft nproc 2047"           >> /etc/security/limits.conf
echo "* hard nproc 16384"          >> /etc/security/limits.conf
echo "* soft nofile 1024"          >> /etc/security/limits.conf
echo "* hard nofile 65536"         >> /etc/security/limits.conf
echo "* soft memlock 60397977"     >> /etc/security/limits.conf
echo "* hard memlock 60397977"     >> /etc/security/limits.conf
# ------------------------------------------------------------------------
# Configure the NTP service
# ------------------------------------------------------------------------
# OEL 6
# ------------------------------------------------------------------------
service ntpd stop
mv /etc/ntp.conf /etc/ntp.conf.org
# ------------------------------------------------------------------------
echo "OPTIONS=\"-x -u ntp:ntp -p /var/run/ntpd.pid\" " > /etc/sysconfig/ntpd
# ------------------------------------------------------------------------
service ntpd start
chkconfig ntpd on
service ntpd restart
# ------------------------------------------------------------------------
# OEL 7
# ------------------------------------------------------------------------
systemctl stop ntpd
mv /etc/ntp.conf /etc/ntp.conf.org
# ------------------------------------------------------------------------
echo "OPTIONS=\"-x -u ntp:ntp -p /var/run/ntpd.pid\" " > /etc/sysconfig/ntpd
# ------------------------------------------------------------------------
systemctl start ntpd
systemctl enable ntpd
systemctl restart ntpd
systemctl status ntpd
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Create the Groups and Users
# ------------------------------------------------------------------------
# ODA Environment
----------------------------------------------------------------------------------------------------------------------
Groups      Group Name      Group ID      Grid is a member        Oracle is a member
----------- --------------- ------------- ----------------------- ----------------------
oinstall    oinstall        1001          yes (primary group)     yes (primary group)
osdba       dba             1002          no                      yes
osoper      racoper         1003          yes                     yes
osdba       asmdba          1004          yes                     yes
osoper      asmoper         1005          yes                     no
osasm       asmadmin        1006          yes                     no
--------------------------------------------------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Groups ( yum -y install system-config-users )
# ------------------------------------------------------------------------
/usr/sbin/groupadd -g 54421 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 asmdba
/usr/sbin/groupadd -g 54326 dgdba
/usr/sbin/groupadd -g 54327 kmdba
/usr/sbin/groupadd -g 54328 asmadmin
/usr/sbin/groupadd -g 54329 asmoper
/usr/sbin/groupadd -g 54330 asm
/usr/sbin/groupadd -g 54331 grid
# ------------------------------------------------------------------------
# Create Users
# ------------------------------------------------------------------------
/usr/sbin/useradd -u 54321 -g asmadmin -G asm,asmdba,oinstall,asmadmin,asmoper,backupdba,dgdba,kmdba,oper,grid grid
/usr/sbin/useradd -u 54322 -g oinstall -G dba,asmdba,oinstall,backupdba,dgdba,kmdba,oper,grid oracle
# ------------------------------------------------------------------------
# Modify Users
# ------------------------------------------------------------------------
/usr/sbin/usermod -u 54321 -g asmadmin -G asm,asmdba,asmadmin,oinstall,asmoper,backupdba,dgdba,kmdba,oper,grid grid
/usr/sbin/usermod -u 54322 -g oinstall -G dba,asmdba,oinstall,backupdba,dgdba,kmdba,oper,grid oracle
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Password
passwd grid
passwd oracle
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Create the folders to Grid and Database
# Change the permission to GRID (verify if is necessary re-run this part of the script after Grid installation)
# ------------------------------------------------------------------------
# Grid (Verify this configuration before the Grid Installation)
# ------------------------------------------------------------------------
mount -t tmpfs shmfs -o size=10g /dev/shm
echo "shmfs          /dev/shm          tmpfs          size=10g          0" >> /etc/fstab
cat /etc/fstab
# ------------------------------------------------------------------------

Linux OEL 6 or OEL 7 Packages for Oracle Single or RAC

# ------------------------------------------------------------------------
# Packeges on LINUX x64
# ------------------------------------------------------------------------
# OEL 6
# ------------------------------------------------------------------------
iptables -F
ip6tables -F
chkconfig iptables off
chkconfig ip6tables off
# ------------------------------------------------------------------------
# OEL 7
# ------------------------------------------------------------------------
systemctl stop firewalld
systemctl disable firewalld
# ------------------------------------------------------------------------
# SET NEW PROXY
vi /etc/yum.conf
vi /etc/yum.repos.d/......
proxy=http://10.0.0.254:3128
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# SET NEW GATEWAY
vi /etc/sysconfig/network
# OEL 6
GATEWAY=192.0.2.1
GATEWAYDEV=eth3
# ------------------------------------------------------------------------
# OEL 7
GATEWAY=192.0.2.1
GATEWAYDEV=enp0s9
# ------------------------------------------------------------------------
yum -y upgrade
# ------------------------------------------------------------------------
rpm -Uvh epel-release
rpm -Uvh oracleasm
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# https://blogs.oracle.com/wim/entry/setting_up_oracle_linux_6
# ------------------------------------------------------------------------
# OEL 6x
# ------------------------------------------------------------------------
# Verify [ WITH ] RDBMS Package
# ------------------------------------------------------------------------
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' atop beakerlib-vim-syntax binutils cpp compat-libcap1 compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel epel-release.noarch gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers htop iotop iptraf-ng iscsi-initiator-utils iscsi-initiator-utils-devel libiscsi netbsd-iscsi ksh kmod-oracleasm libaio libaio-devel libgcc libstdc++ libstdc++-devel libiscsi libXtst libXtst-devel lsof make net-tools ntp nfs-utils nmap oracleasmlib oracleasm-support oracle-rdbms-server-11gR2-preinstall oracle-rdbms-server-12cR1-preinstall perl perl-DBI perl-ExtUtils-MakeMaker perl-CPAN python-psutil protobuf-vim psmisc readline-devel rlwrap sysstat telnet tuned tuned-utils unixODBC unixODBC-devel unzip vim-X11 vim-clustershell vim-common vim-enhanced vim-filesystem vim-minimal wget xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-utils xorg-x11-apps xorg-x11-xauth
# ------------------------------------------------------------------------
# Install [ WITH ] RDBMS Package
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
yum -y install atop beakerlib-vim-syntax binutils cpp compat-libcap1 compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel epel-release.noarch gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers htop iotop iptraf-ng iscsi-initiator-utils iscsi-initiator-utils-devel libiscsi netbsd-iscsi ksh kmod-oracleasm libaio libaio-devel libgcc libstdc++ libstdc++-devel libiscsi libXtst libXtst-devel lsof make net-tools ntp nfs-utils nmap oracleasmlib oracleasm-support oracle-rdbms-server-11gR2-preinstall oracle-rdbms-server-12cR1-preinstall perl perl-DBI perl-ExtUtils-MakeMaker perl-CPAN python-psutil protobuf-vim psmisc readline-devel rlwrap sysstat telnet tuned tuned-utils unixODBC unixODBC-devel unzip vim-X11 vim-clustershell vim-common vim-enhanced vim-filesystem vim-minimal wget xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-utils xorg-x11-apps xorg-x11-xauth
# ------------------------------------------------------------------------
# Verify [ WITHOUT ] RDBMS Package
# ------------------------------------------------------------------------
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' atop beakerlib-vim-syntax binutils cpp compat-libcap1 compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel epel-release.noarch gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers htop iotop iptraf-ng iscsi-initiator-utils iscsi-initiator-utils-devel libiscsi netbsd-iscsi ksh kmod-oracleasm libaio libaio-devel libgcc libstdc++ libstdc++-devel libiscsi libXtst libXtst-devel lsof make net-tools ntp nfs-utils nmap oracleasmlib oracleasm-support perl perl-DBI perl-ExtUtils-MakeMaker perl-CPAN python-psutil protobuf-vim psmisc readline-devel rlwrap sysstat telnet tuned tuned-utils unixODBC unixODBC-devel unzip vim-X11 vim-clustershell vim-common vim-enhanced vim-filesystem vim-minimal wget xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-utils xorg-x11-apps xorg-x11-xauth
# ------------------------------------------------------------------------
# Install [ WITHOUT ] RDBMS Package
# ------------------------------------------------------------------------
yum -y install atop beakerlib-vim-syntax binutils cpp compat-libcap1 compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel epel-release.noarch gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers htop iotop iptraf-ng iscsi-initiator-utils iscsi-initiator-utils-devel libiscsi netbsd-iscsi ksh kmod-oracleasm libaio libaio-devel libgcc libstdc++ libstdc++-devel libiscsi libXtst libXtst-devel lsof make net-tools ntp nfs-utils nmap oracleasmlib oracleasm-support perl perl-DBI perl-ExtUtils-MakeMaker perl-CPAN python-psutil protobuf-vim psmisc readline-devel rlwrap sysstat telnet tuned tuned-utils unixODBC unixODBC-devel unzip vim-X11 vim-clustershell vim-common vim-enhanced vim-filesystem vim-minimal wget xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-utils xorg-x11-apps xorg-x11-xauth
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# OEL 7x
# ------------------------------------------------------------------------
# Verify [ WITH ] RDBMS Package
# ------------------------------------------------------------------------
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' atop beakerlib-vim-syntax binutils bind-utils cpp compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel epel-release.noarch gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers htop iotop iptraf-ng iscsi-initiator-utils iscsi-initiator-utils-iscsiuio libiscsi netbsd-iscsi targetcli ksh kmod-oracleasm libaio libaio-devel libgcc libstdc++ libstdc++-devel libiscsi libXtst libXtst-devel lsof make net-tools ntp nfs-utils nmap oracleasmlib oracleasm-support oracle-rdbms-server-11gR2-preinstall oracle-rdbms-server-12cR1-preinstall perl perl-DBI perl-ExtUtils-MakeMaker perl-CPAN python-psutil protobuf-vim psmisc readline-devel rlwrap sysstat telnet tuned tuned-utils unixODBC unixODBC-devel unzip vim-X11 vim-clustershell vim-common vim-enhanced vim-filesystem vim-minimal wget xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-utils xorg-x11-apps xorg-x11-xauth
# ------------------------------------------------------------------------
# Install [ WITH ] RDBMS package
# ------------------------------------------------------------------------
yum -y install atop beakerlib-vim-syntax binutils bind-utils cpp compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel epel-release.noarch gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers htop iotop iptraf-ng iscsi-initiator-utils iscsi-initiator-utils-iscsiuio libiscsi netbsd-iscsi targetcli ksh kmod-oracleasm libaio libaio-devel libgcc libstdc++ libstdc++-devel libiscsi libXtst libXtst-devel lsof make net-tools ntp nfs-utils nmap oracleasmlib oracleasm-support oracle-rdbms-server-11gR2-preinstall oracle-rdbms-server-12cR1-preinstall perl perl-DBI perl-ExtUtils-MakeMaker perl-CPAN python-psutil protobuf-vim psmisc readline-devel rlwrap sysstat telnet tuned tuned-utils unixODBC unixODBC-devel unzip vim-X11 vim-clustershell vim-common vim-enhanced vim-filesystem vim-minimal wget xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-utils xorg-x11-apps xorg-x11-xauth
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Verify [ WITHOUT ] RDBMS package
# ------------------------------------------------------------------------
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' atop beakerlib-vim-syntax binutils bind-utils cpp compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel epel-release.noarch gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers htop iotop iptraf-ng iscsi-initiator-utils iscsi-initiator-utils-iscsiuio libiscsi netbsd-iscsi targetcli ksh kmod-oracleasm libaio libaio-devel libgcc libstdc++ libstdc++-devel libiscsi libXtst libXtst-devel lsof make net-tools ntp nfs-utils nmap oracleasmlib oracleasm-support perl perl-DBI perl-ExtUtils-MakeMaker perl-CPAN python-psutil protobuf-vim psmisc readline-devel rlwrap sysstat telnet tuned tuned-utils unixODBC unixODBC-devel unzip vim-X11 vim-clustershell vim-common vim-enhanced vim-filesystem vim-minimal wget xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-utils xorg-x11-apps xorg-x11-xauth
# ------------------------------------------------------------------------
# Install [ WITHOUT ] RDBMS package
# ------------------------------------------------------------------------
yum -y install atop beakerlib-vim-syntax binutils bind-utils cpp compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel epel-release.noarch gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers htop iotop iptraf-ng iscsi-initiator-utils iscsi-initiator-utils-iscsiuio libiscsi netbsd-iscsi targetcli ksh kmod-oracleasm libaio libaio-devel libgcc libstdc++ libstdc++-devel libiscsi libXtst libXtst-devel lsof make net-tools ntp nfs-utils nmap oracleasmlib oracleasm-support perl perl-DBI perl-ExtUtils-MakeMaker perl-CPAN python-psutil protobuf-vim psmisc readline-devel rlwrap sysstat telnet tuned tuned-utils unixODBC unixODBC-devel unzip vim-X11 vim-clustershell vim-common vim-enhanced vim-filesystem vim-minimal wget xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-utils xorg-x11-apps xorg-x11-xauth
# ------------------------------------------------------------------------

sexta-feira, 10 de julho de 2015

Oracle RAC 12c on OEL 6 with ISCSI Storage

This material is valid to Virtual or Phisical Environment.
I created 3 Virtual Machines:
Storage: OEL 6 - 512 MB Memory - Local Disk 20 GB
name: stg01.localdomain
eth0: 192.168.56.150


Node1: EOL 6 - 2 GB Memory - Local Disk 100 GB
name: rac01.localdomain
eth0: 192.168.56.111
eth1: 192.168.57.111


Node2: EOL 6 - 2 GB Memory - Local Disk 100 GB
name: rac02.localdomain
eth0: 192.168.56.112
eth1: 192.168.57.112




# ------------------------------------------------------------------------
# This is valid for OEL 6 and OEL 7
# ------------------------------------------------------------------------
########################### DNS Server ###################################
# ------------------------------------------------------------------------
# Disable Graphic Startup
# ------------------------------------------------------------------------
# OEL 6
# Last line: from 5 to 3
vim /etc/inittab
# OEL 7
systemctl set-default multi-user.target
# ------------------------------------------------------------------------
# Disable all firewalls
# ------------------------------------------------------------------------
# OEL 6
/etc/init.d/iptables stop
chkconfig iptables off
iptables -L
iptables -F
iptables -L
/etc/init.d/ip6tables stop
chkconfig ip6tables off
ip6tables -L
ip6tables -F
ip6tables -L
# OEL 7
iptables -L
iptables -F
iptables -L
ip6tables -L
ip6tables -F
ip6tables -L
systemctl stop iptables.service
systemctl stop ip6tables.service
systemctl disable iptables.service
systemctl disable ip6tables.service
# ------------------------------------------------------------------------
# Disable SELINUX
# ------------------------------------------------------------------------
vim /etc/sysconfig/selinux
# ------------------------------------------------------------------------
echo "# This file controls the state of SELinux on the system." > /etc/sysconfig/selinux
echo "# SELINUX= can take one of these three values:" >> /etc/sysconfig/selinux
echo "#     enforcing - SELinux security policy is enforced." >> /etc/sysconfig/selinux
echo "#     permissive - SELinux prints warnings instead of enforcing." >> /etc/sysconfig/selinux
echo "#     disabled - No SELinux policy is loaded." >> /etc/sysconfig/selinux
echo "SELINUX=disabled" >> /etc/sysconfig/selinux
echo "# SELINUXTYPE= can take one of these two values:" >> /etc/sysconfig/selinux
echo "#     targeted - Targeted processes are protected," >> /etc/sysconfig/selinux
echo "#     mls - Multi Level Security protection." >> /etc/sysconfig/selinux
echo "SELINUXTYPE=targeted" >> /etc/sysconfig/selinux
cat /etc/sysconfig/selinux
# ------------------------------------------------------------------------
# Installation and Configuration of DNS
# ------------------------------------------------------------------------
# Install bind and bind-utils with yum
yum -y install bind bind-utils
# ------------------------------------------------------------------------
# Install bind and bind-utils with cdrom/dvd
mount /dev/cdrom /mnt/
cd /mnt/Packages/
rpm -Uvh bind-9.9.4-18.el7.x86_64.rpm
rpm -Uvh bind-utils-9.9.4-18.el7.x86_64.rpm
# ------------------------------------------------------------------------
# NAMED Configuration
# ------------------------------------------------------------------------
vim /etc/named.conf
# ------------------------------------------------------------------------
echo "options {" > /etc/named.conf
echo "        listen-on port 53 {127.0.0.1; 192.168.56.150;};" >> /etc/named.conf
echo "directory               "/var/named";" >> /etc/named.conf
echo "dump-file               "/var/named/data/cache_dump.db";" >> /etc/named.conf
echo "statistics-file         "/var/named/data/named_stats.txt";" >> /etc/named.conf
echo "// query-source address * port 53;" >> /etc/named.conf
echo "};" >> /etc/named.conf
echo "" >> /etc/named.conf
echo "zone "." in {" >> /etc/named.conf
echo "type hint;" >> /etc/named.conf
echo "file "/dev/null";" >> /etc/named.conf
echo "};" >> /etc/named.conf
echo "zone "localdomain." IN {" >> /etc/named.conf
echo "  type master;" >> /etc/named.conf
echo "      file "localdomain.zone";" >> /etc/named.conf
echo "      allow-update {none;};" >> /etc/named.conf
echo "};" >> /etc/named.conf
# ------------------------------------------------------------------------
# DOMAIN Configutaion
# ------------------------------------------------------------------------
vim /var/named/localdomain.zone
# ------------------------------------------------------------------------
touch /var/named/localdomain.zone
# ------------------------------------------------------------------------
echo "\$TTL 86400" >> /var/named/localdomain.zone
echo "@       IN SOA localhost root.localhost (" >> /var/named/localdomain.zone
echo "                42 ; serial (d. adams)" >> /var/named/localdomain.zone
echo "                3H ; refresh" >> /var/named/localdomain.zone
echo "                15M ; retry" >> /var/named/localdomain.zone
echo "                1W ; expiry" >> /var/named/localdomain.zone
echo "                1D ) ; minimum" >> /var/named/localdomain.zone
echo "          IN NS localhost" >> /var/named/localdomain.zone
echo "localhost IN A  127.0.0.1" >> /var/named/localdomain.zone
echo "rac01           IN A 192.168.56.111" >> /var/named/localdomain.zone
echo "rac02           IN A 192.168.56.112" >> /var/named/localdomain.zone
echo "rac01-vip       IN A 192.168.56.211" >> /var/named/localdomain.zone
echo "rac02-vip       IN A 192.168.56.212" >> /var/named/localdomain.zone
echo "prod-scan       IN A 192.168.56.200" >> /var/named/localdomain.zone
echo "prod-scan       IN A 192.168.56.201" >> /var/named/localdomain.zone
echo "prod-scan       IN A 192.168.56.202" >> /var/named/localdomain.zone
# ------------------------------------------------------------------------
# Deixe APENAS as seguintes linhas no arquivo
# ------------------------------------------------------------------------
vim /var/named/56.168.192.in-addr.arpa
# ------------------------------------------------------------------------
touch /var/named/56.168.192.in-addr.arpa
# ------------------------------------------------------------------------
echo "\$ORIGIN 56.168.192.in-addr.arpa." >> /var/named/56.168.192.in-addr.arpa
echo "\$TTL 1H" >> /var/named/56.168.192.in-addr.arpa
echo "@ IN SOA stg01.localdomain. root.stg01.localdomain. (" >> /var/named/56.168.192.in-addr.arpa
echo "        2" >> /var/named/56.168.192.in-addr.arpa
echo "        3H" >> /var/named/56.168.192.in-addr.arpa
echo "        1H" >> /var/named/56.168.192.in-addr.arpa
echo "        1W" >> /var/named/56.168.192.in-addr.arpa
echo "        1H )" >> /var/named/56.168.192.in-addr.arpa
echo "56.168.192.in-addr.arpa. IN NS stg01.localdomain." >> /var/named/56.168.192.in-addr.arpa
echo "111 IN PTR rac01.localdomain." >> /var/named/56.168.192.in-addr.arpa
echo "112 IN PTR rac02.localdomain." >> /var/named/56.168.192.in-addr.arpa
echo "211 IN PTR rac01-vip.localdomain." >> /var/named/56.168.192.in-addr.arpa
echo "212 IN PTR rac02-vip.localdomain." >> /var/named/56.168.192.in-addr.arpa
echo "200 IN PTR prod-scan.localdomain." >> /var/named/56.168.192.in-addr.arpa
echo "201 IN PTR prod-scan.localdomain." >> /var/named/56.168.192.in-addr.arpa
echo "202 IN PTR prod-scan.localdomain." >> /var/named/56.168.192.in-addr.arpa
# ------------------------------------------------------------------------
# Enable and Startup of DNS Services
# ------------------------------------------------------------------------
# OEL 6
service named status
service named start
chkconfig named on
service named restart
# OEL 7
systemctl start named.service
systemctl enable named.service
systemctl restart named.service
# ------------------------------------------------------------------------
######################## Storage Server ###################################
# ------------------------------------------------------------------------
vim /etc/tgt/targets.conf
# ------------------------------------------------------------------------
echo "<target iqn.2015-07.de.robotron:storage.dsk01>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdb1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk02>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdc1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk03>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdd1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk04>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sde1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk05>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdf1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk06>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdg1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk07>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdh1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk08>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdi1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk09>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdj1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk10>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdk1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk11>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdl1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk12>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdm1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk13>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdn1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk14>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdo1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk15>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdp1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk16>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdq1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk17>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdr1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk18>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sds1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk19>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdt1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
echo "<target iqn.2015-07.de.robotron:storage.dsk20>" >> /etc/tgt/targets.conf
echo "backing-store /dev/sdu1" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.111" >> /etc/tgt/targets.conf
echo " initiator-address 192.168.56.112" >> /etc/tgt/targets.conf
echo "</target>" >> /etc/tgt/targets.conf
# ------------------------------------------------------------------------
########################### NODES RAC ####################################
# ------------------------------------------------------------------------
# This is valid for OEL 6 and OEL 7
# ------------------------------------------------------------------------
# Disable Graphic Startup
# ------------------------------------------------------------------------
# OEL 6
# Last line: from 5 to 3
vim /etc/inittab
# OEL 7
systemctl set-default multi-user.target
# ------------------------------------------------------------------------
# Disable all firewalls
# ------------------------------------------------------------------------
# OEL 6
/etc/init.d/iptables stop
chkconfig iptables off
iptables -L
iptables -F
iptables -L
/etc/init.d/ip6tables stop
chkconfig ip6tables off
ip6tables -L
ip6tables -F
ip6tables -L
# OEL 7
iptables -L
iptables -F
iptables -L
ip6tables -L
ip6tables -F
ip6tables -L
systemctl stop iptables.service
systemctl stop ip6tables.service
systemctl disable iptables.service
systemctl disable ip6tables.service
# ------------------------------------------------------------------------
# Disable SELINUX
# ------------------------------------------------------------------------
vim /etc/sysconfig/selinux
# ------------------------------------------------------------------------
echo "# This file controls the state of SELinux on the system." > /etc/sysconfig/selinux
echo "# SELINUX= can take one of these three values:" >> /etc/sysconfig/selinux
echo "#     enforcing - SELinux security policy is enforced." >> /etc/sysconfig/selinux
echo "#     permissive - SELinux prints warnings instead of enforcing." >> /etc/sysconfig/selinux
echo "#     disabled - No SELinux policy is loaded." >> /etc/sysconfig/selinux
echo "SELINUX=disabled" >> /etc/sysconfig/selinux
echo "# SELINUXTYPE= can take one of these two values:" >> /etc/sysconfig/selinux
echo "#     targeted - Targeted processes are protected," >> /etc/sysconfig/selinux
echo "#     mls - Multi Level Security protection." >> /etc/sysconfig/selinux
echo "SELINUXTYPE=targeted" >> /etc/sysconfig/selinux
cat /etc/sysconfig/selinux
# ------------------------------------------------------------------------
# Set the parameters on sysctl.conf
# ------------------------------------------------------------------------
vim /etc/sysctl.conf
# ------------------------------------------------------------------------
echo "# ORACLE PARAMETERS" >> /etc/sysctl.conf
echo "#" >> /etc/sysctl.comf
echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf
echo "fs.file-max = 6815744" >> /etc/sysctl.conf
echo "kernel.shmmni = 4096" >> /etc/sysctl.conf
echo "kernel.sem = 250 32000 100 128" >> /etc/sysctl.conf
echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
echo "net.core.rmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.rmem_max = 4194304" >> /etc/sysctl.conf
echo "net.core.wmem_default = 262144" >> /etc/sysctl.conf
echo "net.core.wmem_max = 1048586" >> /etc/sysctl.conf
echo "kernel.shmall = 8388608" >> /etc/sysctl.conf
echo "kernel.shmmax = 17179869184" >> /etc/sysctl.conf
# ------------------------------------------------------------------------
/etc/sysctl -p
# ------------------------------------------------------------------------
# Set the limits on limits.conf
# ------------------------------------------------------------------------
echo "* soft nproc 2047" >> /etc/security/limits.conf
echo "* hard nproc 16384" >> /etc/security/limits.conf
echo "* soft nofile 1024" >> /etc/security/limits.conf
echo "* hard nofile 65536" >> /etc/security/limits.conf
# ------------------------------------------------------------------------
# Set the tmpfs on /etc/fstab (Oracle 12c needed this configuration)
# ------------------------------------------------------------------------
mount -t tmpfs shmfs -o size=8g /dev/shm
# ------------------------------------------------------------------------
vim /etc/fstab
echo "shmfs /dev/shm tmpfs size=8g 0" >> /etc/fstab
cat /etc/fstab
# ------------------------------------------------------------------------
# Set parameters on /etc/hosts
# ------------------------------------------------------------------------
echo "# Public" >> /etc/hosts
echo "#" >> /etc/hosts
echo "192.168.56.111         rac01.localdomain          rac01" >> /etc/hosts
echo "192.168.56.112         rac02.localdomain          rac02" >> /etc/hosts
echo "# Private" >> /etc/hosts
echo "#" >> /etc/hosts
echo "192.168.57.111          rac01-priv.localdomain          rac01-priv" >> /etc/hosts
echo "192.168.57.112          rac02-priv.localdomain          rac02-priv" >> /etc/hosts
echo "# Virtual" >> /etc/hosts
echo "#" >> /etc/hosts
echo "192.168.56.211          rac01-vip.localdomain          rac01-vip" >> /etc/hosts
echo "192.168.56.212          rac02-vip.localdomain          rac02-vip" >> /etc/hosts
echo "# SCAN" >> /etc/hosts
echo "#" >> /etc/hosts
echo "192.168.56.200          prod-scan.localdomain          prod-scan" >> /etc/hosts
echo "192.168.56.201          prod-scan.localdomain          prod-scan" >> /etc/hosts
echo "192.168.56.202          prod-scan.localdomain          prod-scan" >> /etc/hosts
# ------------------------------------------------------------------------
# Disable this services
# ------------------------------------------------------------------------
chkconfig anacron off
chkconfig atd off
chkconfig cups off
chkconfig cups-config-daemon off
chkconfig gpm off
chkconfig iptables off
chkconfig kudzu off
chkconfig lvm2-monitor off
chkconfig microcode_ctl off
chkconfig sendmail off
chkconfig smartd off
chkconfig auditd off
chkconfig avahi-daemon off
chkconfig bluetooth off
chkconfig firstboot off
chkconfig hidd off
chkconfig ip6tables off
chkconfig iptables off
chkconfig mcstrans off
chkconfig mdmonitor off
chkconfig pcscd off
chkconfig rawdevices off
chkconfig readahead_early off
chkconfig readahead_later off
chkconfig restorecond off
chkconfig setroubleshoot off
chkconfig yum-updatesd off
chkconfig nfs off
chkconfig autofs on
chkconfig cpuspeed on
chkconfig haldaemon on
chkconfig irqbalance on
chkconfig messagebus on
chkconfig netfs on
chkconfig nfslock on
chkconfig rpcgssd on
chkconfig rpcidmapd on
chkconfig portmap on
chkconfig pcscd on
chkconfig rpcsvcgssd on
chkconfig ocfs2 off
chkconfig ntpd off
chkconfig ntp off
# ------------------------------------------------------------------------
# Configure the NTP service
# ------------------------------------------------------------------------
# OEL 6
service ntpd stop
mv /etc/ntp.conf /etc/ntp.conf.org
rm /var/run/ntpd.pid
vim /etc/sysconfig/ntpd
# OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid" Then restart NTP.
service ntpd restart
chkconfig ntpd on
# OEL 7
systemctl stop ntpd.service
mv /etc/ntp.conf /etc/ntp.conf.org
rm /var/run/ntpd.pid
vim /etc/sysconfig/ntpd
# OPTIONS="-x -u ntp:ntp -p /var/run/ntpd.pid" Then restart NTP.
systemctl enable ntpd.service
systemctl restart ntpd.service
# ------------------------------------------------------------------------
# Verify and Install all necessary packages
# ------------------------------------------------------------------------
mount /dev/cdrom /mnt/
# OEL 6
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils cloog-ppl cpp compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel rlwrap oracleasm oracleasmlib oracleasm-support
cd /mnt/Packages/
rpm -Uvh mpfr-2.4.1-6.el6.x86_64.rpm ppl-0.10.2-11.el6.x86_64.rpm cloog-ppl-0.15.7-1.2.el6.x86_64.rpm cpp-4.4.7-3.el6.x86_64.rpm elfutils-libelf-devel-0.152-1.el6.x86_64.rpm gcc-4.4.7-3.el6.x86_64.rpm gcc-c++-4.4.7-3.el6.x86_64.rpm glibc-headers-2.12-1.107.el6.x86_64.rpm glibc-devel-2.12-1.107.el6.x86_64.rpm ksh-20100621-19.el6.x86_64.rpm libaio-devel-0.3.107-10.el6.x86_64.rpm libstdc++-devel-4.4.7-3.el6.x86_64.rpm unixODBC-2.2.14-12.el6_3.x86_64.rpm unixODBC-devel-2.2.14-12.el6_3.x86_64.rpm oracleasm-support-2.1.8-1.el6.x86_64.rpm
# ------------------------------------------------------------------------
mount /dev/cdrom /mnt/
# OEL 7
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' binutils cpp compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel rlwrap oracleasm oracleasmlib oracleasm-support ntp
cd /mnt/Packages/
rpm -Uvh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm compat-libcap1-1.10-7.el7.x86_64.rpm mpfr-3.1.1-4.el7.x86_64.rpm cpp-4.8.3-9.el7.x86_64.rpm elfutils-libelf-devel-0.160-1.el7.x86_64.rpm gcc-4.8.3-9.el7.x86_64.rpm gcc-c++-4.8.3-9.el7.x86_64.rpm glibc-headers-2.17-78.0.1.el7.x86_64.rpm glibc-devel-2.17-78.0.1.el7.x86_64.rpm ksh-20120801-22.el7.x86_64.rpm libaio-devel-0.3.109-12.el7.x86_64.rpm libstdc++-devel-4.8.3-9.el7.x86_64.rpm unixODBC-2.3.1-10.el7.x86_64.rpm unixODBC-devel-2.3.1-10.el7.x86_64.rpm oracleasm-support-2.1.8-3.el7.x86_64.rpm oracle-rdbms-server-12cR1-preinstall-1.0-3.el7.x86_64.rpm
#rpm -Uvh elfutils-libelf-devel-0.160-1.el7.x86_64.rpm ksh-20120801-22.el7.x86_64.rpm libaio-devel-0.3.109-12.el7.x86_64.rpm unixODBC-2.3.1-10.el7.x86_64.rpm unixODBC-devel-2.3.1-10.el7.x86_64.rpm oracleasm-support-2.1.8-3.el7.x86_64.rpm oracle-rdbms-server-12cR1-preinstall-1.0-3.el7.x86_64.rpm
# ------------------------------------------------------------------------
yum -y install elfutils-libelf-devel ksh libaio-devel unixODBC unixODBC-devel oracleasm-support oracleasmlib
yum -y install watch screen rlwrap terminator
# ------------------------------------------------------------------------
# Create the Groups and Users
# ------------------------------------------------------------------------
# Users
groupadd dba
groupadd grid
groupadd oper
groupadd asmdba
groupadd asmoper
groupadd oinstall
groupadd asmadmin
# Groups
useradd -g grid grid
useradd -g dba oracle
# Modify
usermod -g dba -G grid,oinstall,oper,asmadmin,asmdba,asmoper oracle
usermod -g grid -G dba,oinstall,oper,asmadmin,asmdba,asmoper grid
# Password
passwd grid
passwd oracle
# ------------------------------------------------------------------------
# Create the folders to unzip the products
# ------------------------------------------------------------------------
mkdir /disks
chown -R grid.grid /disks
# ------------------------------------------------------------------------
# Create the folders to Grid and Database
# Change the permission to GRID (verify if is necessary re-run this part of the script after Grid installation)
# ------------------------------------------------------------------------
# Grid (Verify this configuration before the Grid Installation)
mkdir -p /u01/app/12.1.0.2/grid
chown -R grid.grid /u01/app/12.1.0.2
chown -R oracle.dba /u01 /disks/
chmod -R 775 /u01 /disks/
chown -R grid:grid /u01/app/12.1.0.2 /disks
chmod -R 775 /u01/app/12.1.0.2 /disks
# Database (Verify this configuration before the Database Installation)
mkdir -p /u01/app/oracle/product/12.1.0.2/db_1
chown -R oracle.dba /u01/app/oracle/product/12.1.0.2
chmod 777 /u01/app/oraInventory
chmod 777 /u01/app/oraInventory/*
# ------------------------------------------------------------------------
# Verify the environment with Oracle Tool
# ------------------------------------------------------------------------
./runcluvfy.sh comp nodecon -n rac01,rac02 -verbose
# ------------------------------------------------------------------------
# Is necessary this RPM install
# ------------------------------------------------------------------------
rpm -Uvh /disks/grid/rpm/cvuqdisk-1.0.9-1.rpm
# ------------------------------------------------------------------------
# In fail cases (is necessary check this permissions)
# ------------------------------------------------------------------------
# chmod -R 775 /u01/ /u01/app/oracle /disks /backup
# chmod -R 640 /u01/ /u01/app/oracle /disks /backup
# chmod 640 -R /u01/app/oracle/oradata/dbprod/
# chmod 640 -R /u01/app/oracle/fast_recovery_area/dbprod/
# chmod 0600 /u01/app/12.1.0.2/grid
# ------------------------------------------------------------------------
# Set Environment Variables (GRID and ORACLE)
# ------------------------------------------------------------------------
# RAC01 - ORACLE
# ------------------------------------------------------------------------
echo "# Variaveis de ambiente ORACLE RAC [ORACLE]" >> /home/oracle/.bash_profile
echo "export TMP=/tmp" >> /home/oracle/.bash_profile
echo "export TMPDIR=\$TMP" >> /home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=rac01.localdomain" >> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=prod" >> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile
echo "export GRID_HOME=/u01/app/12.1.0.2/grid" >> /home/oracle/.bash_profile
echo "export ORACLE_HOME=\$ORACLE_BASE/product/12.1.0.2/db_1" >> /home/oracle/.bash_profile
echo "export DBS=\$ORACLE_HOME/dbs" >> /home/oracle/.bash_profile
echo "export TNS=\$ORACLE_HOME/network/admin" >> /home/oracle/.bash_profile
echo "export ORACLE_SID=prod1" >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm" >> /home/oracle/.bash_profile
echo "export PATH=/usr/sbin:\$PATH" >> /home/oracle/.bash_profile
echo "export PATH=\$ORACLE_HOME/bin:\$GRID_HOME/bin:\$PATH" >> /home/oracle/.bash_profile
echo "export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:\$GRID_HOME/lib:/lib:/usr/lib" >> /home/oracle/.bash_profile
echo "export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib" >> /home/oracle/.bash_profile
echo "export ALERTLOG=\${ORACLE_BASE}/diag/rdbms/\${ORACLE_UNQNAME}/\${ORACLE_SID}/trace/alert_\${ORACLE_SID}.log" >> /home/oracle/.bash_profile
echo "alias sqlplus='rlwrap sqlplus'" >> /home/oracle/.bash_profile
echo "alias s='rlwrap sqlplus / as sysdba'" >> /home/oracle/.bash_profile
echo "alias rman='rlwrap rman'" >> /home/oracle/.bash_profile
echo "alias r='rlwrap rman target /'" >> /home/oracle/.bash_profile
echo "alias dgmgrl='rlwrap dgmgrl'" >> /home/oracle/.bash_profile
echo "alias d='rlwrap dgmgrl connect /'" >> /home/oracle/.bash_profile
echo "alias asmcmd='rlwrap asmcmd'" >> /home/oracle/.bash_profile
echo "alias a='rlwrap asmcmd'" >> /home/oracle/.bash_profile
echo "umask 0022" >> /home/oracle/.bash_profile
# ------------------------------------------------------------------------
# RAC01 - GRID
# ------------------------------------------------------------------------
echo "# Variaveis de ambiente ORACLE RAC [GRID]" >> /home/grid/.bash_profile
echo "export TMP=/tmp" >> /home/grid/.bash_profile
echo "export TMPDIR=\$TMP" >> /home/grid/.bash_profile
echo "export ORACLE_HOSTNAME=rac01.localdomain" >> /home/grid/.bash_profile
echo "export ORACLE_UNQNAME=prod" >> /home/grid/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle" >> /home/grid/.bash_profile
echo "export GRID_HOME=/u01/app/12.1.0.2/grid" >> /home/grid/.bash_profile
echo "export ORACLE_HOME=\$GRID_HOME" >> /home/grid/.bash_profile
echo "export DBS=\$ORACLE_HOME/dbs" >> /home/grid/.bash_profile
echo "export TNS=\$ORACLE_HOME/network/admin" >> /home/grid/.bash_profile
echo "export ORACLE_SID=+ASM1" >> /home/grid/.bash_profile
echo "export ORACLE_TERM=xterm" >> /home/grid/.bash_profile
echo "export PATH=/usr/sbin:\$PATH" >> /home/grid/.bash_profile
echo "export PATH=\$ORACLE_HOME/bin:\$GRID_HOME/bin:\$PATH" >> /home/grid/.bash_profile
echo "export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:\$GRID_HOME/lib:/lib:/usr/lib" >> /home/grid/.bash_profile
echo "export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib" >> /home/grid/.bash_profile
echo "export ALERTLOG=\${ORACLE_BASE}/diag/crs/rac01/crs/trace/alert.log" >> /home/grid/.bash_profile
echo "export ALERTASM=\${ORACLE_BASE}/diag/asm/+asm/\$ORACLE_SID/trace/alert_\${ORACLE_SID}.log" >> /home/grid/.bash_profile
echo "alias sqlplus='rlwrap sqlplus'" >> /home/grid/.bash_profile
echo "alias s='rlwrap sqlplus / as sysasm'" >> /home/grid/.bash_profile
echo "alias rman='rlwrap rman'" >> /home/grid/.bash_profile
echo "alias r='rlwrap rman target /'" >> /home/grid/.bash_profile
echo "alias dgmgrl='rlwrap dgmgrl'" >> /home/grid/.bash_profile
echo "alias d='rlwrap dgmgrl connect /'" >> /home/grid/.bash_profile
echo "alias asmcmd='rlwrap asmcmd'" >> /home/grid/.bash_profile
echo "alias a='rlwrap asmcmd'" >> /home/grid/.bash_profile
echo "umask 0022" >> /home/grid/.bash_profile
# ------------------------------------------------------------------------
# RAC02 - ORACLE
# ------------------------------------------------------------------------
echo "# Variaveis de ambiente ORACLE RAC [ORACLE]" >> /home/oracle/.bash_profile
echo "export TMP=/tmp" >> /home/oracle/.bash_profile
echo "export TMPDIR=\$TMP" >> /home/oracle/.bash_profile
echo "export ORACLE_HOSTNAME=rac02.localdomain" >> /home/oracle/.bash_profile
echo "export ORACLE_UNQNAME=prod" >> /home/oracle/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle" >> /home/oracle/.bash_profile
echo "export GRID_HOME=/u01/app/12.1.0.2/grid" >> /home/oracle/.bash_profile
echo "export ORACLE_HOME=\$ORACLE_BASE/product/12.1.0.2/db_1" >> /home/oracle/.bash_profile
echo "export DBS=\$ORACLE_HOME/dbs" >> /home/oracle/.bash_profile
echo "export TNS=\$ORACLE_HOME/network/admin" >> /home/oracle/.bash_profile
echo "export ORACLE_SID=prod2" >> /home/oracle/.bash_profile
echo "export ORACLE_TERM=xterm" >> /home/oracle/.bash_profile
echo "export PATH=/usr/sbin:\$PATH" >> /home/oracle/.bash_profile
echo "export PATH=\$ORACLE_HOME/bin:\$GRID_HOME/bin:\$PATH" >> /home/oracle/.bash_profile
echo "export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:\$GRID_HOME/lib:/lib:/usr/lib" >> /home/oracle/.bash_profile
echo "export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib" >> /home/oracle/.bash_profile
echo "export ALERTLOG=\${ORACLE_BASE}/diag/rdbms/\${ORACLE_UNQNAME}/\${ORACLE_SID}/trace/alert_\${ORACLE_SID}.log" >> /home/oracle/.bash_profile
echo "alias sqlplus='rlwrap sqlplus'" >> /home/oracle/.bash_profile
echo "alias s='rlwrap sqlplus / as sysdba'" >> /home/oracle/.bash_profile
echo "alias rman='rlwrap rman'" >> /home/oracle/.bash_profile
echo "alias r='rlwrap rman target /'" >> /home/oracle/.bash_profile
echo "alias dgmgrl='rlwrap dgmgrl'" >> /home/oracle/.bash_profile
echo "alias d='rlwrap dgmgrl connect /'" >> /home/oracle/.bash_profile
echo "alias asmcmd='rlwrap asmcmd'" >> /home/oracle/.bash_profile
echo "alias a='rlwrap asmcmd'" >> /home/oracle/.bash_profile
echo "umask 0022" >> /home/oracle/.bash_profile
# ------------------------------------------------------------------------
# RAC02 - GRID
# ------------------------------------------------------------------------
echo "# Variaveis de ambiente ORACLE RAC [GRID]" >> /home/grid/.bash_profile
echo "export TMP=/tmp" >> /home/grid/.bash_profile
echo "export TMPDIR=\$TMP" >> /home/grid/.bash_profile
echo "export ORACLE_HOSTNAME=rac02.localdomain" >> /home/grid/.bash_profile
echo "export ORACLE_UNQNAME=prod" >> /home/grid/.bash_profile
echo "export ORACLE_BASE=/u01/app/oracle" >> /home/grid/.bash_profile
echo "export GRID_HOME=/u01/app/12.1.0.2/grid" >> /home/grid/.bash_profile
echo "export ORACLE_HOME=\$GRID_HOME" >> /home/grid/.bash_profile
echo "export DBS=\$ORACLE_HOME/dbs" >> /home/grid/.bash_profile
echo "export TNS=\$ORACLE_HOME/network/admin" >> /home/grid/.bash_profile
echo "export ORACLE_SID=+ASM2" >> /home/grid/.bash_profile
echo "export ORACLE_TERM=xterm" >> /home/grid/.bash_profile
echo "export PATH=/usr/sbin:\$PATH" >> /home/grid/.bash_profile
echo "export PATH=\$ORACLE_HOME/bin:\$GRID_HOME/bin:\$PATH" >> /home/grid/.bash_profile
echo "export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:\$GRID_HOME/lib:/lib:/usr/lib" >> /home/grid/.bash_profile
echo "export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib" >> /home/grid/.bash_profile
echo "export ALERTLOG=\${ORACLE_BASE}/diag/crs/rac02/crs/trace/alert.log" >> /home/grid/.bash_profile
echo "export ALERTASM=\${ORACLE_BASE}/diag/asm/+asm/\$ORACLE_SID/trace/alert_\${ORACLE_SID}.log" >> /home/grid/.bash_profile
echo "alias sqlplus='rlwrap sqlplus'" >> /home/grid/.bash_profile
echo "alias s='rlwrap sqlplus / as sysasm'" >> /home/grid/.bash_profile
echo "alias rman='rlwrap rman'" >> /home/grid/.bash_profile
echo "alias r='rlwrap rman target /'" >> /home/grid/.bash_profile
echo "alias dgmgrl='rlwrap dgmgrl'" >> /home/grid/.bash_profile
echo "alias d='rlwrap dgmgrl connect /'" >> /home/grid/.bash_profile
echo "alias asmcmd='rlwrap asmcmd'" >> /home/grid/.bash_profile
echo "alias a='rlwrap asmcmd'" >> /home/grid/.bash_profile
echo "umask 0022" >> /home/grid/.bash_profile
# ------------------------------------------------------------------------
# Oracle ASM Configuration
# ------------------------------------------------------------------------
# OEL 6
oracleasm configure -i
oracleasm enable
# OEL 7
oracleasm configure -i
systemctl enable oracleasm.service
# ------------------------------------------------------------------------
# Oracle ASM Disks Configuration with ISCSI
# ------------------------------------------------------------------------
# OEL 6
service iscsi start
service iscsid start
chkconfig iscsi on
chkconfig iscsid on
# OEL 7
systemctl start iscsi.service
systemctl start iscsid.service
systemctl enable iscsi.service
systemctl enable iscsid.service
# ------------------------------------------------------------------------
# ISCSI Configuration
# ------------------------------------------------------------------------
iscsiadm -m discovery -t sendtargets -p 192.168.56.150
# ------------------------------------------------------------------------
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk01 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk02 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk03 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk04 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk05 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk06 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk07 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk08 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk09 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk10 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk11 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk12 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk13 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk14 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk15 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk16 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk17 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk18 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk19 -p 192.168.56.150 -l
iscsiadm -m node -T iqn.2015-07.de.robotron:storage.dsk20 -p 192.168.56.150 -l
# ------------------------------------------------------------------------
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk01" > /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk02" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk03" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk04" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk05" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk06" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk07" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk08" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk09" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk10" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk11" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk12" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk13" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk14" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk15" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk16" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk17" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk18" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk19" >> /etc/iscsi/initiatorname.iscsi
echo "InitiatorName=iqn.2015-07.de.robotron:storage.dsk20" >> /etc/iscsi/initiatorname.iscsi
# ------------------------------------------------------------------------
# FDISK Configuration
# ------------------------------------------------------------------------
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
fdisk /dev/sde
fdisk /dev/sdf
fdisk /dev/sdg
fdisk /dev/sdh
fdisk /dev/sdi
fdisk /dev/sdj
fdisk /dev/sdk
fdisk /dev/sdl
fdisk /dev/sdm
fdisk /dev/sdn
fdisk /dev/sdo
fdisk /dev/sdp
fdisk /dev/sdq
fdisk /dev/sdr
fdisk /dev/sds
fdisk /dev/sdt
fdisk /dev/sdu
# ------------------------------------------------------------------------
# Partprobe (check partitions)
# ------------------------------------------------------------------------
partprobe /dev/sdb1
partprobe /dev/sdc1
partprobe /dev/sdd1
partprobe /dev/sde1
partprobe /dev/sdf1
partprobe /dev/sdg1
partprobe /dev/sdh1
partprobe /dev/sdi1
partprobe /dev/sdj1
partprobe /dev/sdk1
partprobe /dev/sdl1
partprobe /dev/sdm1
partprobe /dev/sdn1
partprobe /dev/sdo1
partprobe /dev/sdp1
partprobe /dev/sdq1
partprobe /dev/sdr1
partprobe /dev/sds1
partprobe /dev/sdt1
partprobe /dev/sdu1
# ------------------------------------------------------------------------
# ORACLE ASM Create Disks (just on node 1)
# ------------------------------------------------------------------------
oracleasm createdisk asm01 /dev/sdb1
oracleasm createdisk asm02 /dev/sdc1
oracleasm createdisk asm03 /dev/sdd1
oracleasm createdisk asm04 /dev/sde1
oracleasm createdisk asm05 /dev/sdf1
oracleasm createdisk asm06 /dev/sdg1
oracleasm createdisk asm07 /dev/sdh1
oracleasm createdisk asm08 /dev/sdi1
oracleasm createdisk asm09 /dev/sdj1
oracleasm createdisk asm10 /dev/sdk1
oracleasm createdisk asm11 /dev/sdl1
oracleasm createdisk asm12 /dev/sdm1
oracleasm createdisk asm13 /dev/sdn1
oracleasm createdisk asm14 /dev/sdo1
oracleasm createdisk asm15 /dev/sdp1
oracleasm createdisk asm16 /dev/sdq1
oracleasm createdisk asm17 /dev/sdr1
oracleasm createdisk asm18 /dev/sds1
oracleasm createdisk asm19 /dev/sdt1
oracleasm createdisk asm20 /dev/sdu1
# ------------------------------------------------------------------------
# ORACLE ASM Scan Disks (all others nodes)
# ------------------------------------------------------------------------
oracleasm scandisks
# ------------------------------------------------------------------------
# ORACLE ASM Check Disks (all others nodes)
# ------------------------------------------------------------------------
oracleasm querydisk -v -p asm01
oracleasm querydisk -v -p asm02
oracleasm querydisk -v -p asm03
oracleasm querydisk -v -p asm04
oracleasm querydisk -v -p asm05
oracleasm querydisk -v -p asm06
oracleasm querydisk -v -p asm07
oracleasm querydisk -v -p asm08
oracleasm querydisk -v -p asm09
oracleasm querydisk -v -p asm10
oracleasm querydisk -v -p asm11
oracleasm querydisk -v -p asm12
oracleasm querydisk -v -p asm13
oracleasm querydisk -v -p asm14
oracleasm querydisk -v -p asm15
oracleasm querydisk -v -p asm16
oracleasm querydisk -v -p asm17
oracleasm querydisk -v -p asm18
oracleasm querydisk -v -p asm19
oracleasm querydisk -v -p asm20
# ------------------------------------------------------------------------
# Grid Installation
# ------------------------------------------------------------------------
# Connect with grid user
su - grid
# Access the folder of Grid Installation
sh /disks/grid/runInstall
# ------------------------------------------------------------------------
# Verification after Grid Installation
# ------------------------------------------------------------------------
crsctl stat res -t
crsctl status res |grep -v "^$"|awk -F "=" 'BEGIN {print " "} {printf("%s",NR%4 ? $2"|" : $2"\n")}'|sed -e 's/  *, /,/g' -e 's/, /,/g' |awk -F "|" 'BEGIN { printf "%-40s%-35s%-20s%-50s\n","Resource Name","Resource Type","Target ","State" }{ split ($3,trg,",") split ($4,st,",")}{for (i in trg) {printf "%-40s%-35s%-20s%-50s\n",$1,$2,trg[i],st[i]}}'
# ------------------------------------------------------------------------
# Database Installation
# ------------------------------------------------------------------------
# Connect with oracle user
su - oracle
# Access the folder of Database Installation
sh /disks/database/runInstall
# ------------------------------------------------------------------------