场景:
在Linux7.5版本上安装Oracle11g数据库(单机版)。
1。新建安装用户、用户组
# groupadd oinstall
# useradd -g oinstall oracle
# echo Ser@0322 | passwd --stdin oracle
2。安装依赖包
yum install -y cpp* compat-libstdc++-33* gcc-* gcc-c++* glibc-* compat-libcap* glibc-* ntp kmod-oracleasm smartmontools python-rtslib \
python-configshell glibc-devel-* ksh libgcc-* libstdc++-* libstdc++-devel-* libaio-* libaio-devel-* make-* sysstat-* binutils-* elfutils-libelf-devel-* \
targetcli nfs-utils net-tools vim sg3* redhat-lsb device-mapper* lvm* unzip telnet* dstat iotop vixie-cron xterm xorg-x11-apps
rpm -ivh /soft/compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
rpm -ivh /soft/cvuqdisk-1.0.10-1.rpm
rpm -ivh /soft/rlwrap-0.42-1.el6.x86_64.rpm
rpm -ivh /soft/oracleasmlib-2.0.12-1.el7.x86_64.rpm
rpm -ivh /soft/oracleasm-support-2.1.11-2.el7.x86_64.rpm
3。配置网络环境
# hostname orcl.us.oracle.com
# vi /etc/sysconfig/network
# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=orcl.us.oracle.com
配置hosts文件
# cat /etc/hosts
127...1 localhost.localdomain localhost
192.168.43.160 orcl.us.oracle.com orcl
4。PAM模块参数配置
# vim /etc/security/limits.conf
末尾添加以下内容:
oracle soft nofile 131072
oracle hard nofile 131072
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft stack 10240
oracle hard stack 32768
oracle soft core unlimited
oracle hard core unlimited
oracle soft memlock unlimited
oracle hard memlock unlimited
# echo "session required pam_limits.so" >> /etc/pam.d/login
修改Linux内核参数
export MEM_SIZE=`free -m | grep Mem | awk '{print $2}'`
export SHMMAX=$((MEM_SIZE*1024*1024*7/10))
export SHMALL=$((SHMMAX/4096))
cat>>/etc/sysctl.conf<<EOF
kernel.msgmni = 2878
kernel.msgmnb = 65536
kernel.shmmax = $SHMMAX
kernel.shmall = $SHMALL
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 4194304
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
vm.min_free_kbytes = 524288
vm.swappiness = 10
vm.dirty_background_ratio = 3
vm.dirty_ratio = 80
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
net.ipv4.ipfrag_high_thresh = 16777216
net.ipv4.ipfrag_low_thresh = 15728640
kernel.randomize_va_space =
kernel.panic_on_oops = 1
EOF
sysctl -p
5。其他注意事项
关闭Selinux
# vim /etc/selinux/config
SELINUX=disabled
# setenforce 0
关闭防火墙
# systemctl stop firewalld.service
# systemctl disable firewalld.service
6。初始化安装目录
# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01
7。配置Oracle用户环境变量
# cat .bash_profile
输出内容如下:
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
编辑好.bash_profile文件后,重新加载以下,使修改后的内容生效
# source .bash_profile
8。使用root用户在根目录下创建文件夹 /soft/ 并将Oracle相关介质上传到该目录。
# mkdir /soft/
# chmod 777 /soft/* (上传介质之后,修改权限)
# ls /soft
p13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86-64_2of7.zip
1。开始安装
使用Oracle用户通过XStart工具远程连接Linux服务器,解压Oracle安装介质,指令如下:
# cd /soft
# unzip linux.x64_11gR2_database_1of2.zip
# unzip linux.x64_11gR2_database_2of2.zip
# ls
database p13390677_112040_Linux-x86-64_1of7.zip p13390677_112040_Linux-x86-64_2of7.zip
# cd database
# ./runInstaller (执行该指令后,稍等片刻,便可以加载出Oracle安装界面)
使用root账号执行如下弹出的脚本。执行过后,点击OK