そういうのがいいブログ

SIerで働く30代サラリーマンSEがインフラエンジニアに憧れてLinux・クラウド・AWSの勉強をするブログ

Oracle Database Preinstall 19c の実行でサーバーに設定される内容の確認

※[PR]当ブログの記事の中にはプロモーションが含まれています。

Oracle Database Preinstall 19cの実行により、Oracle Linux 7.7に加えられる設定を確認してみる

Oracle Database Preinstall 19c」をインストールしたときに表示されていたメッセージと、
ログファイルから、具体的にどういう設定が追加されているのかを見てみようと思います。

Oracle DatabaseをLinuxへインストールするには、たくさんの前提作業が必要で、それがPreinstallを実行することでまとめて自動で行われているのが分かります。

前回の記事

souiunogaii.hatenablog.com

Oracle Preinstall 19cで一緒にインストールされたパッケージ一覧

インストール時のメッセージを見ると、以下のパッケージが一緒にインストールされていました。

  • oracle-database-preinstall-19c x86_64 1.0-1.el7
  • compat-libcap1 x86_64 1.10-7.el7
  • compat-libstdc++-33 x86_64 3.2.3-72.el7
  • gssproxy x86_64 0.7.0-26.el7
  • keyutils x86_64 1.5.8-3.el7
  • ksh x86_64 20120801-139.0.1.el7
  • libXmu x86_64 1.1.2-2.el7
  • libXt x86_64 1.1.5-3.el7
  • libXv x86_64 1.0.11-1.el7
  • libXxf86dga x86_64 1.1.4-2.1.el7
  • libXxf86misc x86_64 1.0.3-7.1.el7
  • libaio-devel x86_64 0.3.109-13.el7
  • libbasicobjects x86_64 0.1.1-32.el7
  • libcollection x86_64 0.7.0-32.el7
  • libdmx x86_64 1.1.3-3.el7
  • libevent x86_64 2.0.21-4.el7
  • libini_config x86_64 1.3.1-32.el7
  • libnfsidmap x86_64 0.25-19.el7
  • libpath_utils x86_64 0.2.1-32.el7
  • libref_array x86_64 0.1.5-32.el7
  • libverto-libevent x86_64 0.2.5-4.el7
  • nfs-utils x86_64 1:1.3.0-0.65.0.1.el7
  • psmisc x86_64 22.20-16.el7
  • xorg-x11-utils x86_64 7.5-23.el7
  • xorg-x11-xauth x86_64 1:1.0.9-1.el7

Orace Database Preinstall 19c の実行結果のログ

Oracle Preinstallの実行コマンド

yum install oracle-database-preinstall-19c

Oracle Preinstallの実行結果のログ出力場所

ログは下記の場所に出力されていました。
この「orakernel.log」の中身を順番に見ていこうと思います。

/var/log/oracle-database-preinstall-19c/results/orakernel.log

(1) ユーザーとグループの作成

Adding group oinstall with gid 54321
Adding group dba with gid 54322
Adding group oper with gid 54323
Adding group backupdba with gid 54324
Adding group dgdba with gid 54325
Adding group kmdba with gid 54326
Adding group racdba with gid 54330
Adding user oracle with user id 54321, initial login group oinstall, supplementary groups oinstall,dba,oper,backupdba,dgdba,kmdba,racdba and  home directory /home/oracle
Changing ownership of /home/oracle to oracle:oinstall
Please set password for user - oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)
User creation passed 

ユーザーとグループが追加されているのが分かります。
oracleユーザーのパスワードは後で自分で手動で設定します)

group / user name gid / uid
group oinstall 54321
group dba 54322
group oper 54323
group backupdba 54324
group dgdba 54325
group kmdba 54326
group racdba 54330
user oracle 54321

/etc/group に以下が追記されていました。

oinstall:x:54321:oracle
dba:x:54322:oracle
oper:x:54323:oracle
backupdba:x:54324:oracle
dgdba:x:54325:oracle
kmdba:x:54326:oracle
racdba:x:54330:oracle

