Build and install 12C RAC Based on Workstation8 and CentOS6.5

Source: Internet
Author: User

Build and install 12C RAC Based on Workstation8 and CentOS6.5

Author: HopToad
Location: Binjiang, Hangzhou
Email: appdevzw@163.comj
Public Account: HopToad
Welcome from all walks of life
December 2014


1 preparation condition 1.1 hardware version

One home PC, with a hard disk space of more than GB and a memory of more than 8 GB.
Configure 4G memory for each Virtual Machine (theoretical requirement)

1.2 Software Version

Virtualization software: VMware Workstation8 or later
Operating System: CentOS6.5/REHL6.5/OEL6.5 or above
Database Version: 12C
Download ASMlib:
Http://www.Oracle.com/technetwork/server-storage/linux/asmlib/index-101839.html


2. Network Planning

The IP addresses of machines in the home are all allocated by the wireless route DHCP, and the network is disconnected from 192.168.1 .*. However, considering the convenience of subsequent Virtual Machine access, the IP address is fixed and assigned as follows.

Host Name PUB Private ip vip scanip Domain Name
Slave1 192.168.1.201 10.10.0.201 192.168.1.211 192.168.1.220 hoptoad.com
Slave2 192.168.1.202 10.10.0.202 192.168.1.212
Slave2 192.168.1.203 10.10.0.203 192.168.1.213



3. Create a virtual machine

Virtual Machine configuration: Number of CPUs 2X2
Memory: 2 GB
Hard Disk: 30 GB
NIC: 2 (one uses VMNET0 and the other uses Bridge)
Install the operating system.

3.1 clone a VM

After installing a virtual machine operating system, you can directly clone it.

3.1.1 modify the udev File

After cloning, modify/etc/udev/rules. d/70-persistent-net.rules,
Delete
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: 42: b0: b9 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0"
Modify the second line NAME = "eth1" to NAME = "eth0"
In this way, the cloned VM Nic starts with eth0.
You can also delete the file and restart it.

3.1.2 Modify host name

Modify HOSTNAME = rac1 in the/etc/sysconfig/network File
The host name of each machine must be the same.

4 shared storage implementation 4.1 Add disks to one VM

Right-click any of the VMS-> setting... -> Add... -> HardDisk-> Next-> create a new virtual disk-select independent-> next-> SCSI-> next-> set the size to 10 GB-> next-> select single file-> set file name-> set file storage path-> advanced... -> Select the virtual device node scsi 1:0-> OK.
Two more virtual device nodes are added: 1 GB scsi and scsi.

4.2 set disk sharing

Find the path where the VM image is stored and store it on drive D.
Find the. vmx suffix file and edit it. Add the following variables. (Shutdown settings)
Disk. locking = "FALSE"
Disk. EnableUUID = "true"
DiskLib. dataCacheMaxSize = "0"
Scsi1.sharedBus = "virtual"
DiskLib. datachemaxreadaheadsize = "0"
DiskLib. DataCacheMinReadAheadSize = "0"
Disk Lib. datacachepagesize = 4096
DiskLib. maxunsyncedwrites = "0"
Scsi1: 0. deviceType = "disk"
Scsi1: 1. deviceType = "disk"




Note that this variable must be set for all virtual machines.

4.3 add disks to other virtual machines

Right-click any of the VMS-> setting... -> Add... -> HardDisk-> Next-> using an existing virtual disk-> next-> select the created disk-> select the virtual device node scsi 1:0-> OK
Two existing disks are also added: 1 GB scsi and scsi.
It also processes virtual machines on all other nodes.
After restart, all the VMS will see three shared disks.
Run the command fdisk-l to view the information.

4.4 If the system's ASM configuration is used

The command is as follows:
Systemctl enable oracleasm. service (after RedHat 7)
/Etc/init. d/oracleasm configure or/etc/init. d/oracleasm configure-I
Configure the user grid and asmdba
Configure the ASM disk (error log/var/log/oracleasm)
Note: Disable SELINUX.
If no UUID exists, format it again, for example, mkfs. ext4/dev/sdb.


5. System Environment preparations 5.1 set up YUM environment 5.1.1 import the operating system image to each Virtual Machine
5.1.2 edit/etc/yum. repos. d/rhel-source.repo

As follows:
[Rhel-source]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Source
Baseurl = file: // mnt
Enabled = 1
Gpgcheck = 0
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

5.1.3 execute the following command to mount the disc

[Root @ slave1 ~] # Mount-o loop Red \ Hat \ Enterprise \ 6.5 \ x86_64.iso/mnt

5.1.4 configure the YUM environment for each Virtual Machine

To install the RPM package from the local YUM source.


5.2 decompress the database package

Run the following pressurization command:
[Root @ slave1 ~] # Unzip linuxamd64_12c_database_1of2.zip
Decompress all the packages.


5.3 Install the database essential package 5.3.1 dependency package

