ORACLE12CR2 RAC安裝部署(REDHAT7.6)一、環境配置
搭配官方文檔和mos文檔食用更佳。

oracle Database (RDBMS) on Unix AIX,HP-UX,Linux,Solaris and MS Windows Operating Systems Installation and Configuration Requirements Quick Reference (12.1/12.2/18c/19c) (Doc ID 1587357.1) https://docs.oracle.com/en/database/oracle/oracle-database/12.2/cwlin/grid-infrastructure-installation-and-upgrade-guide-linux.pdf Patch Set Updates for Oracle Products (Doc ID 854428.1) Database 12.2.0.1 Proactive Patch Information (Doc ID 2285557.1) How to Apply a Grid Infrastructure Patch Before Grid Infrastructure Configuration (before root.sh or rootupgrade.sh or gridsetup.bat) is Executed (Doc ID 1410202.1) ##以下是遇到的坑,以及MOS文章解決方案: 1、ASM device sharedness check Shared Storage Accessibility:/dev/asm_ocr ...FAILED (PRVG-11506) 可參照MOS文檔: 12.2: PRVG-0802 : Storage type for path "/dev/mapper/asm011p1" could not be determined (Doc ID 2251322.1) 2、CLSRSC-400: A system reboot is required to continue installing. 可參照MOS文檔: ALERT: root.sh Fails With "CLSRSC-400" While Installing GI 12.2.0.1 on RHEL or OL with RedHat Compatible Kernel (RHCK) 7.3 (Doc ID 2284463.1) 3、kgfnGetConnDetails requires 4 parameters at/u01/app/12.2.0/grid/lib/asmcmdbase.pm line 5704. 可參照MOS文檔: install.sh Hung And root.sh Is Failing At asmcmd lsdg --suppressheader While Installing A Zone With Clusterware (Doc ID 2414241.1) ASMCMD Failing With "KGFNGETCONNDETAILS Requires 4 Parameters at
0、參數準備
1、HostName、ClusterName、ScanName
2、IP(Public,Private,Virtual,Scan)
3、ASMDISK(OCR,ARCH,DATA;Redundancy)
4、ORACLE_SID
5、User Password(root,oracle,grid)
6、CharacterSet(CharacterSet,NationalCharacterSet)
7、Software(ORACLE,GRID,REDHAT)
8、ISCDB
一、環境檢查
1、Release Info
dmidecode | grep "Product Name" more /etc/system-release
2、Kernel Info
uname -r
3、CPU?Info
grep "model name" /proc/cpuinfo grep "model name" /proc/cpuinfo | wc -l
4、Memory Info
##查看內存條數、大小 dmidecode|grep -P -A5 "Memory\s+Device"|grep Size|grep -v Range grep MemTotal /proc/meminfo | awk '{print $2}'
5、Swap Info
grep SwapTotal /proc/meminfo | awk '{print $2}'
6、ZONE
timedatectl | grep zone
7、tmp Info
df -h /tmp
8、Disk Info
df -h lsblk
9、Network Info
nmcli connection show ip addr ##查看網卡驅動的速率 iplink=`cat /proc/net/dev | awk '{i++; if(i>2){print $1}}' | sed 's/^[\t]*//g' | sed 's/[:]*$//g'` for i in $iplink do printf "%s %s\n" "$i :" ethtool -i $i
10、Transparent HugePages
cat /sys/kernel/mm/transparent_hugepage/enabled cat /sys/kernel/mm/transparent_hugepage/defrag
11、vm.min_free_kbytes
cat /proc/sys/vm/min_free_kbytes
12、vm.swappiness
cat /proc/sys/vm/swappiness
13、SELINUX
grep ^SELINUX= /etc/selinux/config
14、Firewalld
systemctl status firewalld | grep Active
15、avahi-daemon
systemctl status avahi-daemon | grep Active
16、NUMA
grep NUMA /proc/cmdline
二、環境配置
1、RPM PACKAGE
關于oracle-database-server-12cR2-preinstall
yum install oracle-database-server-12cR2-preinstall-1.0-5.el7.src.rpm
oracle-database-server-12cR2-preinstall為我們做了什么 (1)自動安裝oracle所需的RPM包 (2)自動創建oracle用戶和dba、oinstall組 (3)自動配置/etc/sysctl.conf內核參數 (4)自動配置/etc/security/limits.conf參數 (5)關閉NUMA=OFF (關閉非一致內存訪問) (6)關閉NOZEROCONF=yes (7)修改系統啟動版本信息
摘自官方MOS文檔:
_**Oracle Database (RDBMS) on Unix AIX,HP-UX,Linux,Solaris and MS Windows Operating Systems Installation and Configuration Requirements Quick Reference (12.1/12.2/18c/19c) (Doc ID 1587357.1)? ??**_Oracle Linux 7 / RHEL 7
OS Version
Patches/Packages
Kernel settings
Reference :
Note 1961997.1
/etc/security/limits.conf
oracle???soft??? nproc??? 2047 (at least)
oracle???hard?? nproc?? 16384 (at least)
oracle???soft??? nofile??? 1024 (at least)
oracle???hard?? nofile??? 65536 (at least)
oracle???soft??? stack??? 10240 KB (at least)
oracle???hard?? stack??? 32768 KB (at most)
memlock
Soft: at least 90 percent of the current RAM when HugePages memory is enabled and at least 3145728 KB (3 GB) when HugePages memory is disabled
hard: at least 90 percent of the current RAM when HugePages memory is enabled and at least 3145728 KB (3 GB) when HugePages memory is disabled
以下摘自官方文檔:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/cwlin/grid-infrastructure-installation-and-upgrade-guide-linux.pdf
Operating System Requirements for x86-64 Linux Platforms
Red Hat Enterprise Linux 7 Distributions for x86-64: 1、SSH Requirement Ensure that OpenSSH is installed on your servers. 2、Red Hat Enterprise Linux 7: 3.10.0-123.el7.x86_64 or later 3、he following packages (or later versions) must be installed: bc binutils-2.23.52.0.1-12.el7 (x86_64) compat-libcap1-1.10-3.el7 (x86_64) compat-libstdc++-33-3.2.3-71.el7 (i686) compat-libstdc++-33-3.2.3-71.el7 (x86_64) glibc-2.17-36.el7 (i686) glibc-2.17-36.el7 (x86_64) glibc-devel-2.17-36.el7 (i686) glibc-devel-2.17-36.el7 (x86_64) ksh libaio-0.3.109-9.el7 (i686) libaio-0.3.109-9.el7 (x86_64) libaio-devel-0.3.109-9.el7 (i686) libaio-devel-0.3.109-9.el7 (x86_64) libgcc-4.8.2-3.el7 (i686) libgcc-4.8.2-3.el7 (x86_64) libstdc++-4.8.2-3.el7 (i686) libstdc++-4.8.2-3.el7 (x86_64) libstdc++-devel-4.8.2-3.el7 (i686) libstdc++-devel-4.8.2-3.el7 (x86_64) libxcb-1.9-5.el7 (i686) libxcb-1.9-5.el7 (x86_64) libX11-1.6.0-2.1.el7 (i686) libX11-1.6.0-2.1.el7 (x86_64) libXau-1.0.8-2.1.el7 (i686) libXau-1.0.8-2.1.el7 (x86_64) libXi-1.7.2-1.el7 (i686) libXi-1.7.2-1.el7 (x86_64) libXtst-1.2.2-1.el7 (i686) libXtst-1.2.2-1.el7 (x86_64) libXrender (i686) libXrender (x86_64) libXrender-devel (i686) libXrender-devel (x86_64) make-3.82-19.el7 (x86_64) net-tools-2.0-0.17.20131004git.el7 (x86_64) (for Oracle RAC and Oracle Clusterware) nfs-utils-1.3.0-0.21.el7.x86_64 (for Oracle ACFS) smartmontools-6.2-4.el7 (x86_64) sysstat-10.1.5-1.el7 (x86_64)
--redhat內核支持 Red Hat Enterprise Linux 7: 3.10.0-123.el7.x86_64 or later --鏡像掛載 mount /dev/cdrom /mnt mv /etc/yum.repos.d/* /tmp/ echo "[local]" >> /etc/yum.repos.d/local.repo echo "name = local" >> /etc/yum.repos.d/local.repo echo "baseurl = file:///mnt/" >> /etc/yum.repos.d/local.repo echo "enabled = 1" >> /etc/yum.repos.d/local.repo echo "gpgcheck = 0" >> /etc/yum.repos.d/local.repo yum clean all yum repolist all --安裝圖形化界面 yum groupinstall -y "Server with GUI" --安裝oracle所需依賴包 yum install -y bc binutils compat-libcap1 compat-libstdc++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libxcb libX11 libXau libXi libXtst libXrender libXrender-devel make net-tools nfs-utils smartmontools sysstat openssh-clients --檢查是否安裝成功 rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' bc binutils compat-libcap1 compat-libstdc++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libxcb libX11 libXau libXi libXtst libXrender libXrender-devel make net-tools nfs-utils smartmontools sysstat openssh-clients --需要額外安裝compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm包 rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
2、Configuring Kernel Parameters for Linux
The /etc/sysctl.conf file has been deprecated
/etc/sysctl.conf文件在OL7和RHEL7中已被棄用
cat <
3、Resource Limits
/etc/security/limits.conf oracle soft nproc 2047 (at least) oracle hard nproc 16384 (at least) oracle soft nofile 1024 (at least) oracle hard nofile 65536 (at least) oracle soft stack 10240 KB (at least) oracle hard stack 32768 KB (at most) memlock Soft: at least 90 percent of the current RAM when HugePages memory is enabled and at least 3145728 KB (3 GB) when HugePages memory is disabled hard: at least 90 percent of the current RAM when HugePages memory is enabled and at least 3145728 KB (3 GB) when HugePages memory is disabled
cat <
4、USER CREATE
Creating the OSASM Group # groupadd -g 54329 asmadmin Creating the OSDBA for ASM Group # /usr/sbin/groupadd -g 54327 asmdba Creating the OSOPER for ASM Group # /usr/sbin/groupadd -g 54328 asmoper Creating the OSDBA Group for Database Installations # /usr/sbin/groupadd -g 54322 dba Creating an OSOPER Group for Database Installations # groupadd -g 54323 oper Creating the OSBACKUPDBA Group for Database Installations # /usr/sbin/groupadd -g 54324 backupdba Creating the OSDGDBA Group for Database Installations # /usr/sbin/groupadd -g 54325 dgdba Creating the OSKMDBA Group for Database Installations # /usr/sbin/groupadd -g 54326 kmdba Creating the OSRACDBA Group for Database Installations # /usr/sbin/groupadd -g 54330 racdba $ id oracle uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54327(asmdba),54330(racdba) $ id grid uid=54331(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54327(asmdba),54328(asmoper),54329(asmadmin),54330(racdba)
##創建用戶組 /usr/sbin/groupadd -g 54321 oinstall /usr/sbin/groupadd -g 54322 dba /usr/sbin/groupadd -g 54323 oper /usr/sbin/groupadd -g 54324 backupdba /usr/sbin/groupadd -g 54325 dgdba /usr/sbin/groupadd -g 54326 kmdba /usr/sbin/groupadd -g 54327 asmdba /usr/sbin/groupadd -g 54328 asmoper /usr/sbin/groupadd -g 54329 asmadmin /usr/sbin/groupadd -g 54330 racdba ##創建用戶 /usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba oracle /usr/sbin/useradd -u 54331 -g oinstall -G asmadmin,asmdba,asmoper,oper,dba grid #修改密碼,這邊密碼均設置為oracle,密碼可以按自己需要修改 echo "oracle" |passwd grid --stdin echo "oracle" |passwd oracle --stdin
5、Oracle Home and Oracle Base Directory CREATE
mkdir -p /u01/app/grid mkdir -p /u01/app/12.2.0/grid mkdir -p /u01/app/oracle/product/12.2.0/db mkdir -p /u01/app/oraInventory chown -R grid:oinstall /u01/app/grid chown -R grid:oinstall /u01/app/12.2.0 chown -R grid:oinstall /u01/app/oraInventory chown -R oracle:oinstall /u01/app/oracle chmod -R 775 /u01
6、Disable Firewalld and SELLINUX
--關閉防火墻 systemctl stop firewalld systemctl disable firewalld --關閉selinux sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
7、HOSTS
cat >> /etc/hosts < 8、Disable Transparent Hugepages & NUMA For example, for Oracle Linux 7.3, the procedure to disable Transparent HugePages involves editing the /etc/default/grub file and then running the command grub2-mkconfig sed -i 's/quiet/quiet transparent_hugepage=never numa=off/' /etc/default/grub ##重建grub 配置文件: ##fdisk -l可以查看主分區的Disk label type: gpt ##MBR 分區表 ##grub2-mkconfig -o /etc/grub2.cfg\ ##efi 引導模式,efi+GPT分區表 grub2-mkconfig -o /etc/grub2-efi.cfg ##reboot之后查看是否生效 numactl --hardware dmesg|grep -i numa cat /proc/cmdline ##臨時生效 echo never >/sys/kernel/mm/transparent_hugepage/enabled echo never >/sys/kernel/mm/transparent_hugepage/defrag 9、Disable?NOZEROCONF echo "NOZEROCONF=yes" >> /etc/sysconfig/network 10、Disable?NetworkManager systemctl stop NetworkManager.service systemctl disable NetworkManager.service 11、Disable?avahi-daemon systemctl stop avahi-daemon.socket systemctl stop avahi-daemon.service systemctl disable avahi-daemon.service ps -ef|grep avahi-daemon 12、Disable chronyd By default, the NTP service available on Oracle Linux 7 and Red Hat Linux 7 is chronyd and the NTP service available on Oracle Linux 6 and Red Hat Linux 6 or lower is ntpd. systemctl stop chronyd systemctl disable chronyd mv /etc/resolv.conf /etc/resolv.conf.bak mv /etc/chrony.conf /etc/chrony.conf.bak 13、配置/dev/shm cat < 14、UDEV+MULTIPATH ##安裝multipath yum install -y device-mapper* mpathconf --enable --with_multipathd y ##查看磁盤wwid /usr/lib/udev/scsi_id -g -u /dev/sdb --配置multipath.confc cat < 15、環境變量設置 ROOT: cat >>/etc/profile <<"EOF" ################# Root Rrofile Add ############################ if [ $USER = "oracle" ] || [ $USER = "grid" ] || [ $USER = "root" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi alias so='su - oracle' alias sg='su - grid' alias crsctl='/u01/app/11.2.0/grid/bin/crsctl' ################# Root Rrofile End ############################ EOF GRID: cat < ORALCE: cat < Notes:安裝前執行reboot。 Linux Oracle
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。