下面给你一个**在 Linux 上部署 Oracle 数据库(以 Oracle 19c 为例)**的通用实操流程,适用于 Oracle Linux / CentOS / RHEL。如果你用的是 11g / 12c / 21c,步骤类似,只是版本号不同。
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
编辑 /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.wmem_default = 262144
执行:
sysctl -p
编辑 /etc/security/limits.conf:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
yum install -y binutils compat-libstdc++ gcc gcc-c++ \
glibc glibc-devel ksh libaio libaio-devel libgcc \
libstdc++ libstdc++-devel make sysstat unixODBC
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chmod -R 775 /u01
unzip LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.3.0/dbhome_1
su - oracle
cd /u01/app/oracle/product/19.3.0/dbhome_1
./runInstaller
按图形界面:
最后执行:
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/19.3.0/dbhome_1/root.sh
su - oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
dbca
选择:
netca
或手动:
lsnrctl start
sqlplus / as sysdba
startup
验证:
select status from v$instance;
vi /etc/oratab
orcl:/u01/app/oracle/product/19.3.0/dbhome_1:Y
如果你需要:
可以直接告诉我你的 Linux 版本 + Oracle 版本 + 是否图形界面。