/etc/passwd に以下が追記されていました。

oracle:x:54321:54321::/home/oracle:/bin/bash

(2) カーネルパラメータの設定

Saving a copy of the initial sysctl.conf
Verifying  kernel parameters as per Oracle recommendations...
Trying to remove instances of  - setting for fs.file-max is
Adding fs.file-max = 6815744 
Trying to remove instances of  - setting for kernel.sem is
Adding kernel.sem = 250 32000 100 128 
Trying to remove instances of  - setting for kernel.shmmni is
Adding kernel.shmmni = 4096 
Trying to remove instances of  - setting for kernel.shmall is
Adding kernel.shmall = 1073741824 
Trying to remove instances of  - setting for kernel.shmmax is
Adding kernel.shmmax = 4398046511104 
Trying to remove instances of  - setting for kernel.panic_on_oops is
Adding kernel.panic_on_oops = 1 
Trying to remove instances of  - setting for net.core.rmem_default is
Adding net.core.rmem_default = 262144 
Trying to remove instances of  - setting for net.core.rmem_max is
Adding net.core.rmem_max = 4194304 
Trying to remove instances of  - setting for net.core.wmem_default is
Adding net.core.wmem_default = 262144 
Trying to remove instances of  - setting for net.core.wmem_max is
Adding net.core.wmem_max = 1048576 
Trying to remove instances of  - setting for net.ipv4.conf.all.rp_filter is
Adding net.ipv4.conf.all.rp_filter = 2 
Trying to remove instances of  - setting for net.ipv4.conf.default.rp_filter is
Adding net.ipv4.conf.default.rp_filter = 2 
Trying to remove instances of  - setting for fs.aio-max-nr is
Adding fs.aio-max-nr = 1048576 
Trying to remove instances of  - setting for net.ipv4.ip_local_port_range is
Adding net.ipv4.ip_local_port_range = 9000 65500 
Setting kernel parameters as per oracle recommendations...
Altered file /etc/sysctl.conf
Saved a copy of the current file in /etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf
Check /etc/sysctl.d for backups
Verification & setting of kernel parameters passed 

/etc/sysctl.conf がバックアップされて、
/etc/sysctl.d/99-oracle-database-preinstall-19c-sysctl.conf が作成されています。

(3) OSリソース制限の設定

Setting user limits using /etc/security/limits.d/oracle-database-preinstall-19c.conf

Verifying oracle user OS limits as per Oracle recommendations...
Adding oracle soft nofile  1024
Adding oracle hard nofile  65536
Adding oracle soft nproc  16384
Adding oracle hard nproc  16384
Adding oracle soft stack  10240
Adding oracle hard stack  32768
Adding oracle hard memlock  134217728
Adding oracle soft memlock  134217728
Setting oracle user OS limits as per Oracle recommendations...
Altered file /etc/security/limits.d/oracle-database-preinstall-19c.conf
Original file backed up at /var/log/oracle-database-preinstall-19c/backup/Jan-10-2020-09-06-45
Verification & setting of user limits passed 

/etc/security/limits.d/oracle-database-preinstall-19c.conf が作成されています。

(4) ブートパラメータの設定

Saving a copy of /etc/default/grub file in /etc/default/grub-initial.orabackup
Saving a copy of /etc/default/grub in /var/log/oracle-database-preinstall-19c/backup/Jan-10-2020-09-06-45...
Verifying kernel boot parameters as per Oracle recommendations...
old boot params: "crashkernel=auto rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet"
new boot params: "crashkernel=auto rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off"

old boot params: "crashkernel=auto rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off"
new boot params: "crashkernel=auto rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off transparent_hugepage=never"

