标签:headers nscd bash 还需 mys usr date uri lock
安装红帽oracle12c(自动配置)
安装/配置环境
[root@bogon ~]# wget http://yum.oracle.com/public-yum-ol7.repo
[root@bogon ~]# mv public-yum-ol7.repo /etc/yum.repos.d/
[root@bogon ~]# wget http://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
[root@localhost yum.repos.d]# yum install oracle-database-server-12cR2-preinstall.x86_64 --nogpgcheck
[root@hailiang ~]# vi /etc/sysctl.conf
#加入#
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
[root@localhost yum.repos.d]# /sbin/sysctl -p
[root@localhost yum.repos.d]# vi /etc/security/limits.d/oracle-database-server-12cR2-preinstall.conf
#加入#
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
[root@localhost home]# vi /etc/pam.d/login
#加入#
session required pam_limits.so
[root@knight01 ~]# vi /etc/hosts
192.168.214.142 knight01
[root@knight01 ~]# vi /etc/selinux/config
#修改#
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
[root@localhost yum.repos.d]# yum -y install binutils elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel kernel-headers ksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel pdksh compat-libcap1 libXext* libXtst* libX11* libXau* libxcb* libXi* nscd* libXp* xorg* xterm* unzip* readline* compat*
如果安装Oracle12cR1版本,还需安装
yum install gcc -y
yum install gcc-c++ -y
yum install libXext -y
yum install libXext.i686 -y
yum install zlib-devel -y
yum install zlib-devel.i686 -y
OEL6版本,还需安装
yum install e2fsprogs -y
yum install e2fsprogs-libs -y
yum install libs -y
yum install libxcb.i686 -y
yum install libxcb -y
创建用户/目录
groupadd -g 2000 oinstall
groupadd -g 2300 dba
groupadd -g 2301 oper
useradd -m -u 1101 -g oinstall -G dba,oper -d /home/oracle -s /bin/bash -c "Oracle Software Owner" oracle
passwd oracle
[root@localhost home]# ls -lR /u01
mkdir -p /u01/app/oracle/product/12.2.0.1/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
关闭防火墙
[root@localhost home]# systemctl stop firewalld
[root@localhost home]# systemctl disable firewalld
设置环境变量
[oracle@localhost ~]$ vi .bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1
export ORACLE_SID=VDEDU
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$PATH
export PATH=/u01/app/ogg:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=/u01/app/oracle:$ORACLE_HOME/lib:/lib:/usr/lib:$LD_LIBRARY_PATH
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export LANG=C
export ORACLE_UNQNAME=knight
安装oracle
#传安装包#
[root@knight01 /]# unzip linuxx64_12201_database.zip
[root@knight01 /]# chown mysql:mysql -R database
#解决X11问题#
[root@knight01 yum.repos.d]# export DISPLAY=:0.0
[root@knight01 yum.repos.d]# xhost +
[oracle@knight01 ~]$ export DISPLAY=:0.0
[oracle@knight01 ~]$ xhost +
[oracle@knight01 database]# ./runInstaller
netca #注销在oracle用户下#
dbca
export DISPALY=:0.0
标签:headers nscd bash 还需 mys usr date uri lock
原文地址:https://www.cnblogs.com/Knight7971/p/9507692.html