Oracle 11g + RAC + RHEL6.5 + udev + ASM + PSU Installation Summary
1. Preparations before installation:
- Operating System: RHEL6.5
- Storage: Huawei, multi-path configured
- Bind the business network card and heartbeat network card and pass the redundancy test.
- YUM source configuration
- BASH/SSL vulnerability patches
2. Check System Requirements
A. LINUX version
Cat/etc/issue
B. Memory (at least 1 GB)
Grep MemTotal/proc/meminfo
C. SWAP Partition
When the memory is GB-16 GB, Swap is equal to the system memory size.
If the memory is larger than 16 GB, Swap is equal to 16 GB.
D. TMP Space
Df-h/tmp
Lvcreate-L 2G-n lv_tmp vg_temp
Mount/dev/vg_temp/lv_tmp/tmp
Df-h/tmp
E. Check the patch
# Rpm-q binutils compat-libcap1 compat-libstdc ++-33 gcc-c ++ glibc-devel ksh libgcc libstdc ++-devel libaio-devel make sysstat
Binutils-2.20.51.0.2-5.36.el6.x86_64
Compat-libcap1-1.10-1.x86_64
Compat-libstdc ++-33-3.2.3-69.el6.x86_64
Gcc-4.4.7-4.el6.x86_64
Gcc-c ++-4.4.7-4. el6.x86 _ 64
Glibc-2.12-1.132.el6.x86_64
Glibc-2.12-1.132.el6.i686
Glibc-devel-2.12-1.132.el6.x86_64
Ksh-20120801-10.el6.x86_64
Libgcc-4.4.7-4.el6.x86_64
Libgcc-4.4.7-4.el6.i686
Libstdc ++-4.4.7-4. el6.x86 _ 64
Libstdc +-devel-4.4.7-4.el6.x86_64
Libaio-0.3.107-10.el6.x86_64
Libaio-devel-0.3.107-10.el6.x86_64
Make-3.81-20.el6.x86_64
Sysstat-9.0.4-22.el6.x86_64
F. Disable Firewall
Service iptables status
Service iptables stop
Chkconfig iptables off
G. Disable SELinux
# Vi/etc/selinux/config
Set SELINUX = "" in the file to "disabled", and then restart.
If you do not want to restart the system, run the setenforce 0 command.
Note:
Setenforce 1 sets SELinux to enforcing Mode
Setenforce 0 sets SELinux to permissive Mode
Getenforce/setenforce view and set the current working mode of SELinux
H. Adjust core parameters
Vim/etc/sysctl. conf
# Oracle install config
Fs. aio-max-nr = 1048576
Fs. file-max = 6815744
Kernel. shmall = 2097152
Kernel. shmmax = 270853791744 -- set to physical memory size (B)
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 = 1048576
2. Set/etc/hosts:
Requirements:
The private IP address must be separated from the public network. The two nodes can access each other and can be pinged. The private IP address must be in/etc/hosts;
The virtual IP address is in the same CIDR block as the public IP address. If there is a DNS, it will be registered in the DNS. If there is no DNS, It will be written in the/etc/hosts file;
The public IP address is the real IP address of the host. It is pre-assigned by the host administrator. If there is a DNS, it will be registered in the DNS. If there is no DNS, It will be written in the/etc/hosts file ), ensure that the hosts file is written to each customer's system.
The NIC configurations on each node must be the same. For example, if bind0 is used for the public IP address of the first node, bind0 is used for other nodes.
3. Create oracle, grid users, and dba groups:
Create Group
/Usr/sbin/groupadd-g 1000 oinstall
/Usr/sbin/groupadd-g 1020 asmadmin
/Usr/sbin/groupadd-g 1021 asmdba
/Usr/sbin/groupadd-g 1022 asmoper
/Usr/sbin/groupadd-g 1031 dba
/Usr/sbin/groupadd-g 1032 bytes
Create user
/Usr/sbin/useradd-g oinstall-G asmadmin, asmdba, asmoper, role, dba-u 1100 grid
/Usr/sbin/useradd-g oinstall-G dba, asmdba, role-u 1101 oracle
4. Set system restrictions:
-- Perform the same operation on each node
Im/etc/security/limits. conf
SETTING for ORACLE
Racle soft nproc 2047
Racle hard nproc 16384
Racle soft nofile 4096
Racle hard nofile 65536
Racle soft stacks 10240
Racle hard stack 32768
Rid soft nproc 2047
Grid hard nproc 16384
Grid soft nofile 4096
Grid hard nofile 65536
Grid soft stack 10240
Grid hard stack 32768
5. Create a GRID and RAC installation directory:
-- Create the following directories on the two nodes respectively
Mkdir-p/oracle/app/11.2.0/grid
Mkdir-p/oracle/app/grid
Mkdir-p/oracle/app/oracle
Chown-R grid: oinstall/oracle
Chown grid: oinstall/oracle/app/11.2.0/grid
Chown grid: oinstall/oracle/app/grid
Chown oracle: oinstall/oracle/app/oracle
Chmod-R 775/oracle/
6. Set the NTP service:
Set NTP service on two nodes respectively
Vim/etc/ntp. conf
Driftfile/var/lib/ntp/drift
Restrict default kod nomodify notrap nopeer noquery
Restrict-6 default kod nomodify notrap nopeer noquery
Restrict 127.0.0.1
Restrict-6: 1
Server 202.106.5.193 prefer
Server 172.16.66.92
Restrict 202.106.5.193
Restrict 172.16.66.92
Includefile/etc/ntp/crypto/pw
Keys/etc/ntp/keys
Vim/etc/sysconfig/ntpd
# Drop root to id 'ntp: ntp 'by default.
OPTIONS = "-x-u ntp: ntp-p/var/run/ntpd. pid"
After modifying these two files, you can start the service.
Rpm-q ntp
Ntp-4.2.6p5-1.el6.x86_64
Service ntpd start
You can run the following two commands to check whether the ntp service status is normal:
Ntpq-p
Ntpstat
7. Set the user's environment variables:
Grid User:
# Vim ~ /. Bash_profile
#. Bash_profile
# Get the aliases and functions
If [-f ~ /. Bashrc]; then
.~ /. Bashrc
Fi
# User specific environment and startup programs
PATH = $ PATH: $ HOME/bin
Export PATH
Export ORACLE_BASE =/oracle/app/grid
Export ORACLE_HOME =/oracle/app/11.2.0/grid
Export ORACLE_SID = + ASM2
Export NLS_LANG = AMERICAN_AMERICA.ZHS16GBK
Export NLS_DATE_FORMAT = "yyyy-mm-dd hh24: mi: ss"
Export PATH =. :$ {PATH }:$ HOME/bin: $ ORACLE_HOME/OPatch
Export PATH =$ {PATH }:/ usr/bin:/usr/bin/X11:/usr/local/bin
Export PATH =$ {PATH}: $ ORACLE_BASE/common/oracle/bin
Export ORACLE_TERM = xterm
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib
Export LD_LIBRARY_PATH =$ {LD_LIBRARY_PATH}: $ ORACLE_HOME/mongom/lib
Export LD_LIBRARY_PATH =$ {LD_LIBRARY_PATH}:/lib:/usr/local/lib
Export CLASSPATH = $ ORACLE_HOME/JRE
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/jlib
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/rdbms/jlib
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/network/jlib
Export THREADS_FLAG = native
Export TEMP =/tmp
Export TMPDIR =/tmp
Umask 022
Export TMOUT = 0
Oracle users:
# Vim ~ /. Bash_profile
#. Bash_profile
# Get the aliases and functions
If [-f ~ /. Bashrc]; then
.~ /. Bashrc
Fi
# User specific environment and startup programs
PATH = $ PATH: $ HOME/bin
Export PATH
Export ORACLE_BASE =/oracle/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1
Export ORACLE_SID = test
Export LANG = en_US.UTF-8
Export NLS_LANG = american_america.ZHS16GBK
Export NLS_DATE_FORMAT = "yyyy-mm-dd hh24: mi: ss"
Export PATH =. :$ {PATH }:$ HOME/bin: $ ORACLE_HOME/OPatch
Export PATH =$ {PATH }:/ usr/bin:/usr/bin/X11:/usr/local/bin
Export PATH =$ {PATH }:$ ORACLE_BASE/common/oracle/bin:/home/oracle/run
Export ORACLE_TERM = xterm
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib
Export LD_LIBRARY_PATH =$ {LD_LIBRARY_PATH}: $ ORACLE_HOME/mongom/lib
Export LD_LIBRARY_PATH =$ {LD_LIBRARY_PATH}:/lib:/usr/local/lib
Export CLASSPATH = $ ORACLE_HOME/JRE
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/jlib
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/rdbms/jlib
Export CLASSPATH =$ {CLASSPATH}: $ ORACLE_HOME/network/jlib
Export THREADS_FLAG = native
Export TEMP =/tmp
Export TMPDIR =/tmp
Export GI_HOME =/oracle/app/11.2.0/grid
Export PATH =$ {PATH}: $ GI_HOME/bin
Export ORA_NLS10 = $ GI_HOME/nls/data
Umask 022
Export TMOUT = 0
8. Configure UDEV:
Perform the following operations on both nodes:
# Cd/etc/udev/rules. d
# Vim 99-oracle-asmdevices.rules
KERNEL = "sd *", SUBSYSTEM = "block", PROGRAM = "/sbin/scsi_id -- whitelisted -- replace-whitespace -- device =/dev/$ name ", RESULT = "364862761000560eb82f364f700000014", NAME = "asmdisk001", OWNER = "grid", GROUP = "asmadmin", MODE = "0660"
The RESULT value is the UUID of the disk.
The command to obtain the disk UUID is as follows:
# Scsi_id -- whitelisted -- replace-whitespace -- device =/dev/sdb
We recommend that you use scripts to output the UUID of all disks to x. log, and then use column editing to complete all asm disks.
./Test. sh> x. log
After running and checking 99-oracle-asmdevices.rules, you can run the following command to start udev:
#./Sbin/start_udev
# Ls-al/dev/asm *
Brw-rw ---- 1 grid asmadmin 8, 16 Aug 7/dev/asmdisk001
9. Install the cvudisk package
# Cd $ INSTALL_MEDIA/grid/rpm/
# CVUQDISK_GRP = oinstall; export CVUQDISK_GRP -- you can customize the installation user group here
# Rpm-ivh cvuqdisk-1.0.9-1.rpm
Preparing... ######################################## ### [100%]
Using default group oinstall to install package
1: cvuqdisk ####################################### #### [100%]
10. Configure SSH mutual trust
# Cp $ INSTALL_MEDIA/grid/sshsetup/sshUserSetup. sh/home/grid
# Cd/home/grid
# Chown grid: oinstall sshUserSetup. sh
# Su-grid
$./SshUserSetup. sh-user grid-hosts "test1 test1-priv test2 test2-priv"-advanced-noPromptPassphrase
$ Date; ssh test2 date; ssh test1-priv date; ssh test2-priv date
# Cp $ INSTALL_MEDIA/grid/sshsetup/sshUserSetup. sh/home/oracle
# Cd/home/oracle
# Chown oracle: oinstall sshUserSetup. sh
# Su-oracle
$./SshUserSetup. sh-user oracle-hosts "test1 test1-priv test2 test2-priv"-advanced-noPromptPassphrase
$./Date; ssh test date; ssh test1-priv date; ssh test2-priv date
11. Run the GI pre-Installation check
# Su-grid
$ Cd $ INSTALL_MEDIA/grid/
$./Runcluvfy. sh stage-pre crsinst-n test1, test2-fixup-verbose
12. Install GI Software
# Su-grid
$ Cd $ INSTALL_MEDIA/grid
$./RunInstaller
The next part is omitted. I don't want to map it... tired...
13. Install the Database software
# Su-oracle
$ Cd $ INSTALL_MEDIA/database/
$./Runcluvfy. sh stage-pre dbcfg-n test1, test2
The steps below are just a few points. Please select them by yourself.
PS: The GI and Database are officially recommended to pack Chinese languages, which may be used in the future.
14. Opatch patch updates
Replace the updated/u01/app/11.2.0/grid/and OPatch files under $ ORACLE_HOME. Remember to stop crs.
Then execute the following program:
Run the following command as the root user:
#/Oracle/app/11.2.0/grid/crs/install/rootcrs. pl-unlock
Run the following command for the grid user:
$/Oracle/app/11.2.0/grid/OPatch/opatch napply-oh/oracle/app/11.2.0/grid-local/oracle/app/11.2.0/grid/OPatch/20996923/20831122
$/Oracle/app/11.2.0/grid/OPatch/opatch napply-oh/oracle/app/11.2.0/grid-local/oracle/app/11.2.0/grid/OPatch/20996923/20299019
$/Oracle/app/11.2.0/grid/OPatch/opatch apply-oh/oracle/app/11.2.0/grid-local/oracle/app/11.2.0/grid/OPatch/20996923/20760982
Oracle user execution:
$/Oracle/app/11.2.0/grid/OPatch/20996923/20831122/custom/server/20831122/custom/scripts/prepatch. sh-dbhome/oracle/app/oracle/product/11.2.0/dbhome_1
$/Oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch napply-oh/oracle/app/oracle/product/11.2.0/dbhome_1-local/oracle/app/11.2.0 /grid/OPatch/20996923/20831122/custom/server/20831122
$/Oracle/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch apply-oh/oracle/app/oracle/product/11.2.0/dbhome_1-local/oracle/app/11.2.0 /grid/OPatch/20996923/20760982
$/Oracle/app/11.2.0/grid/OPatch/20996923/20831122/custom/server/20831122/custom/scripts/postpatch. sh-dbhome/oracle/app/oracle/product/11.2.0/dbhome_1
Run the following command as the root user:
#/Oracle/app/11.2.0/grid/rdbms/install/rootadd_rdbms.sh
#/Oracle/app/11.2.0/grid/crs/install/rootcrs. pl-patch
After the installation is complete, run the following command to check whether the version is updated:
$ Opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.11
Copyright (c) 2015, Oracle Corporation. All rights reserved.
15. ASM parameter settings
Alter diskgroup DATA set attribute 'disk _ repair_time '= '2400h ';
Alter diskgroup ARCH set attribute 'disk _ repair_time '= '2400h ';
Alter diskgroup OCRDG set attribute 'disk _ repair_time '= '2400h ';
Alter system set asm_diskgroups = 'data', 'arch 'SCOPE = SPFILE sid = '*';
Alter system set memoey_max_target = 4096 M scope = spfile;
Alter system set memoey_target = 4096 M scope = spfile;
16. Create a database
This is a little bit... you know.