Binutils-2.17.50.0.6
Compat-libstdc ++-33-3.2.3
Compat-libstdc ++-33-3.2.3 (32 bit)
Elfutils-libelf-0.125
Elfutils-libelf-devel-0.125
Gcc-4.1.2
Gcc-c ++-4.1.2
Glibc-2.5-24
Glibc-2.5-24 (32 bits)
Glibc-common-2.5
Glibc-devel-2.5
Glibc-devel-2.5 (32 bits)
Libaio-0.3.106
Libaio-0.3.106 (32 bits)
Libaio-devel-0.3.106
Libaio-devel-0.3.106 (32 bits)
Libgcc-4.1.2
Libgcc-4.1.2 (32 bits)
Libstdc ++ 4.1.2
Libstdc ++-4.1.2 (32 bit)
Libstdc ++-devel 4.1.2
Make-3.81
Sysstat-7.0.2
UnixODBC-2.2.11 (32-bit) or later
• UnixODBC-devel-2.2.11 (64-bit) or later
• UnixODBC-2.2.11 (64-bit) or later

5.3.2 one-click dependency package installation

We have configured the YUM local source, so we can install it directly.
Yum install binutils compat-libstdc ++ *. i686 * elfutils-libelf *. i686 * gcc-c ++ * glibc *. i686 * libaio *. i686 * libgcc *. i686 * libstdc ++ *. i686 * make sysstat * unixODBC *. i686 oracleasm-support compat-libcap * ksh libXext * i686 libXtst * i686 libX11 * i686 libXau * i686 libxcb * i686 libXi * 686 libXp. i686 libXp-devel.i686 libXt. i686 libXt-devel.i686 libXtst. i686 libXtst-devel.i686 make. x86_64 gcc. x86_64 libaio. x86_64 glibc-devel.i686 libgcc. i686 glibc-devel.x86_64 compat-libstdc ++-33 glibc * gcc * make * compat-db * libstdc * libXp * libXtst * compat-libstdc ++ ** glibc * java

Yum install libXp. x86_64 libXp. i686 elfutils-libelf.x86_64 elfutils-libelf-devel.x86_64 compat-db.i686 compat-db.x86_64 libstdc ++-devel. i686 libstdc ++-devel. x86_64 openmotif22.i686 openmotif22.x86 _ 64 libaio-devel.i686 libaio-devel.x86_64 control-center.x86_64 make. x86_64 gcc. x86_64 sysstat. x86_64 libaio. i686 gcc-c ++. x86_64 compat-libf2c-34.x86_64 compat-libf2c-34.i686 unixODBC. i686 unixODBC. x86_64 unixODBC-devel.i686 unixODBC-devel.x86_64 libgomp. x86_64 compat-libstdc ++-33. x86_64 compat-libstdc ++-33. i686 glibc. i686 glibc. x86_64 glibc-common.x86_64 glibc-devel.i686 glibc-devel.x86_64 libXmu. i686 libXmu. x86_64 libgcc. i686 libgcc. x86_64 kernel-headers.x86_64 libstdc ++. i686 binutils. x86_64 libstdc ++. x86_64 compat-libcap1.x86_64 ompat-libcap1.i686 smartmontools iscsi-initiator-utils install nfs-utils * ksh *

5.3.3 install other packages

Install the oracleasmlib package
Start oracleasm
# Service oracleasm start
Red Hat starts after 7.0
# Systemctl start oracleasm
Install the cvuqdisk package (decompress the grid package)

6. Network Configuration

Configure the network address according to the network plan.
Configure network commands
# The setup dialog box is displayed.
You can also edit the/etc/sysconfig/network-scripts/ifcfg-eth0 file for configuration.
(This is for REHL, and SUSE is slightly different)

6.1 edit the/etc/hosts file

The/etc/hosts file of each virtual machine.
As follows:
192.168.1.201 slave1.hoptoad.com slave1
192.168.1.202 slave2.hoptoad.com slave2
192.168.1.203 slave3.hoptoad.com slave3

# Private IP
10.10.0.201 slave1-priv.hoptoad.com slave1-priv
10.10.0.202 slave2-priv.hoptoad.com slave2-priv
10.10.0.203 slave3-priv.hoptoad.com slave3-priv

# Vip
192.168.1.211 slave1-vip.hoptoad.com slave1-vip
192.168.1.212 slave2-vip.hoptoad.com slave2-vip
192.168.1.213 slave3-vip.hoptoad.com slave3-vip

# Scanip
192.168.1.220 rac-scan.hoptoad.com rac-scan

7. system parameter settings

Edit the/etc/sysctl. conf file and add the following content:
Fs. aio-max-nr = 1048576
Fs. file-max = 6815744
Kernel. shmall = 2097152
Kernel. shmmax = 913516544
Kernel. panic_on_oops = 1
Kernel. shmmni = 4096
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
Run sysctl-p
Make effective

Edit/etc/sysconfig/network
Add NOZEROCONF = yes


8. Set environment variables 8.1. Create a directory user

Groupadd oinstall
Groupadd dba
Groupadd rule
Groupadd asmadmin
Groupadd asmdba
Groupadd asmoper
Useradd-g oinstall-G dba, asmdba, asmadmin, asmoper grid
Useradd-g oinstall-G dba, role, asmdba oracle

