一、安装前准备
1、使用root用户登录修改机器名,重启生效
vi /etc/sysconfig/network
修改hosts
2、使用root用户登录创建用户组和oracle用户
添加用户组:groupadd oinstall
创建用户:useradd -g oinstall -d /oracle oracle
修改密码:passwd oracle
3、切换到oracle用户创建安装目录
cd /oracle
mkdir software(安装介质目录)
mkdir fmwhome(产品安装路径)
mkdir -p /oracle/app/oracle/product/12.2.0/dbhome_1
mkdir -p /oracle/app/oradata
chown -R oracle:oinstall /oracle/
4、切换root用户修改用户的SHELL的限制,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
5、修改Linux内核vi /etc/sysctl.conf
修改内容如下:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
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
6、执行/sbin/sysctl -p
7、设置oracle用户的环境变量:
#vi .bash_profile
--将如下代码添加到.bash_profile文件中:
# Oracle Settings
umask 022
export TMP=/tmp;
export TMPDIR=$TMP;
export ORACLE_BASE=/oracle/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1;
export ORACLE_SID=orclpdb;
export ORACLE_TERM=xterm;
export PATH=/usr/sbin:$PATH;
export PATH=$ORACLE_HOME/bin:$PATH;
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;
export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;
执行source /oracle/.bash_profile
8、上传安装介质
9、解压unzip
二、安装数据库
1、执行./runInstaller
2、安装依赖包
根据报出来的缺失依赖包内容,安装依赖包
上传rpm包
切换root用户,执行mount -o loop rhel-server-7.5-x86_64-dvd.iso /mnt
cd /mnt/Packages
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
rpm -ivh libstdc++-devel-4.4.7-4.el6.x86_64.rpm
rpm -ivh gcc-c++-4.4.7-4.el6.x86_64.rpm
rpm -ivh ksh-20120801-10.el6.x86_64.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
3、执行orainstRoot.sh和root.sh
三、dbca建库
1、oracle用户执行dbca
四、netca配置监听
1、oracle用户执行netca
[oracle@soadev Desktop]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Mar 6 06:20:25 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select name,cdb from v$database;
NAME CDB
--------- ---
ORCLPDB YES
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB01 READ WRITE NO