Install Oracle Database 12c RAC 12.1.0.1 on Oracle Enterprise Linux 5 using VBOX
Oracle database is very complex, especially installing a complete set of Oracle DB on different platforms or storage tests not only the technical level of a person, but also the patience and carefulness of technicians. Among them, it is necessary to master too much knowledge in the field of IT technology, including but not limited to hardware, network, storage and software, and even business scale and application architecture. Technology is always an endless journey, but as long as you master the most common principles and hone more, you will be able to get better with practice and achieve more with less effort.
With the launch of Oracle 12C, a cloud database similar to plugin Database has appeared, which is a boon for multiple organizations and multiple business departments, because the pluggable cloud database can significantly reduce the management load of IT departments or DBA teams , withdraw from the huge-scale system operation and maintenance business, and concentrate on solving the business problems of the designated system, especially the performance problems. I simulated and installed Oracle 12C RAC Cluster with two nodes through the Oracle VirtualBox virtual machine. The specific script is as follows. The specific video can also be watched by searching "Askerain" podcast on Tudou.com. There are four lectures in the video.
1.Configure network.
=>vi /etc/hosts
192.168.1.101 prohost prohost.oracle.com
192.168.1.102 prohost-vip
192.168.1.103 promast promast.oracle.com
192.168.1.104 promast-vip
192.168.1.105 pro-cluster pro-cluster-scan
172.168.1.101 prohost-priv
172.168.1.102 promast-priv
=================================================
192.168.56.101 prod1 prod1.oracle.com
192.168.56.102 prod1-vip
192.168.56.103 prod2 prod2.oracle.com
192.168.56.104 prod2-vip
192.168.56.105 pro-cluster pro-cluster-scan
172.168.1.101 prod1-priv
172.168.1.102 prod2-priv
2.Disabled firewall and selinux.
=>vi /etc/selinux/config [disabled]
3.Create user and group.
groupadd -g 5000 asmadmin
groupadd -g 5001 asmdba
groupadd -g 5002 asmoper
groupadd -g 6000 oinstall
groupadd -g 6001 dba
groupadd -g 6002 oper
useradd -g oinstall -G asmadmin,asmdba,asmoper grid
useradd -g oinstall -G dba,asmdba oracle
=>passwd oracle
=>passwd grid
4.Create directory for oracle.
=>mkdir /odb
=>mkdir /ogi
=>chown oracle:oinstall /odb
=>chown grid:;oinstall /ogi
5.Mount disk and yum install configuretion.
=>mkdir /media/mnt
=>mount /dev/cdrom /media/mnt
=>cd /etc/yum.repos.d
=>touch public-yum-ol5.repo
[oel5]
name=Enterprise Linux 5.7 DVD
baseurl=file:///media/mnt/Server
gpgcheck=0
enabled=1
=>yum install oracle-validated*
=>yum install oracle-rdbms-server-11gR2-preinstall-1.0-6.el6
6.Set ulimit parameters for user grid.
=>su grid
=>ulimit -a
=>su
=>vi /etc/security/limits.conf
# grid-rdbms-server-11gR2-preinstall setting for nofile soft limit is 1024
grid soft nofile 1024
# grid-rdbms-server-11gR2-preinstall setting for nofile hard limit is 65536
grid hard nofile 65536
# grid-rdbms-server-11gR2-preinstall setting for nproc soft limit is 2047
grid soft nproc 2047
# grid-rdbms-server-11gR2-preinstall setting for nproc hard limit is 16384
grid hard nproc 16384
# grid-rdbms-server-11gR2-preinstall setting for stack soft limit is 10240KB
grid soft stack 10240
# grid-rdbms-server-11gR2-preinstall setting for stack hard limit is 32768KB
grid hard stack 32768
7.Clone virtual machine and modify hostname and ip.
=>vi /etc/sysconfig/network [modify host name]
=>modify IP.(Important!)
=>cd /etc/udev/rules.d/
=>vi 70-persistent-net.rule
[delete oldest configure items,pay attention to mac address.]
=>ping test.
=>cd /etc/sysconfig/network-scripts [pay more attention to it.]
=>service network restart
8.Configure raw disk.
=>cd /dev
=>ls -l sd*
=>cd /etc/udev/rules.d
=>touch 99-oracle-asmdevices.rules
=>add raw disk by virtualbox.
=>run following scripts:
for i in b c d e f g h i ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id -g -u -s %p\", RESULT==\"`scsi_id -g -u -s /block/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
for i in b c d e f g h i ;
do
echo "KERNEL==\"sd*\", BUS==\"scsi\", PROGRAM==\"/sbin/scsi_id -g -u -s %p\", RESULT==\"`scsi_id -g -u -s /block/sd$i`\", NAME=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\""
done
cd /etc/udev/rules.d
touch 99-oracle-asmdevices.rules
=>/sbin/start_udev
=>cd /dev
=>ls -l asm*
9.Configure env for user grid.
Node 1=>
=>mkdir /ogi/orabase
=>su grid
=>cd
=>vi .bash_profile
export GRID_HOME=/ogi/12cgrid/app/12.2.0.1/grid
export ORACLE_HOME=/ogi/12cgrid/app/12.2.0.1/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=+ASM1
export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32
export ORACLE_BASE=/g01/orabase
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG="Simplified Chinese"_China.AL32UTF8
Node 2=>
=>mkdir /ogi/orabase
=>su grid
=>cd
=>vi .bash_profile
export GRID_HOME=/ogi/12cgrid/app/12.2.0.1/grid
export ORACLE_HOME=/ogi/12cgrid/app/12.2.0.1/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=+ASM2
export LD_LIBRARY_PATH=$GRID_HOME/lib:$GRID_HOME/lib32
export ORACLE_BASE=/g01/orabase
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG="Simplified Chinese"_China.AL32UTF8
10.Configure env for user root.
export GRID_HOME=/ogi/12cgrid/app/12.2.0.1/grid
export ORACLE_HOME=/ogi/12cgrid/app/12.2.0.1/grid
export PATH=$GRID_HOME/bin:$GRID_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
11.Configure env for user oracle.
Node 1=>
=>su oracle
=>mkdir /odb/orabase
=>cd
=>vi .bash_profile
export ORACLE_HOME=/odb/oracle/app/oracle/product/12.2.0.1/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=PROD1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export ORACLE_BASE=/odb/oracle/
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG="Simplified Chinese"_China.AL32UTF8
Node 2=>
=>su oracle
=>mkdir /odb/orabase
=>cd
=>vi .bash_profile
export ORACLE_HOME=/odb/oracle/app/oracle/product/12.2.0.1/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/bin:/usr/sbin:/usr/bin
export ORACLE_SID=PROD2
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32
export ORACLE_BASE=/odb/oracle/
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG="Simplified Chinese"_China.AL32UTF8
12.Switch instance and machine,use this command modify it.
=>su
=>srvctl modify instance -d orcl -instance prod1 -node machine1
=>srvctl modify instance -d orcl -instance prod2 -node machine2
[root@maclean1 ~]# srvctl stop database -d orcl
[root@maclean1 ~]# srvctl start database -d orcl
具体下载脚本请查看附件!