/mnt/dbinstall 安装目录
/mnt/dbapp 程序目录
/mnt/dbdata 数据目录
一、关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
二、关闭SELINUX
vi /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
:wq #保存,关闭。
sestatus -v
三、查看系统信息
grep SwapTotal /proc/meminfo 查看内存和交换空间
uname -m 查询系统位数
四、Oracle12c
1、rpm -q binutils compat-libcap1 compat-libstdc+±33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc+±devel libXext libXtst libX11 libXau libxcb libXi make sysstat
2、yum install binutils compat-libcap1 compat-libstdc+±33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc+±devel libXext libXtst libX11 libXau libxcb libXi make sysstat
3、groupadd oinstall
4、groupadd dba
5、useradd -g oinstall -G dba oracle
6、passwd oracle
7、chown -R oracle:oinstall /mnt/
8、chmod -R 775 /mnt/
9、vi /etc/sysctl.conf 加入
kernel.shmall = 4294967296
kernel.shmmax = 68719476736
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 32768 61000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.file-max=6815744
fs.aio-max-nr=1048576
10、sysctl -p
11、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
oracle hard stack 10240
session required pam_limits.so
12、# su - oracle
$vi .bash_profile 加入
TMP=/tmp; export TMP
TMPDIR= T M P ; e x p o r t T M P D I R O R A C L E B A S E = / m n t / d b d a t a ; e x p o r t O R A C L E B A S E O R A C L E H O M E = TMP; export TMPDIR ORACLE_BASE=/mnt/dbdata; export ORACLE_BASE ORACLE_HOME= TMP;exportTMPDIRORACLEBASE=/mnt/dbdata;exportORACLEBASEORACLEHOME=ORACLE_BASE/product/12.1.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin: P A T H ; e x p o r t P A T H P A T H = PATH; export PATH PATH= PATH;exportPATHPATH=ORACLE_HOME/bin: P A T H ; e x p o r t P A T H L D L I B R A R Y P A T H = PATH; export PATH LD_LIBRARY_PATH= PATH;exportPATHLDLIBRARYPATH=ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH= O R A C L E H O M E / J R E : ORACLE_HOME/JRE: ORACLEHOME/JRE:ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
export ORACLE_BASE=/mnt/dbdata
export ORACLE_HOME= O R A C L E B A S E / p r o d u c t e x p o r t O R A C L E S I D = o r c l e x p o r t P A T H = ORACLE_BASE/product export ORACLE_SID=orcl export PATH= ORACLEBASE/productexportORACLESID=orclexportPATH=PATH: H O M E / b i n : HOME/bin: HOME/bin:ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export LANG=en_US
if [ $USER = “oracle” ];then
if [ $SHELL = “/bin/ksh” ];then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
$ source .bash_profile
13./mnt/dbinstall/runInstall.sh
14.按照提示安装,中途需切换root用户执行sh
15.启动问题
cd /mnt/dbapp/admin/orcl/pfile/
cp init.ora.XXX /mnt/dbapp/product/12.1.0/db_1/dbs/
mv init.ora.XXX initORCL.ora
cp initORCL.ora initorcl.ora
16.乱码
vi /etc/profile 在文件最后添加
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
17.启动
vi /etc/oratab
orcl:/mnt/orcl/oracle/product/12.1.0/dbhome_1:N”,改为“orcl:/mnt/orcl/oracle/product/12.1.0/dbhome_1:Y”
在/etc/rc.d/rc.local中加入如下语句即可实现同系统启动实例:
su - oracle -c “lsnrctl start”
su - oracle -c “dbstart”