##安装rpm
yum -y install bc gcc gcc-c++ binutils make gdb cmake glibc ksh elfutils-libelf elfutils-libelf-devel fontconfig-devel glibc-devel libaio libaio-devel libXrender libXrender-devel libX11 libXau sysstat libXi libXtst libgcc librdmacm-devel libstdc++ libstdc++-devel libxcb net-tools nfs-utils compat-libcap1 compat-libstdc++ smartmontools targetcli python python-configshell python-rtslib python-six unixODBC unixODBC-devel ls -l compat* elfutils* | awk -v rpmpackage="" '{rpmpackage=$NF" "rpmpackage}END{print "yum -y localinstall "rpmpackage}' | bash
##创建要用户和组
groupadd -g 11001 oinstall groupadd -g 11002 dba groupadd -g 11003 oper groupadd -g 11004 backupdba groupadd -g 11005 dgdba groupadd -g 11006 kmdba groupadd -g 11007 asmdba groupadd -g 11008 asmoper groupadd -g 11009 asmadmin groupadd -g 11010 racdba useradd -u 11011 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle useradd -u 11012 -g oinstall -G asmadmin,asmdba,asmoper,dba grid [root@ray21 yum.repos.d]# echo oracle | passwd --stdin oracle Changing password for user oracle. passwd: all authentication tokens updated successfully. [root@ray21 yum.repos.d]# echo oracle | passwd --stdin grid Changing password for user grid. passwd: all authentication tokens updated successfully.
##编辑hosts文件
#public ip 192.168.56.21 ray21 192.168.56.22 ray22 #private ip 192.168.57.21 ray21-priv 192.168.57.22 ray22-priv #vip 192.168.56.23 ray21-vip 192.168.56.24 ray22-vip #scan ip 192.168.56.25 racscan
##时间设置
##设置时区 [root@ray21 yum.repos.d]# timedatectl list-timezones |grep Shanghai Asia/Shanghai [root@ray21 yum.repos.d]# timedatectl set-timezone Asia/Shanghai [root@ray22 ~]# systemctl stop ntpd.service [root@ray22 ~]# systemctl disable ntpd.service [root@ray22 ~]# mv /etc/ntp.conf /etc/ntp.conf.orig [root@ray22 ~]# systemctl status ntpd
##创建目录
mkdir -p /u01/app/19.0.0/grid mkdir -p /u01/app/grid mkdir -p /u01/app/oracle mkdir -p /u01/app/oracle/product/19.0.0/db_1 chown -R grid:oinstall /u01/app/grid chown -R grid:oinstall /u01/app/19.0.0/grid chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01/
##编辑/etc/security/limits.d/20-nproc.conf
vi /etc/security/limits.d/20-nproc.conf #注释这行* soft nproc 1024 #增加下面一行 * - nproc 16384
##编辑limits.conf
vi /etc/security/limits.conf grid soft nproc 16384 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768 oracle soft nproc 16384 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 oracle hard memlock 4194304 oracle soft memlock 4194304 ##memlock这个值还是应该比内存配置略小,也就是要配置的足够大。单位:k ##4194304 表示4G
##配置pam
[root@ray21 ~]# vi /etc/pam.d/login #ORACLE SETTING session required pam_limits.so
##配置sysctl文件
/sbin/sysctl -a | grep shm vi /etc/sysctl.conf fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 18446744073692774399 kernel.shmmax = 18446744073692774399 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 sysctl -p
##停止avahi-daemon服务
[root@ray22 ~]# systemctl disable avahi-daemon.socket Removed symlink /etc/systemd/system/sockets.target.wants/avahi-daemon.socket. [root@ray22 ~]# systemctl disable avahi-daemon.service Removed symlink /etc/systemd/system/multi-user.target.wants/avahi-daemon.service. Removed symlink /etc/systemd/system/dbus-org.freedesktop.Avahi.service. [root@ray22 ~]# ps -ef|grep avahi-daemon avahi 704 1 0 10:24 ? 00:00:00 avahi-daemon: running [ray22.local] avahi 771 704 0 10:24 ? 00:00:00 avahi-daemon: chroot helper root 15225 1671 0 13:59 pts/0 00:00:00 grep --color=auto avahi-daemon [root@ray22 ~]# kill -9 704 771
##编辑network文件
[root@ray21 ~]# vi /etc/sysconfig/network NOZEROCONF=yes
##编辑bash_profile文件
节点一 Su - grid ORACLE_SID=+ASM1; export ORACLE_SID #ORACLE_TERM=xterm; export ORACLE_TERM ORACLE_BASE=/u01/app/grid; export ORACLE_BASE ORACLE_HOME=/u01/app/19.0.0/grid; export ORACLE_HOME NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib Su - oracle export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/db_1 export ORACLE_SID=RACDB1 PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib 节点二 Su - grid ORACLE_SID=+ASM2; export ORACLE_SID #ORACLE_TERM=xterm; export ORACLE_TERM ORACLE_BASE=/u01/app/grid; export ORACLE_BASE ORACLE_HOME=/u01/app/19.0.0/grid; export ORACLE_HOME NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib Su - oracle export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/db_1 export ORACLE_SID=RACDB2 PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/local/bin export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
##编辑共享磁盘
[root@ray21 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdb 1ATA_VBOX_HARDDISK_VBe5a06cf8-14a27d28 [root@ray21 ~]# /usr/lib/udev/scsi_id -g -u -d /dev/sdc 1ATA_VBOX_HARDDISK_VB7cc0c900-27b2606d vi /etc/udev/rules.d/99-oracle-asmdevices.rules KERNEL=="sdb", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VBe5a06cf8-14a27d28", OWNER="grid", GROUP="asmadmin", MODE="0660" KERNEL=="sdc", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB7cc0c900-27b2606d", OWNER="grid", GROUP="asmadmin", MODE="0660" #重启服务 systemctl restart systemd-udev-trigger.service 或 重新加载udev udevadm control --reload-rules udevadm trigger ##验证权限和属组 ls -Ll /dev/mapper/* ls -Ll /dev/oraasm-* ls -Ll /dev/dm-*
#多路径配置 #/etc/multipath.conf multipaths { multipath { wwid 36006048cd70c3e37a4a85c04d0c79c6d alias data1 } multipath { wwid 36006048cb82e28ed3701a9e1eecb820a alias crs1 } multipath { wwid 3600601606a003a001eebdf56d80e0b2f alias data2 } multipath { wwid 3600601606a003a004aebdf56fce34966 alias data3 } } #配置udev cd /dev/mapper for i in `ls mpath*`; do printf "%s %s\n" "$i" "$(udevadm info --query=all --name=/dev/mapper/$i |grep -i dm_uuid)"; done data1 E: DM_UUID=mpath-36006048cd70c3e37a4a85c04d0c79c6d crs1 E: DM_UUID=mpath-36006048cb82e28ed3701a9e1eecb820a data2 E: DM_UUID=mpath-3600601606a003a001eebdf56d80e0b2f data3 E: DM_UUID=mpath-3600601606a003a004aebdf56fce34966 [root@rac1 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules KERNEL=="dm-*",ENV{DM_UUID}=="mpath-36006048cd70c3e37a4a85c04d0c79c6d",SYMLINK+="oraasm-$env{DM_NAME}",OWNER="grid",GROUP="asmadmin",MODE="0660" KERNEL=="dm-*",ENV{DM_UUID}=="mpath-36006048cb82e28ed3701a9e1eecb820a",SYMLINK+="oraasm-$env{DM_NAME}",OWNER="grid",GROUP="asmadmin",MODE="0660" KERNEL=="dm-*",ENV{DM_UUID}=="mpath-3600601606a003a001eebdf56d80e0b2f",SYMLINK+="oraasm-$env{DM_NAME}",OWNER="grid",GROUP="asmadmin",MODE="0660" KERNEL=="dm-*",ENV{DM_UUID}=="mpath-3600601606a003a004aebdf56fce34966",SYMLINK+="oraasm-$env{DM_NAME}",OWNER="grid",GROUP="asmadmin",MODE="0660" #重启udev服务 systemctl restart systemd-udev-trigger.service ##验证权限和属组 ls -Ll /dev/mapper/* ls -Ll /dev/oraasm-* ls -Ll /dev/dm-*
##配置grid互信
grid: cd /home/grid mkdir ~/.ssh chmod 700 ~/.ssh ssh-keygen -t rsa ssh-keygen -t dsa cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys ssh ray22 cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys ssh ray22 cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys scp ~/.ssh/authorized_keys ray22:~/.ssh/authorized_keys #验证 ssh ray22 date;ssh ray21 date;ssh ray22-priv date;ssh ray21-priv date
##解压grid
[grid@ray21 ~]$ unzip -d /u01/app/19.0.0/grid/ LINUX.X64_193000_grid_home.zip
##安装cvuqdisk
[root@ray21 ~]# rpm -ivh /u01/app/19.0.0/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm Preparing... ################################# [100%] Using default group oinstall to install package Updating / installing... 1:cvuqdisk-1.0.10-1 ################################# [100%]
##安装前检查
./runcluvfy.sh stage -pre crsinst -n ray21,ray22 -fixup -verbose >> check.txt
##安装grid
[grid@ray21 grid]$ ./gridSetup.sh
##配置oracle互信
cd /home/oracle mkdir ~/.ssh chmod 700 ~/.ssh ssh-keygen -t rsa ssh-keygen -t dsa cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys ssh ray22 cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys ssh ray22 cat ~/.ssh/id_dsa.pub >>~/.ssh/authorized_keys scp ~/.ssh/authorized_keys ray22:~/.ssh/authorized_keys #验证 ssh ray22 date;ssh ray21 date;ssh ray22-priv date;ssh ray21-priv date
##解压安装包
[oracle@ray21 ~]$ unzip LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.0.0/db_1/
##安装rdbms
[oracle@ray21 db_1]$ ./runInstaller
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28572479/viewspace-2654307/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28572479/viewspace-2654307/