在CentOS系统上安装Oracle数据库是一个复杂的过程,涉及多个步骤和配置。以下是一个详细的指南,帮助你在CentOS系统上成功安装和配置Oracle数据库。
系统及安装包:
环境配置:
yum -y install binutils* compat-libcap1* compat-libstdc++* gcc* gcc-c++* glibc* glibc-devel* ksh* libaio* libaio-devel* libgcc* libstdc++* libstdc++-devel* libXi* libXtst* make* sysstat* elfutils* unixODBC*
groupadd oinstall
groupadd dba
useradd -g oinstall -g dba -d /data/oracle -m oracle
passwd oracle
mkdir -p /data/oracle
mkdir -p /data/oraInventory
mkdir -p /data/database
修改操作系统标识:
hostnamectl set-hostname redhat-7
systemctl stop firewalld.service
systemctl disable firewalld.service
sed -i.bak '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
vi /etc/sysctl.conf
加入以下内容:vm.swappiness = 10
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_tw_buckets = 20000
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.ip_local_port_range = 9000 65500
net.core.somaxconn = 65535
net.core.netdev_max_backlog = 262144
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
使配置修改内核的参数生效:sysctl -p
配置用户的环境变量:
/etc/security/limits.conf:vi /etc/security/limits.conf
加入以下内容:oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
vi /data/oracle/.bash_profile
加入以下内容:export ORACLE_BASE=/data/oracle
export ORACLE_HOME=/data/oracle/product/11.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export LANG=en_US.UTF-8
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
使配置生效:source /data/oracle/.bash_profile
安装Oracle数据库:
unzip p13390677_112040_linux-x86-64_1of7.zip -d /data/src/
unzip p13390677_112040_linux-x86-64_2of7.zip -d /data/src/
netca
dbca
启动数据库服务:
sudo systemctl start oracle -database -preinstallsudo systemctl start oracle -database -ee -19 c
sudo systemctl enable oracle-database-preinstallsudo systemctl enable oracle-database-ee-19c
验证安装:
sqlplus / as sysdba
请注意,上述步骤可能需要根据具体的Oracle版本和系统配置进行调整。建议在安装前详细阅读Oracle官方文档,并确保所有依赖包已正确安装。