Mkdir-p/u01/app/12.1.0/grid
Mkdir-p/u01/app/grid
Mkdir-p/u01/app/oracle
Chown grid: oinstall/u01/app/12.1.0/grid
Chown grid: oinstall/u01/app/grid
Chown-R oracle: oinstall/u01/app/oracle
Chmod-R 775/u01/
Chown-R grid: oinstall/u01


Change User Password
Passwd grid
Passwd oracle


8.2 Configure/etc/security/limits. conf

Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
Oracle soft stack 10240
Grid soft nproc 2047
Grid hard nproc 16384
Grid soft nofile 1024
Grid hard nofile 65536
Grid soft stack 10240






8.3 configure the user environment variable. bash_profile8.3.1 RAC1 Node

# Grid user
Export TMP =/tmp;
Export TMPDIR = $ TMP;
Export ORACLE_HOSTNAME = slave1.hoptoad.com;
Export ORACLE_SID = + ASM1;
Export ORACLE_BASE =/u01/app/grid;
Export ORACLE_HOME =/u01/app/12.1.0/grid;
Export NLS_DATE_FORMAT = "yy-mm-dd HH24: MI: SS ";
Export PATH = $ ORACLE_HOME/bin: $ PATH;
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib64;
# ORACLE users

Export TMP =/tmp;
Export TMPDIR = $ TMP;
Export ORACLE_HOSTNAME = slave1.hoptoad.com;
Export ORACLE_BASE =/u01/app/oracle;
Export ORACLE_HOME = $ ORACLE_BASE/product/12.1.0/db_1;
Export ORACLE_UNQNAME = prod;
Export ORACLE_SID = prod1;
Export ORACLE_TERM = xterm;
Export PATH =/usr/sbin: $ PATH;
Export PATH = $ ORACLE_HOME/bin: $ PATH;
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib;
Export CLASSPATH = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib;
Export NLS_DATE_FORMAT = "yyyy-mm-dd HH24: MI: SS ";
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK;


8.3.2 RAC2 user

# GRID user
Export TMP =/tmp;
Export TMPDIR = $ TMP;
Export ORACLE_HOSTNAME = slave2.hoptoad.com;
Export ORACLE_SID = + ASM2;
Export ORACLE_BASE =/u01/app/grid;
Export ORACLE_HOME =/u01/app/12.1.0/grid;
Export NLS_DATE_FORMAT = "yy-mm-dd HH24: MI: SS ";
Export PATH = $ ORACLE_HOME/bin: $ PATH;
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK;
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib64;
# ORACLE users
Export TMP =/tmp;
Export TMPDIR = $ TMP;
Export ORACLE_HOSTNAME = slave2.hoptoad.com;
Export ORACLE_BASE =/u01/app/oracle;
Export ORACLE_HOME = $ ORACLE_BASE/product/12.1.0/db_1;
Export ORACLE_UNQNAME = prod;
Export ORACLE_SID = prod2;
Export ORACLE_TERM = xterm;
Export PATH =/usr/sbin: $ PATH;
Export PATH = $ ORACLE_HOME/bin: $ PATH;
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib;
Export CLASSPATH = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib;
Export NLS_DATE_FORMAT = "yyyy-mm-dd HH24: MI: SS ";
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK;

8.3.3 RAC3 user

# GRID user
Export TMP =/tmp;
Export TMPDIR = $ TMP;
Export ORACLE_HOSTNAME = slave3.hoptoad.com;
Export ORACLE_SID = + ASM2;
Export ORACLE_BASE =/u01/app/grid;
Export ORACLE_HOME =/u01/app/12.1.0/grid;
Export NLS_DATE_FORMAT = "yy-mm-dd HH24: MI: SS ";
Export PATH = $ ORACLE_HOME/bin: $ PATH;
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK;
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib64;
# ORACLE users
Export TMP =/tmp;
Export TMPDIR = $ TMP;
Export ORACLE_HOSTNAME = slave3.hoptoad.com;
Export ORACLE_BASE =/u01/app/oracle;
Export ORACLE_HOME = $ ORACLE_BASE/product/12.1.0/db_1;
Export ORACLE_UNQNAME = prod;
Export ORACLE_SID = prod3;
Export ORACLE_TERM = xterm;
Export PATH =/usr/sbin: $ PATH;
Export PATH = $ ORACLE_HOME/bin: $ PATH;
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib;
Export CLASSPATH = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib;
Export NLS_DATE_FORMAT = "yyyy-mm-dd HH24: MI: SS ";
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK;

9 Grid and oracle users access 9.1 without a password and execute ssh-keygen

The GRID user of each node executes the following command:
/Usr/bin/ssh-keygen-t rsa
/Usr/bin/ssh-keygen-t dsa

9.2 append to local authorized_keys

/Bin/cat ~ /. Ssh/*. pub> ~ /. Ssh/authorized_keys

9.3 Add authorized_keys to the authorized_keys of another node

After completion.

Test
# Establish equivalence
2 nodes each Execute
$ Ssh slave1 date
$ Ssh slave1-priv date
$ Ssh slave2 date
$ Ssh slave2-priv date

 

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • 3
  • Next Page

Related Article

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.