在 Linux 上部署和配置 Oracle 数据库(以常见的 Oracle 11g/12c/19c 为例),需要注意以下关键方面,避免安装失败或后期运行不稳定。
/etc/hostsIP 主机名
_systemctl stop firewalld
systemctl disable firewalld
disabledvi /etc/selinux/config
SELINUX=disabled
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chmod -R 775 /u01
编辑 /etc/sysctl.conf:
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmax = 4294967295
kernel.shmall = 2097152
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
执行:
sysctl -p
编辑 /etc/security/limits.conf:
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
确保 /etc/pam.d/login 包含:
session required pam_limits.so
以 RHEL/CentOS 为例:
yum install -y binutils compat-libcap1 compat-libstdc++-33 \
gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel \
libgcc libstdc++ libstdc++-devel make sysstat unixODBC
19c 还需
compat-libstdc++-33、libnsl等
~oracle/.bash_profile:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export ORACLE_SID=orcl
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
./runInstaller
root.shnetca
lsnrctl status
dbca
⚠️ 注意事项:
/tmp 空间不足(≥ 1G)如果你告诉我:
我可以给你一份针对性的配置清单或静默安装模板。