下面按从零开始的思路,给你一份在 Linux 上配置 Oracle 数据库的通用流程(以 Oracle 19c / Oracle 21c 为例,适用于 CentOS / RHEL / Oracle Linux)。
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 = 1073741824
net.ipv4.ip_local_port_range = 9000 65500
生效:
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-libcap1 gcc gcc-c++ \
glibc glibc-devel ksh libaio libaio-devel \
libX11 libXau libXi libXtst make sysstat
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
编辑 ~oracle/.bash_profile:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl
source ~/.bash_profile
./runInstaller
(图形界面或静默安装)
dbca
CREATE DATABASE orcl
USER SYS IDENTIFIED BY password
USER SYSTEM IDENTIFIED BY password;
lsnrctl start
sqlplus / as sysdba
SQL> startup
sqlplus system/password@orcl
/u01/app/oracle/product/.../network/admin/listener.oraNLS_LANG如果你告诉我:
我可以给你更精确的一步一步命令版配置。