环境说明
操作系统: CentOS Linux release 7.4.1708 (Core) 数据库版本: IP地址:10.1.3.19主机名: db100103019CPU: 2核 内存:4G 硬盘:30G
1.1 配置hosts
# vim /etc/hosts10.1.3.19 db100103019
1.2 安装依赖包
# yum -y install wget binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 ibXext ibXext.i686 libX11 libX11.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat smartmontools
1.3 修改内核参数
# vim /etc/sysctl.conf net.ipv4.tcp_timestamps = 0net.ipv4.tcp_sack =1net.ipv4.tcp_window_scaling = 1fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 4101144576kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576net.ipv4.tcp_fin_timeout = 15net.ipv4.tcp_keepalive_time = 120net.ipv4.tcp_keepalive_intvl = 2net.ipv4.tcp_keepalive_probes = 1net.ipv4.tcp_syncookies = 1net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1vm.overcommit_memory = 1vm.swappiness = 0kernel.watchdog_thresh=30执行/sbin/sysctl -p 立即生效
1.4 修改limit
# vim /etc/security/limits.conf * hard nofile 65536 * soft nofile 65536 * hard nproc 32767 * soft nproc 32767 * soft core unlimited * hard core unlimited oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 oracle hard stack 32768
# vim /etc/security/limits.d/20-nproc.conf * soft nproc unlimited root soft nproc unlimited
1.5 修改selinux
# vim /etc/selinux/config SELINUX=disabled
1.6 关闭防火墙
# systemctl stop firewalled# systemctl disable firewalld
1.7 创建用户、组及密码
groupadd oinstallgroupadd dbagroupadd operuseradd -g oinstall -G dba,oper oracleecho "oracle"|passwd --stdin oracle
1.8 创建目录并授权
mkdir -p /opt/oracle/product/12.2.0.1/db_1mkdir -p /data/oradatamkdir -p /opt/oraInventorymkdir /data/archivelogchown oracle. /opt/oracle/ /data/oradata/ /data/archivelog/ /opt/oraInventory -R
1.9 配置环境变量
# su - oracle$ vim .bash_profile umask 022export ORACLE_BASE=/opt/oracleexport ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1export ORACLE_SID=oradbexport PATH=$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATHexport NLS_LANG=AMERICAN_AMERICA.AL32UTF8$ source .bash_profile
1.10 vnc安装配置
# yum -y install tigervnc-server# su - oracle$ vncserver :1You will require a password to access your desktops.Password:Verify:Would you like to enter a view-only password (y/n)? yPassword:Verify:xauth: file /home/oracle/.Xauthority does not existNew ‘db100103019:1 (oracle)‘ desktop is db100103019:1Creating default startup script /home/oracle/.vnc/xstartupCreating default config /home/oracle/.vnc/configStarting applications specified in /home/oracle/.vnc/xstartupLog file is /home/oracle/.vnc/db100103019:1.log使用vnc客户端连接
软件下载,去官网下载软件
https://www.oracle.com/downloads/
将下载好的软件linuxx64_12201_database.zip 上传到/data/soft目录下,解压并授权给oracle
# ls -al linuxx64_12201_database.zip # unzip linuxx64_12201_database.zip # chown -R oracle. database/