1.5小时!一键部署Oracle 11GR2 RAC 集群

网友投稿 672 2022-05-29

无人值守安装Oracle 11GR2 RAC集群,只需要1.5小时?没错,通过脚本静默安装,只需要1.5小时,包括安装补丁,建库。

脚本下载链接:SHELL脚本进行oracle数据库一键安装,实现真正的无人值守安装

1.5小时!一键部署Oracle 11GR2 RAC 集群

GitHub:https://github.com/pc-study/InstallOracleshell

一、主机准备

注意:

1.主机内存不得低于2G

2.磁盘空间不得低于50G

节点一:

节点二:

ASM盘通过共享存储之–StarWind高级配置方式配置ISCSI共享存储。(两个节点都需要配置ISCSI共享存储)

二、安装前准备

1.挂载ISO镜像源(两个节点都需要挂载)

##1.通过cdrom挂载 mount /dev/cdrom /mnt ##2.通过安装镜像源挂载 mount -o loop /soft/rhel-server-7.9-x86_64-dvd.iso /mnt

2.创建目录并上传安装介质(节点一上传即可)

##1.创建安装介质上传目录 mkdir /soft [root@localhost ~]# cd /soft/ ##2.上传安装介质 [root@localhost soft]# du -sh * ##linux7系统缺少补丁包 192K compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm ##无人值守shell脚本(包括互信脚本) 140K OracleShellInstall.sh 4.0K auto_ssh.sh ##oracle 11GR2官方DB 安装包 1.3G p13390677_112040_Linux-x86-64_1of7.zip 1.1G p13390677_112040_Linux-x86-64_2of7.zip ##oracle 11GR2官方GRID 安装包 1.2G p13390677_112040_Linux-x86-64_3of7.zip ##oracle 11GR2 GRID PSU 最终版补丁包+6880880 OPatch补丁包 1.3G p31718723_112040_Linux-x86-64.zip 118M p6880880_112000_Linux-x86-64.zip ##RAC GRID On Linux7 需要打补丁修复OHAS 175M p18370031_112040_Linux-x86-64.zip ##上下文切换软件(可选) 276K rlwrap-0.42.tar.gz ##3.授权脚本执行权限 chmod +x OracleShellInstall.sh chmod +x auto_ssh.sh

三、安装

注意:可通过./OracleShellInstall.sh --help查看命令帮助

安装命令如下:

##节点一执行即可 cd /soft ./OracleShellInstall.sh -i 10.211.55.100 `#Public ip`\ -n rac11g `# hostname`\ -o rac11g `# oraclesid`\ -rs oracle `# root password`\ -op oracle `# oracle password`\ -gp oracle `# grid password`\ -b /u01/app `# install basedir`\ -s AL32UTF8 `# characterset`\ -n1 rac11g01 -n2 rac11g02 `# node hostname`\ -pb1 10.211.55.100 -pb2 10.211.55.101 `# node public ip`\ -vi1 10.211.55.102 -vi2 10.211.55.103 `# node virtual ip`\ -pi1 10.10.1.1 -pi2 10.10.1.2 `# node private ip`\ -si 10.211.55.105 `# scan ip`\ -dd /dev/sde,/dev/sdf `# asm data disk`\ -od /dev/sdb,/dev/sdc,/dev/sdd `# asm ocr disk`\ -or EXTERNAL `# asm ocr redundancy`\ -dr EXTERNAL `# asm data redundancy`\ -on OCR `# asm ocr diskgroupname`\ -dn DATA `# asm data diskgroupname`\ -puf eth0 -prf eth1 `# network fcname`\ -ts 10.211.55.18 `# timeserver`\ -gpa 31718723 `# Grid PSU NUMBER`

敲下回车将开始无人值守安装…

开始时间:04:10

执行过程太多…略

安装日志记录在两个节点的/soft目录下:oracleAllSilent_*.log,在文末展示安装日志。

安装结束后,将自动创建好上述指定实例名为rac11g的数据库rac集群实例(rac11g01,rac11g02),并安装上传补丁31718723。

等待安装结束…

结束时间:05:40

安装结束。

总耗时:1小时30分钟。

安装日志如下:

节点一:

