CentOS6.6x64 automated installation of OracleDatabase11gR2RAC script

Source: Internet
Author: User
CentOS6.6x64 automated installation of OracleDatabase11gR2RAC script

CentOS 6.6x64 automated installation of Oracle Database 11gR2 RAC script

OS: CentOS 6.6
Hostname: rac11g03, rac11g04
IP: rac11g03 192.108.56.103 192.108.96.103 192.108.26.103
Rac11g04 192.108.56.104 192.108.96.104 192.108.26.104
Oracle: 11.2.0.4
Storage: openfiler 192.108.26.100: 3260

Note:
1. centos 6.6 has been installed in basic, and the ip address and host name have been set.
The license is placed under the/root of rac11g03, And the pdksh-5.2.14-30.x86_64.rpm package is placed under the/root of rac11g03.
3. selectshen used by the password, which can be modified as needed
4. Three CIDR blocks: 192.108.56.0: public, 192.108.96.0: private, 192.108.26.0: storage
5. The following script can be used to quickly deploy RAC in the development and testing environment by making some adjustments in robustness and versatility.

Implementation:
################################# Step 1 ##### ############################
################## Rac11g04_init.sh:
#! /Bin/bash
# Here, the required package is installed after the optical drive is loaded. You can also change it to the network mode.
Mkdir/media/cdrom
Mount/dev/cdrom/media/cdrom
Mv/etc/yum. repos. d/*. repo/root/

Cat>/etc/yum. repos. d/CentOS-Media.repo <EOF
C6-media
Name = CentOS-$ releasever-Media
Baseurl = file: // media/cdrom/
Gpgcheck = 1
Enabled = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
EOF

Yum clean all
Yum makecache

# Adjust the hosts file
Cat>/etc/hosts <EOF
192.108.56.103 rac11g03
192.108.56.104 rac11g04
192.108.56.203 rac11g03-vip
192.108.56.204 rac11g04-vip
192.108.56.205 rac11g-scan
192.108.96.103 rac11g03-priv
192.108.96.104 rac11g04-priv
EOF

# Disable the firewall and selinux
Chkconfig iptables off
Service iptables stop
Setenforce 0
Sed-I's/SELINUX = enforcing/SELINUX = disabled/'/etc/selinux/config

# Network Parameter Adjustment
Cat>/etc/sysctl. conf <EOF
Kernel. shmmni = 4096
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 = 1048576
Net. core. rmem_max = 4194304
Net. core. wmem_default = 262144
Net. core. wmem_max = 1048576
EOF

Sysctl-p

# Resource limit parameter adjustment
Cat>/etc/security/limits. conf <EOF
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Grid soft nproc 2047
Grid hard nproc 16384
Grid soft nofile 1024
Grid hard nofile 65536
EOF

# Login Parameter Adjustment
Cat>/etc/pam. d/login <EOF
Session required/lib64/security/pam_limits.so
EOF

# Install the missing package
Yum-y install gcc-c ++ make binutils compat-libstdc ++-33 elfutils-libelf-devel glibc-common glibc-devel libaio-devel libgcc libstdc ++ libstdc ++-devel unixODBC-devel

Yum-y install benchmark CT

Ln-s/lib64/libcap. so.2.16/lib64/libcap. so.1

# Clear NTP service
Service ntpd stop
Chkconfig ntpd off
Mv/etc/ntp. conf/etc/ntp. conf. bak
Mv/var/run/ntpd. pid/var/run/ntpd. pid. bak

# Create a grid and an oracle user
Groupadd-g 1000 oinstall
Groupadd-g 1100 asmadmin
Groupadd-g 1200 dba
Groupadd-g 1300 asmdba
Useradd-u 1100-d/home/oracle-g oinstall-G dba, asmdba oracle
Useradd-u 1101-d/home/grid-g oinstall-G asmadmin, asmdba grid
Echo "selectshen" | passwd -- stdin oracle
Echo "selectshen" | passwd -- stdin grid

Cat>/home/grid/. bash_profile <EOF
Export TMP =/tmp
Export TMPDIR = $ TMP
Export ORACLE_BASE =/u01/app/grid
Export ORACLE_HOME =/u01/app/11.2.0/grid
Export GRID_HOME =/u01/app/11.2.0/grid
Export ORACLE_SID = + ASM1
Export ORACLE_TERM = xterm
Export PATH =/usr/sbin: \ $ PATH
Export PATH =\$ ORACLE_HOME/bin: \ $ PATH
Export LD_LIBRARY_PATH =\$ ORACLE_HOME/bin:/usr/local/bin:/usr/X11R6/bin/
Export CLASSPATH =\$ ORACLE_HOME/JRE: \ $ ORACLE_HOME/jlib: \ $ ORACLE_HOME/rdbms/jlib
Ulimit-u 16384-n 65536
Umask 022
EOF

./Home/grid/. bash_profile


Cat>/home/oracle/. bash_profile <EOF
Export TMP =/tmp
Export TMPDIR = $ TMP
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME =\$ ORACLE_BASE/product/11.2.0/db_1
Export ORACLE_SID = rac11g
Export ORACLE_TERM = xterm
Export PATH =/usr/sbin: \ $ PATH
Export PATH =\$ ORACLE_HOME/bin: \ $ PATH
Export LD_LIBRARY_PATH =\$ ORACLE_HOME/bin:/usr/local/bin:/usr/X11R6/bin/
Export CLASSPATH =\$ ORACLE_HOME/JRE: \ $ ORACLE_HOME/jlib: \ $ ORACLE_HOME/rdbms/jlib
Ulimit-u 16384-n 65536
Umask 022
EOF

./Home/oracle/. bash_profile


# Create an installation directory
Mkdir-p/u01/app/11.2.0/grid
Chown-R grid. oinstall/u01
Mkdir-p/u01/app/oracle/product/11.2.0/db_1
Chown-R oracle. oinstall/u01/app/oracle
Chmod-R 775/u01

# Configure the iscsi connection to openfiler storage. Here, we need to set it according to the actual situation. Here is a 40 GB disk, which is divided into two 20 GB zones.
Yum-y install iscsi-initiator-utils
Iscsiadm-m discovery-t sendtargets-p 192.108.26.100: 3260
Service iscsi restart

Fdisk/dev/sdb < N
P
1

+ 20G
N
P
2


W
EOF

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.