合 快速静默安装Oracle rac集群软件和rac数据库以及Restart ASM环境脚本集合
Tags: Oracle高可用racASM集群部署静默安装静默建库脚本集合快速Restart
- 云平台安装rac资源申请
- 华为云资源申请
- IP规划
- 依赖包
- 用户和环境变量
- rac
- ASM单机
- 其它优化
- 内核参数
- 共享盘
- grid软件解压
- 配置互信
- grid安装
- 11gR2
- rac grid
- Restart ASM grid
- 12.1.0.2
- 12.2.0.1
- rac grid
- 静默创建单机ASM实例
- 注意
- db软件
- 11.2.0.4、12.2.0.1
- 12.1.0.2
- 数据库
- 11g
- 12c
- 磁盘组
- 监听
- 常见错误
- Linux 7 安装11g rac
- ohasd failed to start
- TIMED OUT WAITING FOR OHASD MONITOR
- [INS-35423] The installer has detected that Oracle Clusterware is not running on local node
- Error in invoking target 'agent nmhs' of makefile 'ins_emagent.mk'
- 云平台上ASM2不能启动
云平台安装rac资源申请
华为云资源申请
参考:https://www.dbaup.com/huaweiyunecsanzhuangoracle-racyunduanziyuanshenqingbuzhou.html
IP规划
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | cat >> /etc/hosts <<"EOF" #Public IP 172.20.7.35 rac1 172.20.7.36 rac2 #Virtual IP 172.20.7.37 rac1-vip 172.20.7.38 rac2-vip #Private IP 1.1.2.1 rac1-priv 1.1.2.2 rac2-priv #Scan IP 172.20.7.39 rac-scan EOF hostnamectl set-hostname rac1 hostnamectl set-hostname rac2 cat >> /etc/hosts <<"EOF" #Public IP 192.168.59.62 raclhr-21c-n1 192.168.59.63 raclhr-21c-n2 #Private IP 192.168.2.62 raclhr-21c-n1-priv 192.168.2.63 raclhr-21c-n2-priv #Virtual IP 192.168.59.64 raclhr-21c-n1-vip 192.168.59.65 raclhr-21c-n2-vip #Scan IP 192.168.59.66 raclhr-21c-scan 192.168.59.67 raclhr-21c-scan 192.168.59.68 raclhr-21c-scan EOF cat >> /etc/hosts <<"EOF" #public ip 172.16.23.11 db1 172.16.23.12 db2 #private ip 172.16.100.11 db1-priv 172.16.100.12 db2-priv #virtual ip 172.16.23.13 db1-vip 172.16.23.14 db2-vip #scan ip 172.16.23.20 db-scan EOF ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 127.0.0.1 db1 |
依赖包
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | ## yum安装常用软件包 yum install -y openssh-clients openssh-server initscripts net-tools telnet which wget \ passwd e4fsprogs lrzsz sudo unzip lvm2 tree traceroute lsof file tar systemd \ bridge-utils mlocate mailx strace less mmv stress stress-ng iotop htop atop nmon \ dstat bcc-tools bcc yum-utils ethtool yum install -y dos2unix rlwrap xdpyinfo xorg-x11-apps nmap numactl numactl-devel \ iproute rsyslog bash-completion screen tmux sysbench vim redhat-lsb smartmontools xinetd \ gcc gcc-c++ make sysstat ksh binutils socat cmake automake autoconf bzr bison libtool deltarpm \ rsync libev pv subversion gnuplot jq oniguruma yum-fastestmirror net-snmp net-snmp-utils \ nfs-utils rpcbind postfix dovecot bind-utils bind bind-chroot dnsmasq haproxy keepalived bzr \ fio bzip2 ntp flex lftp targetd targetcli iscsi-initiator-utils siege aria2 libzstd libzstd-devel \ nethogs vnstat nload iptraf bmon bwm-ng trafshow collectl patch redhat-lsb-core dmidecode \ curl curl-devel lz4 lz4-devel readline readline-devel readline-static libcurl libcurl-devel \ extundelete yum install -y ncurses-devel libgcrypt-devel libaio libaio-devel libevent libevent-devel \ perl perl-Env perl-devel perl-Time-HiRes perl-DBD-MySQL perl-ExtUtils* perl-ExtUtils-MakeMaker perl-TermReadKey \ perl-Config-Tiny perl-Email-Date-Format perl-Log-Dispatch perl-Mail-Sender perl-Mail-Sendmail \ perl-MIME-Lite perl-Parallel-ForkManager perl-Digest-MD5 perl-ExtUtils-CBuilder perl-IO-Socket-SSL \ perl-JSON openssl-devel libverto-devel libsepol-devel libselinux-devel libkadm5 keyutils-libs-devel \ krb5-devel libcom_err-devel cyrus-sasl* perl-DBD-Pg perf slang perl-DBI perl-DBIx-Safe perl-CPAN \ cpan perl-tests xorg-x11-apps libXcursor libXcursor-devel libXrandr-devel libtasn1-devel \ nettle-devel gnutls-devel pcsc-lite-devel coreutils glib2 xfsprogs pam-devel \ libxml2-devel libxslt-devel python-devel tcl-devel openldap-devel jadetex openjade yum install -y compat-libstdc++-33 glibc glibc-common glibc.i686 glibc-devel glibc-devel.i686 \ libgcc libgcc.i686 libstdc++ libstdc++-devel libaio.i686 libaio-devel.i686 \ libXext libXext.i686 libXtst libXtst.i686 libX11 libX11.i686 libXau libXau.i686 \ libxcb libxcb.i686 libXi libXi.i686 unixODBC unixODBC-devel zlib-devel zlib-devel.i686 \ compat-libcap1 libXp libXp-devel libXp.i686 elfutils-libelf elfutils-libelf-devel compat-db \ xscreensaver fontconfig-devel libXrender-devel mkdir /soft chmod 777 /soft mkdir -p ~/.pip cat > ~/.pip/pip.conf << EOF [global] index-url = https://pypi.douban.com/simple/ EOF yum -y install xrdp && yum groupinstall -y Xfce sed -i 's/max_bpp=32/max_bpp=24/g' /etc/xrdp/xrdp.ini echo xfce4-session > /root/.xsession chmod +x /root/.xsession echo xfce4-session > /home/oracle/.xsession chmod +x /home/oracle/.xsession echo xfce4-session > /home/grid/.xsession chmod +x /home/grid/.xsession systemctl restart xrdp && systemctl enable xrdp rm -f /etc/localtime cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
用户和环境变量
rac
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | systemctl disable firewalld.service systemctl stop firewalld.service setenforce 0 sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config systemctl stop ntpd.service systemctl disable ntpd.service systemctl status ntpd.service mv /etc/ntp.conf /etc/ntp.conf.org systemctl stop avahi-daemon.service systemctl disable avahi-daemon.service echo 'RemoveIPC=no' >> /etc/systemd/logind.conf ## 11和12都可以用 /usr/sbin/groupadd -g 502 oinstall /usr/sbin/groupadd -g 503 dba /usr/sbin/groupadd -g 504 oper /usr/sbin/groupadd -g 505 asmadmin /usr/sbin/groupadd -g 506 asmoper /usr/sbin/groupadd -g 507 asmdba /usr/sbin/useradd -g oinstall -G dba,asmdba,oper,asmadmin oracle /usr/sbin/useradd -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid mkdir -p /u01/app/oracle mkdir -p /u01/app/grid mkdir -p /u01/app/12.2.0/grid mkdir -p /u01/app/oracle/product/12.2.0/dbhome_1 chown -R grid:oinstall /u01/app/grid chown -R grid:oinstall /u01/app/12.2.0 chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01 mkdir -p /u01/app/oraInventory chown -R grid:oinstall /u01/app/oraInventory chmod -R 775 /u01/app/oraInventory cat > /etc/oraInst.loc <<"EOF" inventory_loc=/u01/app/oraInventory inst_group=oinstall EOF chown oracle:oinstall /etc/oraInst.loc chmod 664 /etc/oraInst.loc echo "oracle:lhr" | chpasswd echo "grid:lhr" | chpasswd cat >> /home/oracle/.bash_profile <<"EOF" export ORACLE_SID=rac1 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1 export TNS_ADMIN=$ORACLE_HOME/network/admin export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS" alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' alias sas='sqlplus / as sysdba' EOF cat >> /home/grid/.bash_profile <<"EOF" export ORACLE_SID=+ASM1 export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/12.2.0/grid export TNS_ADMIN=$ORACLE_HOME/network/admin export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS" alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' alias sas='sqlplus / as sysasm' EOF cat >> /root/.bashrc <<"EOF" export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/12.2.0/grid export GRID_BASE=$ORACLE_BASE export GRID_HOME=$ORACLE_HOME export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export PATH=$PATH:$ORACLE_HOME/bin EOF cat >> /etc/profile <<"EOF" export ORACLE_BASE=/u01/app/grid export ORACLE_HOME=/u01/app/12.2.0/grid export GRID_BASE=$ORACLE_BASE export GRID_HOME=$ORACLE_HOME export PATH=$PATH:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH EOF source /etc/profile |
ASM单机
1 |
其它优化
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | systemctl stop avahi-daemon.service systemctl disable avahi-daemon.service systemctl stop avahi-daemon.socket systemctl disable avahi-daemon.socket systemctl stop ntpd.service systemctl disable ntpd.service systemctl status ntpd.service mv /etc/ntp.conf /etc/ntp.conf.org systemctl list-unit-files|grep chronyd systemctl status chronyd systemctl disable chronyd systemctl stop chronyd mv /etc/chrony.conf /etc/chrony.conf_bak cat >> /etc/rc.local <<"EOF" if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi dhclient EOF chmod +x /etc/rc.d/rc.local cat /sys/kernel/mm/transparent_hugepage/enabled cat /sys/kernel/mm/transparent_hugepage/defrag echo never > /sys/kernel/mm/transparent_hugepage/enabled echo never > /sys/kernel/mm/transparent_hugepage/defrag |
内核参数
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | cat >> /etc/sysctl.conf <<"EOF" fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel.shmmni = 4096 kernel.shmall = 1073741824 kernel.shmmax = 4398046511104 kernel.panic_on_oops = 1 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 net.ipv4.conf.all.rp_filter = 2 net.ipv4.conf.default.rp_filter = 2 fs.aio-max-nr = 1048576 EOF sysctl -p cat >> /etc/security/limits.conf <<"EOF" grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768 oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 * soft memlock -1 * hard memlock -1 EOF echo "session required pam_limits.so" >> /etc/pam.d/login cat >> /etc/profile <<"EOF" if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi EOF echo "RemoveIPC=no" >> /etc/systemd/logind.conf echo 'NOZEROCONF=yes' >> /etc/sysconfig/network |
共享盘
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | fdisk -l | grep dev /usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sda for i in a b c d e ; do echo "KERNEL==\"sd*\", SUBSYSTEM==\"block\", PROGRAM==\"/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/\$name\", RESULT==\"`/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/sd$i`\", SYMLINK+=\"asm-disk$i\", OWNER=\"grid\", GROUP=\"asmadmin\", MODE=\"0660\"" >> /etc/udev/rules.d/99-oracleasm.rules done udevadm control --reload-rules udevadm trigger --type=devices --action=change ll /dev/asm* cat > /etc/udev/rules.d/99-oracle-asmdevices.rules << "EOF" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="3688860300000fa71fa163b4757408053", RUN+="/bin/sh -c 'mknod /dev/asm-diskb b $major $minor; chown grid:asmadmin /dev/asm-diskb; chmod 0660 /dev/asm-diskb'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="36888603000007376fa163b4757408053", RUN+="/bin/sh -c 'mknod /dev/asm-diskc b $major $minor; chown grid:asmadmin /dev/asm-diskc; chmod 0660 /dev/asm-diskc'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="36888603000003583fa163b4757408053", RUN+="/bin/sh -c 'mknod /dev/asm-diskd b $major $minor; chown grid:asmadmin /dev/asm-diskd; chmod 0660 /dev/asm-diskd'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="3688860300000fa6afa163b4757408053", RUN+="/bin/sh -c 'mknod /dev/asm-diske b $major $minor; chown grid:asmadmin /dev/asm-diske; chmod 0660 /dev/asm-diske'" KERNEL=="sd*",ENV{DEVTYPE}=="disk",SUBSYSTEM=="block",PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode",RESULT=="3688860300000fa3ffa163b4757408053", RUN+="/bin/sh -c 'mknod /dev/asm-diskf b $major $minor; chown grid:asmadmin /dev/asm-diskf; chmod 0660 /dev/asm-diskf'" EOF -- 安装grid之前 export LD_LIBRARY_PATH=/soft/grid/stage/ext/lib/:$LD_LIBRARY_PATH /soft/grid/stage/ext/bin/kfod.bin asm_diskstring='/dev/asm*' /soft/grid/stage/ext/bin/kfod asm_diskstring='/dev/asm*' -- 安装grid完成 export GRID_HOME=$ORACLE_HOME $GRID_HOME/bin/kfod disks=asm st=true ds=true cluster=true export ORACLE_HOME=/u01/app/12.2.0/grid export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH /u01/app/12.2.0/grid/bin/kfod.bin asm_diskstring='/dev/asm*' |
grid软件解压
1 2 3 4 5 6 7 8 | -- -- 1和2是database安装包,3是grid的安装包 unzip /soft/p13390677_112040_Linux-x86-64_1of7.zip -d /soft/ && unzip /soft/p13390677_112040_Linux-x86-64_2of7.zip -d /soft/ unzip /soft/p13390677_112040_Linux-x86-64_3of7.zip -d /soft/ -- 1和2是database安装包,3和4是grid的安装包 unzip /soft/12.1.0.2/p17694377_121020_Linux-x86-64_1of8.zip -d /soft/ && unzip /soft/12.1.0.2/p17694377_121020_Linux-x86-64_2of8.zip -d /soft/ unzip /soft/12.1.0.2/p17694377_121020_Linux-x86-64_3of8.zip -d /soft/ && unzip /soft/12.1.0.2/p17694377_121020_Linux-x86-64_4of8.zip -d /soft/ |
配置互信
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /soft/database/sshsetup/sshUserSetup.sh -user oracle -hosts "db1 db2" -advanced exverify –confirm /soft/database/sshsetup/sshUserSetup.sh -user grid -hosts "db1 db2" -advanced exverify –confirm export CVUQDISK_GRP=oinstall rpm -ivh /u01/app/12.1.0.2/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm scp /u01/app/12.1.0.2/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm oracle@db2:/soft export CVUQDISK_GRP=oinstall rpm -ivh /soft/cvuqdisk-1.0.10-1.rpm -- 预检查 su - grid /soft/grid/runcluvfy.sh stage -pre crsinst -n odsa,odsb -verbose -fixup $ORACLE_HOME/bin/cluvfy stage -pre crsinst -n all -verbose -fixup $ORACLE_HOME/bin/cluvfy stage -pre crsinst -n all -r 11gR2 -verbose -fixup find . -name runcluvfy.sh -- db安装预检查 /soft/grid/runcluvfy.sh stage -pre dbinst -n all -verbose -fixup |
grid安装
11gR2
rac grid
11.2.0.4、11.2.0.3、已测试:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ ORACLE_BASE=/u01/app/grid \ ORACLE_HOME=/u01/app/11.2.0/grid \ oracle.install.asm.OSDBA=asmdba \ oracle.install.asm.OSOPER=asmoper \ oracle.install.asm.OSASM=asmadmin \ oracle.install.crs.config.storageOption=ASM_STORAGE \ oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=EXTERNAL \ oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=EXTERNAL \ oracle.install.crs.config.useIPMI=false \ oracle.install.asm.diskGroup.name=OCR \ oracle.install.asm.diskGroup.redundancy=NORMAL \ oracle.installer.autoupdates.option=SKIP_UPDATES \ oracle.install.crs.config.gpnp.scanPort=1521 \ oracle.install.crs.config.gpnp.configureGNS=false \ oracle.install.option=CRS_CONFIG \ oracle.install.asm.SYSASMPassword=oracle \ oracle.install.asm.monitorPassword=oracle \ oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm* \ oracle.install.asm.diskGroup.disks=/dev/asm-diskb,/dev/asm-diskc,/dev/asm-diskd \ oracle.install.crs.config.gpnp.scanName=lhrrac-scan \ oracle.install.crs.config.clusterName=lhr-cluster \ oracle.install.crs.config.autoConfigureClusterNodeVIP=false \ oracle.install.crs.config.clusterNodes=lhrrac1:lhrrac1-vip,lhrrac2:lhrrac2-vip \ oracle.install.crs.config.networkInterfaceList=eth0:192.168.88.0:1,eth1:110.110.20.0:2 \ ORACLE_HOSTNAME=lhrarac1 As a root user, execute the following script(s): 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/11.2.0/grid/root.sh Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes: [lhrarac1, lhrarac2] Execute /u01/app/11.2.0/grid/root.sh on the following nodes: [lhrarac1, lhrarac2] .................................................. 100% Done. Execute Root Scripts successful. As install user, execute the following script to complete the configuration. 1. /u01/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=<response_file> Note: 1. This script must be run on the same host from where installer was run. 2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation). Successfully Setup Software. |
root.sh脚本的日志地址:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | --- 11g、12.1.0.2、 日志地址:$GRID_HOME/cfgtoollogs/crsconfig/rootcrs_主机名.log 重置的日志文件:hadelete.log crsdelete_rac1.log root.sh脚本日志:rootcrs_rac2.log -- 例如: tailf /u01/app/11.2.0.4/grid/cfgtoollogs/crsconfig/crsdelete_rac1.log tailf /u01/app/11.2.0.4/grid/cfgtoollogs/crsconfig/rootcrs_rac1.log --- 18c 18c的日志地址:$ORACLE_HOME/install/ 18c的详细日志地址:/u01/app/grid/crsdata/raclhr-18c-n1/crsconfig/ 重置的日志文件:crsdeconfig_raclhr-18c-n1_2019-08-21_11-21-45AM.log root.sh脚本日志:rootcrs_raclhr-18c-n1_2019-08-21_11-15-48AM.log |
RESPONSE_FILE的文件内容:
1 2 3 4 5 6 7 8 9 10 11 12 | -- 以grid用户运行在节点1运行即可 cat > /home/grid/cfgrsp.properties <<"EOF" oracle.assistants.asm|S_ASMPASSWORD=oracle oracle.assistants.asm|S_ASMMONITORPASSWORD=oracle oracle.crs|S_BMCPASSWORD=oracle EOF /u01/app/11.2.0.4/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties -- 日志 /u01/app/11.2.0.4/grid/cfgtoollogs/oui/configActions2022-08-05_01-37-00-PM.log |
Restart ASM grid
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | /soft/grid/runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ ORACLE_HOSTNAME=cictrsdb-dg \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ oracle.install.option=CRS_SWONLY \ ORACLE_BASE=/u01/app/grid \ ORACLE_HOME=/u01/app/11.2.0/grid \ oracle.install.asm.OSDBA=asmdba \ oracle.install.asm.OSOPER=asmoper \ oracle.install.asm.OSASM=asmadmin \ oracle.install.crs.config.storageOption=ASM_STORAGE \ oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=EXTERNAL \ oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=EXTERNAL \ oracle.install.crs.config.useIPMI=false \ oracle.install.asm.SYSASMPassword=oracle \ oracle.install.asm.diskGroup.name=DATA \ oracle.install.asm.diskGroup.redundancy=EXTERNAL \ oracle.install.asm.diskGroup.disks=/dev/asm-diskb \ oracle.install.asm.monitorPassword=oracle \ oracle.installer.autoupdates.option=SKIP_UPDATES As a root user, execute the following script(s): 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/11.2.0/grid/root.sh /u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl |
报错:
1 | ohasd failed to start at /u01/app/11.2.0/grid/crs/install/roothas.pl line 377, <ALERTLOG> line 73. |
解决:
1 2 | $GRID_HOME/crs/install/roothas.pl -deconfig -force -verbose /u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl |
在执行root.sh脚本时出现“Adding Clusterware entries to inittab”的时候,在另一个窗口使用root立即执行以下命令:
1 | dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1 |
--(等待root.sh成功执行完毕后可以ctrl+c取消这里的命令)
12.1.0.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | cat > /etc/oraInst.loc <<"EOF" inventory_loc=/u01/app/oraInventory inst_group=oinstall EOF chown oracle:oinstall /etc/oraInst.loc chmod 664 /etc/oraInst.loc su - grid /soft/grid/runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ ORACLE_BASE=/u01/app/grid \ ORACLE_HOME=/u01/app/12.1.0.2/grid \ oracle.install.asm.OSDBA=asmdba \ oracle.install.asm.OSOPER=asmoper \ oracle.install.asm.OSASM=asmadmin \ oracle.install.crs.config.storageOption=ASM_STORAGE \ oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=EXTERNAL \ oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=EXTERNAL \ oracle.install.crs.config.useIPMI=false \ oracle.install.asm.diskGroup.name=OCR \ oracle.install.asm.diskGroup.redundancy=EXTERNAL \ oracle.installer.autoupdates.option=SKIP_UPDATES \ oracle.install.crs.config.gpnp.scanPort=1521 \ oracle.install.crs.config.gpnp.configureGNS=false \ oracle.install.crs.config.autoConfigureClusterNodeVIP=false \ oracle.install.option=CRS_CONFIG \ oracle.install.crs.config.ClusterType=STANDARD \ oracle.install.asm.SYSASMPassword=oracle \ oracle.install.asm.monitorPassword=oracle \ oracle.install.config.managementOption=NONE \ oracle.install.crs.config.ignoreDownNodes=false \ oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm-disk* \ oracle.install.asm.diskGroup.disks=/dev/asm-diskb,/dev/asm-diske,/dev/asm-diskf \ oracle.install.crs.config.gpnp.scanName=hwy-oracle-scan \ oracle.install.crs.config.clusterName=hwy-cluster \ oracle.install.crs.config.clusterNodes=hwy-oracle-01:hwy-oracle-01-vip,hwy-oracle-02:hwy-oracle-02-vip \ oracle.install.crs.config.networkInterfaceList=eth0:10.1.200.0:1,eth1:10.1.100.0:2 \ ORACLE_HOSTNAME=hwy-oracle-01 As a root user, execute the following script(s): 1. /u01/app/12.1.0.2/grid/root.sh Execute /u01/app/12.1.0.2/grid/root.sh on the following nodes: [hwy-oracle-01, hwy-oracle-02] Run the script on the local node first. After successful completion, you can start the script in parallel on all other nodes. .................................................. 100% Done. Successfully Setup Software. As install user, execute the following script to complete the configuration. 1. /u01/app/12.1.0.2/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=<response_file> Note: 1. This script must be run on the same host from where installer was run. 2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation). -- 以grid用户运行 cat >> /home/grid/cfgrsp.properties <<"EOF" oracle.assistants.asm|S_ASMPASSWORD=password oracle.assistants.asm|S_ASMMONITORPASSWORD=password oracle.crs|S_BMCPASSWORD=password EOF /u01/app/12.1.0.2/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/grid/cfgrsp.properties |
12.2.0.1
rac grid
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | /u01/app/12.2.0/grid/gridSetup.sh -silent -force -noconfig -ignorePrereq \ oracle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v12.2.0 \ INVENTORY_LOCATION=/u01/app/oraInventory \ oracle.install.option=CRS_CONFIG \ ORACLE_BASE=/u01/app/grid \ oracle.install.asm.OSDBA=asmdba \ oracle.install.asm.OSOPER=asmoper \ oracle.install.asm.OSASM=asmadmin \ oracle.install.crs.config.scanType=LOCAL_SCAN \ oracle.install.crs.config.gpnp.scanName=JDE91.sundan.com \ oracle.install.crs.config.gpnp.scanPort=1521 \ oracle.install.crs.config.ClusterConfiguration=STANDALONE \ oracle.install.crs.config.configureAsExtendedCluster=false \ oracle.install.crs.config.clusterName=dbr710-cluster \ oracle.install.crs.config.gpnp.configureGNS=false \ oracle.install.crs.config.autoConfigureClusterNodeVIP=false \ oracle.install.crs.config.clusterNodes=dbr710a:dbr710a-vip:HUB,dbr710b:dbr710b-vip:HUB \ oracle.install.crs.config.networkInterfaceList=eth0:192.168.88.0:1,eth1:110.110.20.0:5 \ oracle.install.asm.configureGIMRDataDG=false \ oracle.install.crs.config.useIPMI=false \ oracle.install.asm.storageOption=ASM \ oracle.install.asmOnNAS.configureGIMRDataDG=false \ oracle.install.asm.SYSASMPassword=oracle \ oracle.install.asm.monitorPassword=oracle \ oracle.install.asm.diskGroup.name=CRS \ oracle.install.asm.diskGroup.redundancy=NORMAL \ oracle.install.asm.diskGroup.AUSize=4 \ oracle.install.asm.diskGroup.disks=/dev/asm-diska,/dev/asm-diskb,/dev/asm-diskc \ oracle.install.asm.diskGroup.diskDiscoveryString=/dev/asm-* \ oracle.install.asm.configureAFD=false \ oracle.install.crs.configureRHPS=false \ oracle.install.crs.config.ignoreDownNodes=false \ oracle.install.config.managementOption=NONE \ oracle.install.crs.rootconfig.executeRootScript=false As a root user, execute the following script(s): 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/12.2.0/grid/root.sh Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes: [dbr710a, dbr710b] Execute /u01/app/12.2.0/grid/root.sh on the following nodes: [dbr710a, dbr710b] Run the script on the local node first. After successful completion, you can start the script in parallel on all other nodes. Successfully Setup Software. As install user, execute the following command to complete the configuration. /u01/app/12.2.0/grid/gridSetup.sh -executeConfigTools -responseFile null [-silent] Moved the install session logs to: /u01/app/oraInventory/logs/GridSetupActions2021-11-06_11-10-21PM -- 以grid用户运行 /u01/app/12.2.0/grid/gridSetup.sh -silent -executeConfigTools -responseFile /u01/app/12.2.0/grid/install/response/grid_2021-11-10_06-09-05PM.rsp |
静默创建单机ASM实例
1 2 3 4 5 6 7 8 9 | /u01/app/11.2.0/grid/bin/asmca -silent -configureASM -sysAsmPassword lhr -asmsnmpPassword lhr -diskGroupName OCR -diskList /dev/rhdisk20 -redundancy EXTERNAL /u01/app/11.2.0/grid/bin/asmca -silent -configureASM -sysAsmPassword lhr -asmsnmpPassword lhr -diskString '/dev/asm-disk*' -diskGroupName DATA -diskList /dev/asm-diskb -redundancy EXTERNAL netca -silent -responsefile $ORACLE_HOME/assistants/netca/netca.rsp crsctl stat res -t -init CREATE DISKGROUP ARCH external redundancy DISK '/dev/asm-diske'; |
注意
在静默安装grid软件时,需要注意参数“oracle.install.crs.config.networkInterfaceList”的值:
1 | oracle.install.crs.config.networkInterfaceList=eth0:192.168.88.0:1,eth1:110.110.20.0:2 \ |
如下所示,2个不一样的配置,注意netmask的返回值:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | [root@cwrac1 ~]# ifconfig eth1 eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1290 inet 192.168.8.8 netmask 255.255.255.0 broadcast 192.168.8.255 inet6 fe80::215:5dff:fed2:867e prefixlen 64 scopeid 0x20<link> ether 00:15:5d:d2:86:7e txqueuelen 1000 (Ethernet) RX packets 65369 bytes 9647978 (9.2 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 57361 bytes 6620769 (6.3 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@oarac1 ~]# ifconfig eth1 eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 1.1.4.1 netmask 255.255.0.0 broadcast 1.1.255.255 inet6 fe80::f816:3eff:fefd:1fd prefixlen 64 scopeid 0x20<link> ether fa:16:3e:fd:01:fd txqueuelen 1000 (Ethernet) RX packets 46377219 bytes 34421522036 (32.0 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 48063190 bytes 41861576604 (38.9 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
对于cwrac1来说,应该如下配置:
1 | oracle.install.crs.config.networkInterfaceList=eth0:192.168.88.0:1,eth1:192.168.8.0:2 \ |
对于oarac1来说,应该如下配置:
1 | oracle.install.crs.config.networkInterfaceList=eth0:192.168.88.0:1,eth1:1.1.0.0:2 \ |
eth1应该配置“eth1:1.1.0.0:2”而不是“eth1:1.1.4.0:2”,因为“netmask 255.255.0.0
”
db软件
日志位置:/u01/app/oraInventory/logs
预检查:/soft/grid/runcluvfy.sh stage -pre dbinst -n all -verbose -fixup
可以添加debug进行调试,例如:./runInstaller -debug
11.2.0.4、12.2.0.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | -- 11.2.0.4没问题 ./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ oracle.install.option=INSTALL_DB_SWONLY \ UNIX_GROUP_NAME=oinstall \ INVENTORY_LOCATION=/u01/app/oraInventory \ ORACLE_BASE=/u01/app/oracle \ oracle.install.db.InstallEdition=EE \ oracle.install.db.OSDBA_GROUP=dba \ oracle.install.db.OSOPER_GROUP=oper \ oracle.install.db.OSBACKUPDBA_GROUP=dba \ oracle.install.db.OSDGDBA_GROUP=dba \ oracle.install.db.OSKMDBA_GROUP=dba \ oracle.install.db.OSRACDBA_GROUP=dba \ oracle.install.db.CLUSTER_NODES=rac1,rac2 \ oracle.install.db.config.starterdb.type=GENERAL_PURPOSE -- 11.2.0.4没问题 ./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ oracle.install.option=INSTALL_DB_SWONLY \ UNIX_GROUP_NAME=oinstall \ INVENTORY_LOCATION=/u01/app/oraInventory \ ORACLE_BASE=/u01/app/oracle \ ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1 \ ORACLE_BASE=/u01/app/oracle \ oracle.install.db.InstallEdition=EE \ oracle.install.db.OSDBA_GROUP=dba \ oracle.install.db.OSOPER_GROUP=oper \ oracle.install.db.OSBACKUPDBA_GROUP=dba \ oracle.install.db.OSDGDBA_GROUP=dba \ oracle.install.db.OSKMDBA_GROUP=dba \ oracle.install.db.OSRACDBA_GROUP=dba \ oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \ oracle.installer.autoupdates.option=SKIP_UPDATES \ oracle.install.db.CLUSTER_NODES=rac1,rac2 \ ORACLE_HOSTNAME=rac1 ./runInstaller -debug ORACLE_HOSTNAME=rac1 ./runInstaller ORACLE_HOSTNAME=rac1 |
12.1.0.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | ./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \ oracle.install.option=INSTALL_DB_SWONLY \ DECLINE_SECURITY_UPDATES=true \ UNIX_GROUP_NAME=oinstall \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ oracle.install.db.InstallEdition=EE \ oracle.install.db.isCustomInstall=false \ oracle.install.db.EEOptionsSelection=false \ oracle.install.db.DBA_GROUP=dba \ oracle.install.db.OPER_GROUP=asmoper \ oracle.install.db.isRACOneInstall=false \ oracle.install.db.BACKUPDBA_GROUP=dba \ oracle.install.db.DGDBA_GROUP=dba \ oracle.install.db.KMDBA_GROUP=dba \ oracle.install.db.rac.serverpoolCardinality=0 \ oracle.install.db.ConfigureAsContainerDB=false \ oracle.install.db.config.starterdb.memoryOption=false \ oracle.install.db.config.starterdb.installExampleSchemas=true \ oracle.install.db.config.starterdb.managementOption=DEFAULT \ oracle.install.db.config.starterdb.enableRecovery=false \ oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \ SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \ oracle.installer.autoupdates.option=SKIP_UPDATES \ ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1 \ ORACLE_BASE=/u01/app/oracle \ oracle.install.db.CLUSTER_NODES=hwy-oracle-01,hwy-oracle-02 \ ORACLE_HOSTNAME=hwy-oracle-01 /u01/app/oracle/product/12.1.0.2/dbhome_1/root.sh echo " oracle.assistants.server|S_SYSlhr=lhr oracle.assistants.server|S_SYSTEMlhr=lhr oracle.assistants.server|S_DBSNMPlhr=lhr oracle.assistants.server|S_PDBADMINlhr=lhr oracle.assistants.server|S_EMADMINlhr=lhr oracle.assistants.server|S_ASMSNMPlhr=lhr " >> /home/oracle/db.rsp /u01/app/oracle/product/12.1.0.2/dbhome_1/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/home/oracle/db.rsp |
报错:Checking swap space: 0 MB available, 150 MB required. Failed <<<<
解决: