19C 單例項資料庫安裝

記錄每一次錯誤發表於2021-10-18
******************************
oracle 19c資料庫官方支援的系統版本:
Oracle Linux 8.1 with the Unbreakable Enterprise Kernel 6: 5.4.17-2011.0.7.el8uek.x86_64 or later
Oracle Linux 8 with the Red Hat Compatible kernel: 4.18.0-80.el8.x86_64 or later
Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 4: 4.1.12-124.19.2.el7uek.x86_64 or later
Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 5: 4.14.35-1818.1.6.el7uek.x86_64 or later
Oracle Linux 7.5 with the Red Hat Compatible kernel: 3.10.0-862.11.6.el7.x86_64 or later
Red Hat Enterprise Linux 8: 4.18.0-80.el8.x86_64 or later
Red Hat Enterprise Linux 7.5: 3.10.0-862.11.6.el7.x86_64 or lat
SUSE Linux Enterprise Server 12 SP3: 4.4.162-94.72-default or later
SUSE Linux Enterprise Server 15: 4.12.14-23-default or later
19c需要執行在linux7.5以上的系統,7.5以下可能會存在bug
伺服器的執行記憶體需要達到1G以上,/tmp目錄需要預留出1GB的空間,資料庫軟體大概要佔用空間10g,但是oracle建議至少要預留100G的空間,避免日後軟體目錄不斷擴大導致的空間不足。
******************************
1.配置yum源:
[root@orcl ~]# umount /dev/cdrom
[root@orcl ~]# mount  /dev/cdrom /media
mount: /dev/sr0 is write-protected, mounting read-only
[root@orcl ~]# cd /etc/yum.repos.d/
[root@orcl yum.repos.d]# vi oracle.repo
新增:
[oracle]
name=oracle
baseurl=file:///media
enabled=1
gpgcheck=0
2.安裝軟體包
yum install -y bc binutils  compat-libcap1  compat-libstdc++33  elfutils-libelf  elfutils-libelf-devel  fontconfig-devel  glibc  glibc-devel  ksh  libaio  libaio-devel  libX11  libXau  libXi  libXtst  libXrender  libXrender-devel  libgcc  libstdc++  libstdc++-devel  libxcb  make  smartmontools  sysstat  kmod*
compat-libstdc++-33-3.2.3 需要手動下載上傳
地址:連結:
提取碼:x6ym
3.關閉防火牆
關閉防火牆
[root@orcl ~]# systemctl stop firewalld.service
關閉作業系統自啟動
[root@orcl ~]#systemctl disable firewalld.service
檢查關閉情況
[root@orcl ~]# systemctl status firewalld.service
如下,dead表示未開啟開機啟動;inactive表示現在的狀態是關閉
4.關閉selinux
關閉selinux:
[root@orcl ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
5.關閉NUMA
官方建議在Linux Redhat7的環境中建議關閉NUMA
#檢視default 的grub 的entry
[root@orcl ~]# grubby --default-kernel
/boot/vmlinuz-3.10.0-693.el7.x86_64
#檢視default grub的具體資訊


[root@orcl ~]# grubby --info /boot/vmlinuz-3.10.0-693.el7.x86_64 

index=0

kernel=/boot/vmlinuz-3.10.0-693.el7.x86_64

args="ro crashkernel=auto rd.lvm.lv=rhel_orcl/root rd.lvm.lv=rhel_orcl/swap rhgb quiet.UTF-8"

root=/dev/mapper/rhel_orcl-root

initrd=/boot/initramfs-3.10.0-693.el7.x86_64.img

title=Red Hat Enterprise Linux Server (3.10.0-693.el7.x86_64) 7.4 (Maipo)

#更新args,新增numa=off的引數

[root@orcl ~]# grubby --args=numa=off --update-kernel /boot/vmlinuz-3.10.0-693.el7.x86_64

# 確認numa=off加入default grub中

[root@orcl ~]# grubby --info /boot/vmlinuz-3.10.0-693.el7.x86_64

index=0

kernel=/boot/vmlinuz-3.10.0-693.el7.x86_64

args="ro crashkernel=auto rd.lvm.lv=rhel_orcl/root rd.lvm.lv=rhel_orcl/swap rhgb quiet.UTF-8 numa=off"

root=/dev/mapper/rhel_orcl-root

initrd=/boot/initramfs-3.10.0-693.el7.x86_64.img

title=Red Hat Enterprise Linux Server (3.10.0-693.el7.x86_64) 7.4 (Maipo)

#重啟伺服器

reboot 

[root@orcl ~]# grubby --info /boot/vmlinuz-3.10.0-693.el7.x86_64

index=0

kernel=/boot/vmlinuz-3.10.0-693.el7.x86_64

args="ro crashkernel=auto rd.lvm.lv=rhel_orcl/root rd.lvm.lv=rhel_orcl/swap rhgb quiet.UTF-8 numa=off"

root=/dev/mapper/rhel_orcl-root

initrd=/boot/initramfs-3.10.0-693.el7.x86_64.img

title=Red Hat Enterprise Linux Server (3.10.0-693.el7.x86_64) 7.4 (Maipo)

確認numa已經被禁用了


6.建立使用者並密碼
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/useradd -u 54321 -g oinstall -G dba,oper oracle
passwd oracle或者
echo 'oracle' | passwd oracle --stdin
7.建立目錄
mkdir -p /u01/app/oracle
mkdir -p /u01/app/oracle/product/19.3.0/dbhome
mkdir -p /u01/app/oraInventory
chown oracle:oinstall /u01/app/oracle
chown oracle:oinstall  /u01/app/oracle/product/19.3.0/dbhome
chown oracle:oinstall /u01/app/oraInventory
8.調整核心引數
echo "
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
net.ipv4.ip_local_port_range = 9000 65500
" >> /etc/sysctl.conf
sysctl -p


9.修改系統限制引數
echo "
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728
oracle   soft   data    unlimited
oracle   hard   data    unlimited
" >> /etc/security/limits.conf
10.配置環境變數
echo "
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome
export ORACLE_SID=orcl
export PATH=\$ORACLE_HOME/bin:\$PATH
" >> /home/oracle/.bash_profile
11.配置主機名
echo "192.168.0.19 orcl" >>/etc/hosts
12.解壓軟體包:
執行
[oracle@orcl soft]$ export DISPLAY=:0
[oracle@orcl soft]$ ./runInstaller

Launching Oracle Database Setup Wizard..

安裝軟體,dbca建庫。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31547066/viewspace-2837798/,如需轉載,請註明出處,否則將追究法律責任。

相關文章