
我要在oracle linux 7.5上安裝oracle資料庫12c。在此過程中,我必須編輯以下核心參數和設定值。
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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 = 1048586
文件說我應該編輯 /etc/sysctl.conf 檔案。當我執行 cat /etc/sysctl.conf 來讀取目前內容時,它會顯示以下訊息。
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5)
當我嘗試在 vi 中使用 root 使用者進行編輯時,它說 sysctl.conf 是唯讀的。即使我用“!”覆蓋,更改也不會應用並修改參數。
答案1
對文件的編輯/etc/sysctl.conf
通常只會在重新啟動時影響系統除非你用手跑:
sudo sysctl -p
如果您想在運行時設定特定的內核變量,請執行以下操作:
sudo sysctl -w kernel.shmmni=4096
如果您想查看所有內核變量,請執行以下操作:
sysctl -a