[root@rac11g01 soft]# cat oracleAllSilent_20210506030459.log #################################################################################### # Installation Logging #################################################################################### #################################################################################### # OS Version #################################################################################### OS Version : linux7 #################################################################################### # DB Version #################################################################################### DB Version : 11.2.0.4 #################################################################################### # HOSTNAME #################################################################################### HOSTNAME : rac11g01 #################################################################################### # RPM Check #################################################################################### RPM Check : bc-1.06.95-13.el7.x86_64 binutils-2.27-44.base.el7.x86_64 compat-libcap1-1.10-7.el7.x86_64 compat-libstdc++-33-3.2.3-72.el7.x86_64 gcc-4.8.5-44.el7.x86_64 gcc-c++-4.8.5-44.el7.x86_64 elfutils-libelf-0.176-5.el7.x86_64 elfutils-libelf-devel-0.176-5.el7.x86_64 glibc-2.17-317.el7.x86_64 glibc-devel-2.17-317.el7.x86_64 ksh-20120801-142.el7.x86_64 libaio-0.3.109-13.el7.x86_64 libaio-devel-0.3.109-13.el7.x86_64 libgcc-4.8.5-44.el7.x86_64 libstdc++-4.8.5-44.el7.x86_64 libstdc++-devel-4.8.5-44.el7.x86_64 libxcb-1.13-1.el7.x86_64 libX11-1.6.7-2.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXi-1.7.9-1.el7.x86_64 libXtst-1.2.3-1.el7.x86_64 libXrender-0.9.10-1.el7.x86_64 libXrender-devel-0.9.10-1.el7.x86_64 make-3.82-24.el7.x86_64 net-tools-2.0-0.25.20131004git.el7.x86_64 nfs-utils-1.3.0-0.68.el7.x86_64 smartmontools-7.0-2.el7.x86_64 sysstat-10.1.5-19.el7.x86_64 e2fsprogs-1.42.9-19.el7.x86_64 e2fsprogs-libs-1.42.9-19.el7.x86_64 fontconfig-devel-2.13.0-4.3.el7.x86_64 expect-5.45-14.el7_1.x86_64 unzip-6.0-21.el7.x86_64 openssh-clients-7.4p1-21.el7.x86_64 readline-6.2-11.el7.x86_64 #################################################################################### # /etc/hosts #################################################################################### /etc/hosts : 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 ##Public IP 10.211.55.100 rac11g01 10.211.55.101 rac11g02 ##Private IP 10.10.1.1 rac11g01-priv 10.10.1.2 rac11g02-priv ##Virtual IP 10.211.55.102 rac11g01-vip 10.211.55.103 rac11g02-vip ##Scan IP 10.211.55.105 rac11g-scan #################################################################################### # Create user and groups(grid) #################################################################################### Create user and groups(grid) : uid=11012(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54330(racdba),54327(asmdba),54328(asmoper),54329(asmadmin) #################################################################################### # Create user and groups(oracle) #################################################################################### Create user and groups(oracle) : uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba),54327(asmdba) #################################################################################### # multipath info: #################################################################################### multipath info: : data_2 (2c7a3296d077abc19) dm-7 ROCKET ,IMAGEFILE size=10G features='0' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 8:0:0:4 sdf 8:80 active ready running ocr_3 (26db11f226db16dbc) dm-5 ROCKET ,IMAGEFILE size=15G features='0' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 8:0:0:2 sdd 8:48 active ready running data_1 (20726af970fe9d02e) dm-6 ROCKET ,IMAGEFILE size=10G features='0' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 8:0:0:3 sde 8:64 active ready running ocr_2 (2a3131d89cdb898cd) dm-4 ROCKET ,IMAGEFILE size=15G features='0' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 8:0:0:1 sdc 8:32 active ready running ocr_1 (27dddccfeca91227d) dm-3 ROCKET ,IMAGEFILE size=15G features='0' hwhandler='0' wp=rw `-+- policy='service-time 0' prio=1 status=active `- 8:0:0:0 sdb 8:16 active ready running #################################################################################### # udev asm info: #################################################################################### udev asm info: : /dev/asm_data_1 /dev/asm_data_2 /dev/asm_ocr_1 /dev/asm_ocr_2 /dev/asm_ocr_3 #################################################################################### # chronyd #################################################################################### chronyd : ● chronyd.service - NTP client/server Loaded: loaded (/usr/lib/systemd/system/chronyd.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:chronyd(8) man:chrony.conf(5) May 06 14:23:54 localhost.localdomain systemd[1]: Starting NTP client/server... May 06 14:23:54 localhost.localdomain chronyd[731]: chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +SECHASH +IPV6 +DEBUG) May 06 14:23:54 localhost.localdomain systemd[1]: Started NTP client/server. May 06 15:06:54 rac11g01 systemd[1]: Stopping NTP client/server... May 06 15:06:54 rac11g01 chronyd[731]: chronyd exiting May 06 15:06:54 rac11g01 systemd[1]: Stopped NTP client/server. #################################################################################### # Time ntpdate #################################################################################### Time ntpdate : ##For ntpupdate #OracleBegin 00 12 * * * /usr/sbin/ntpdate -u 10.211.55.18 && /usr/sbin/hwclock -w #OracleEnd #################################################################################### # Time dependent #################################################################################### Time dependent : Sun May 9 04:11:14 CST 2021 #################################################################################### # avahi-daemon #################################################################################### avahi-daemon : #################################################################################### # Firewalld #################################################################################### Firewalld : ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) May 06 14:23:54 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon... May 06 14:23:55 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon. May 06 14:23:55 localhost.localdomain firewalld[750]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be removed in a future release. Please consider disabling it now. May 09 04:11:14 rac11g01 systemd[1]: Stopping firewalld - dynamic firewall daemon... May 09 04:11:15 rac11g01 systemd[1]: Stopped firewalld - dynamic firewall daemon. #################################################################################### # SELINUX #################################################################################### SELINUX : Permissive #################################################################################### # /etc/default/grub #################################################################################### /etc/default/grub : GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="spectre_v2=retpoline rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet transparent_hugepage=never numa=off" GRUB_DISABLE_RECOVERY="true" #################################################################################### # Transparent_hugepages #################################################################################### Transparent_hugepages : [always] madvise never #################################################################################### # NUMA #################################################################################### NUMA : BOOT_IMAGE=/vmlinuz-3.10.0-1160.el7.x86_64 root=/dev/mapper/rhel-root ro spectre_v2=retpoline rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet LANG=en_US.UTF-8 #################################################################################### # NetworkManager #################################################################################### NetworkManager : ● NetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; disabled; vendor preset: enabled) Active: inactive (dead) since Sun 2021-05-09 04:11:17 CST; 137ms ago Docs: man:NetworkManager(8) Main PID: 771 (code=exited, status=0/SUCCESS) May 06 14:43:52 localhost.localdomain NetworkManager[771]: [1620283432.5700] device (eth1): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed') May 06 14:43:52 localhost.localdomain NetworkManager[771]: [1620283432.5703] device (eth1): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed') May 06 14:43:52 localhost.localdomain NetworkManager[771]: [1620283432.5722] device (eth1): Activation: successful, device activated. May 06 15:05:34 rac11g01 NetworkManager[771]: [1620284734.4530] hostname: hostname changed from "localhost.localdomain" to "rac11g01" May 06 15:05:34 rac11g01 NetworkManager[771]: [1620284734.4538] policy: set-hostname: set hostname to 'rac11g01' (from system configuration) May 09 04:11:17 rac11g01 NetworkManager[771]: [1620504677.4001] caught SIGTERM, shutting down normally. May 09 04:11:17 rac11g01 systemd[1]: Stopping Network Manager... May 09 04:11:17 rac11g01 NetworkManager[771]: [1620504677.4082] manager: NetworkManager state is now CONNECTED_SITE May 09 04:11:17 rac11g01 NetworkManager[771]: [1620504677.4096] exiting (success) May 09 04:11:17 rac11g01 systemd[1]: Stopped Network Manager. #################################################################################### # rlwrap #################################################################################### rlwrap : rlwrap 0.42 #################################################################################### # /etc/sysctl.conf #################################################################################### /etc/sysctl.conf : fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 8365367295 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 #################################################################################### # NOZEROCONF #################################################################################### NOZEROCONF : # Created by anaconda #OracleBegin NOZEROCONF=yes #OracleEnd #################################################################################### # /etc/security/limits.d/20-nproc.conf #################################################################################### /etc/security/limits.d/20-nproc.conf : # Default limit for number of user's processes to prevent # accidental fork bombs. # See rhbz #432903 for reasoning. * - nproc 16384 root soft nproc unlimited #################################################################################### # /etc/security/limits.conf #################################################################################### /etc/security/limits.conf : # /etc/security/limits.conf # #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. # #Also note that configuration files in /etc/security/limits.d directory, #which are read in alphabetical order, override the settings in this #file in case the domain is the same or more specific. #That means for example that setting a limit for wildcard domain here #can be overriden with a wildcard setting in a config file in the #subdirectory, but a user specific setting here can be overriden only #with a user specific setting in the subdirectory. # #Each line describes a limit for a user in the form: # # # #Where: # can be: # - a user name # - a group name, with @group syntax # - the wildcard *, for default entry # - the wildcard %, can be also used with %group syntax, # for maxlogin limit # # can have the two values: # - "soft" for enforcing the soft limits # - "hard" for enforcing hard limits # # can be one of the following: # - core - limits the core file size (KB) # - data - max data size (KB) # - fsize - maximum filesize (KB) # - memlock - max locked-in-memory address space (KB) # - nofile - max number of open file descriptors # - rss - max resident set size (KB) # - stack - max stack size (KB) # - cpu - max CPU time (MIN) # - nproc - max number of processes # - as - address space limit (KB) # - maxlogins - max number of logins for this user # - maxsyslogins - max number of logins on the system # - priority - the priority to run user process with # - locks - max number of file locks the user can hold # - sigpending - max number of pending signals # - msgqueue - max memory used by POSIX message queues (bytes) # - nice - max nice priority allowed to raise to values: [-20, 19] # - rtprio - max realtime priority # # # #* soft core 0 #* hard rss 10000 #@student hard nproc 20 #@faculty soft nproc 20 #@faculty hard nproc 50 #ftp hard nproc 0 #@student - maxlogins 4 # End of file #OracleBegin oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768 oracle soft nproc 2047 oracle hard nproc 16384 oracle hard memlock 134217728 oracle soft memlock 134217728 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 grid hard stack 32768 grid soft nproc 2047 grid hard nproc 16384 #OracleEnd #################################################################################### # /etc/pam.d/login #################################################################################### /etc/pam.d/login : #%PAM-1.0 auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so auth substack system-auth auth include postlogin account required pam_nologin.so account include system-auth password include system-auth # pam_selinux.so close should be the first session rule session required pam_selinux.so close session required pam_loginuid.so session optional pam_console.so # pam_selinux.so open should only be followed by sessions to be executed in the user context session required pam_selinux.so open session required pam_namespace.so session optional pam_keyinit.so force revoke session include system-auth session include postlogin -session optional pam_ck_connector.so #OracleBegin session required pam_limits.so session required /lib64/security/pam_limits.so #OracleEnd #################################################################################### # /dev/shm #################################################################################### /dev/shm : # # /etc/fstab # Created by anaconda on Thu May 6 02:11:47 2021 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/rhel-root / xfs defaults 0 0 UUID=32cd2453-e3e4-4e58-a3c5-d7eb092d7469 /boot xfs defaults 0 0 /dev/mapper/rhel-home /home xfs defaults 0 0 /dev/mapper/rhel-swap swap swap defaults 0 0 /swapfile swap swap defaults 0 0 tmpfs /dev/shm tmpfs size=8169304k 0 0 #################################################################################### # df -hP #################################################################################### df -hP : Filesystem Size Used Avail Use% Mounted on devtmpfs 3.9G 4.0K 3.9G 1% /dev tmpfs 7.8G 0 7.8G 0% /dev/shm tmpfs 3.9G 9.2M 3.9G 1% /run tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/mapper/rhel-root 39G 8.5G 30G 23% / /dev/sda1 1014M 137M 878M 14% /boot /dev/mapper/rhel-home 19G 33M 19G 1% /home tmpfs 798M 0 798M 0% /run/user/0 /dev/sr0 4.3G 4.3G 0 100% /mnt #################################################################################### # Oracle Profile #################################################################################### Oracle Profile : # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH ################OracleBegin######################### umask 022 export TMP=/tmp export TMPDIR=$TMP export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 #AL32UTF8,ZHS16GBK export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db export ORACLE_HOSTNAME=rac11g01 export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export ORACLE_SID=rac11g1 export PATH=/usr/sbin:$PATH export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH alias sas='sqlplus / as sysdba' alias alert='tail -500f $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace/alert_$ORACLE_SID.log|more' export PS1="[`whoami`@`hostname`:"'$PWD]$ ' alias sqlplus='rlwrap sqlplus' alias rman='rlwrap rman' alias lsnrctl='rlwrap lsnrctl' alias asmcmd='rlwrap asmcmd' alias adrci='rlwrap adrci' alias ggsci='rlwrap ggsci' alias dgmgrl='rlwrap dgmgrl' ################OracleEnd###########################

Oracle

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:学术论文的参考文献格式写法
下一篇:Unity WebView 插件⭐️(四)插件不同平台版本的区别和注意事项
相关文章