Setting kernel boot parameters as per Oracle recommendations...
G_DIR=/boot/grub2
Default kernel is ->  4.14.35-1902.8.4.el7uek.x86_64
Default saved_entry is -> Oracle Linux Server 7.7, with Unbreakable Enterprise Kernel 4.14.35-1902.8.4.el7uek.x86_64
Default saved_entry_line is ->   linux16 /vmlinuz-4.14.35-1902.8.4.el7uek.x86_64 
Saving a copy of grubenv... in /var/log/oracle-database-preinstall-19c/backup/Jan-10-2020-09-06-45
Generating grub configuration file ...
File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 28504: /usr/sbin/grub2-probe
File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 28504: /usr/sbin/grub2-probe
Found linux image: /boot/vmlinuz-4.14.35-1902.8.4.el7uek.x86_64
Found initrd image: /boot/initramfs-4.14.35-1902.8.4.el7uek.x86_64.img
Found linux image: /boot/vmlinuz-4.14.35-1902.3.2.el7uek.x86_64
Found initrd image: /boot/initramfs-4.14.35-1902.3.2.el7uek.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-1062.9.1.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1062.9.1.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-1062.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1062.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-4f9c87a5d1fc4454a9a3b925950b5fe9
Found initrd image: /boot/initramfs-0-rescue-4f9c87a5d1fc4454a9a3b925950b5fe9.img
File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 28968: /usr/sbin/grub2-probe
File descriptor 199 (/run/lock/subsys/oracle-preinstall.lock) leaked on vgs invocation. Parent PID 28968: /usr/sbin/grub2-probe
done
The saved kernel 4.14.35-1902.8.4.el7uek.x86_64 is now at position - 0
Boot parameters will be effected on next reboot
Altered file /etc/default/grub
Copy of the changed file is in - /etc/default/grub-oracle-database-preinstall-19c.orabackup
Copy of the original file is in - /var/log/oracle-database-preinstall-19c/backup/Jan-10-2020-09-06-45
Verification & setting of boot parameters passed 

/etc/default/grubがバックアップされて、追記されています。
具体的にはnuma=off transparent_hugepage=never という部分が追加されていました。
Oracle Databaseでは、「NUMA最適化」は非推奨。「透過的Huge Page」も非推奨みたいなので、どちらも無効に設定されています)

インストール前

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="crashkernel=auto rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

インストール後

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="crashkernel=auto rd.lvm.lv=ol/root rd.lvm.lv=ol/swap rhgb quiet numa=off transparent_hugepage=never"
GRUB_DISABLE_RECOVERY="true"

(5) ネットワーク設定

Trying to add NOZEROCONF parameter...
Taking a backup of existing file to /etc/sysconfig/network.orabackup
Successfully added parameter NOZEROCONF to /etc/sysconfig/network
Setting /etc/sysconfig/network parameters passed 

/etc/sysconfig/network がバックアップされて、追記されています。
具体的にはNOZEROCONF=yesという部分が追加されていました。
(APIPA自動IPアドレス設定の機能を無効にする設定らしい)

インストール前

# Created by anaconda

インストール後

# Created by anaconda
# oracle-database-preinstall-19c : Add NOZEROCONF=yes
NOZEROCONF=yes

(6) Huge Pagesと透過的Huge Pages

Disabling Transparent Hugepages. 
Refer Oracle Note:1557478.1

Disabling defrag. 
Refer Oracle Note:1557478.1

透過的Huge Pageが無効化されています。

(7) 実行前の設定ファイルのバックアップ場所

Taking a backup of old config files under /var/log/oracle-database-preinstall-19c/backup/Jan-10-2020-09-06-45 

f:id:souiunogaii:20200112162530j:plain

参考にしたサイト

www.intellilink.co.jp

参考書籍

本書では、Oracle初心者/新人エンジニアが押さえておくべき知識とスキルを、現場で活躍するOracleエンジニアたちが、わかりやすく丁寧に解説。
Oracleの使い方はもちろん、データベースの基礎知識から、データ操作のためのSQL、テーブル設計、データベース運用/管理の基礎までしっかり押さえ、実務で使える入門スキルを身につけられます。
Oracleを学びたいすべての人に最適な入門書です。

Oracleの基本 ~データベース入門から設計/運用の初歩まで