安装12.2.0.1单实例
1. 系统配置
系统版本
cat /etc/redhat-release
#CentOS Linux release 7.4.1708 (Core)
cat /etc/issue Oracle
RPM安装
#安装12C需要linux7安装的rpm
bc
binutils-2.23.52.0.1-12.el7 (x86_64)
compat-libcap1-1.10-3.el7 (x86_64)
compat-libstdc++-33-3.2.3-71.el7 (i686)
compat-libstdc++-33-3.2.3-71.el7 (x86_64)
glibc-2.17-36.el7 (i686)
glibc-2.17-36.el7 (x86_64)
glibc-devel-2.17-36.el7 (i686)
glibc-devel-2.17-36.el7 (x86_64)
ksh
libaio-0.3.109-9.el7 (i686)
libaio-0.3.109-9.el7 (x86_64)
libaio-devel-0.3.109-9.el7 (i686)
libaio-devel-0.3.109-9.el7 (x86_64)
libgcc-4.8.2-3.el7 (i686)
libgcc-4.8.2-3.el7 (x86_64)
libstdc++-4.8.2-3.el7 (i686)
libstdc++-4.8.2-3.el7 (x86_64)
libstdc++-devel-4.8.2-3.el7 (i686)
libstdc++-devel-4.8.2-3.el7 (x86_64)
libxcb-1.9-5.el7 (i686)
libxcb-1.9-5.el7 (x86_64)
libX11-1.6.0-2.1.el7 (i686)
libX11-1.6.0-2.1.el7 (x86_64)
libXau-1.0.8-2.1.el7 (i686)
libXau-1.0.8-2.1.el7 (x86_64)
libXi-1.7.2-1.el7 (i686)
libXi-1.7.2-1.el7 (x86_64)
libXtst-1.2.2-1.el7 (i686)
libXtst-1.2.2-1.el7 (x86_64)
make-3.82-19.el7 (x86_64)
net-tools-2.0-0.17.20131004git.el7 (x86_64) (for Oracle RAC and Oracle
Clusterware)
nfs-utils-1.3.0-0.21.el7.x86_64 (for Oracle ACFS)
smartmontools-6.2-4.el7 (x86_64)
sysstat-10.1.5-1.el7 (x86_64)Oracle Linux 7 for x86_64 Oracle Linux 6和Oracle Linux 7:
--如果是ORACLE_LINUX 7 执行如下命令
yum install oracle-database-server-12cR2-preinstall
--常规Linux系统yum安装
yum -y install compat-libcap1 compat-libstdc++-33 elfutils-libelf-devel gcc gcc-c++ libaio-devel libstdc++-devel unixODBC ksh libX11 libXau libXi libXtst libxcb smartmontools unixODBC-devel
--检测rpm包是否安装
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH}) ' binutils
compat-libcap1
compat-libstdc++-33
e2fsprogs
e2fsprogs-libs
elfutils-libelf
elfutils-libelf-devel
gcc
gcc-c++
glibc
glibc-devel
libaio
libaio-devel
libgcc
libstdc++
libstdc++-devel
make
sysstat
unixODBC
ksh
libX11
libXau
libXi
libXtst
libxcb
smartmontools
unixODBC-devel
net-tools |grep installed
防火墙
[root@fs-3z3-vm0415 bin]# systemctl is-enabled firewalld
disabled
https://www.linuxidc.com/Linux/2017-03/142096.htm
linux 7
sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service
cat /etc/selinux/config
SELINUX=disabled
硬件配置
$ df -h /tmp
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/OS_VG-OS_LV 16G 1.9G 14G 12% /
$ free -g
total used free shared buff/cache available
Mem: 58 50 1 2 7 5
Swap: 14 0 14
hbqzcsrac1:/picclife/app/oracle$ df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 30G 640M 29G 3% /dev/shm
调整Shell资源限制
vi /etc/security/limits.conf
oracle soft nproc 131072
oracle hard nproc 131072
oracle soft nofile 40964
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
oracle soft memlock 26843545
oracle hard memlock 26843545
检查文件描述符设置的软限制和硬限制。确保结果在推荐范围内。例如:>=如下即可
$ ulimit -Sn
1024
$ ulimit -Hn
65536
检查软限制和硬限制,以确定用户可用的进程数。确保结果在推荐范围内。例如:
$ ulimit -Su
2047
$ ulimit -Hu
16384
检查堆栈设置的软限制。确保结果在推荐范围内。例如:
$ ulimit -Ss
10240
$ ulimit -Hs
32768
调整内核参数
<linux 7
vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 20715843020
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
vm.nr_hugepages = 7620
#kernel.shmall
59*1024*1024*1024/4096
15466496
#kernel.shmmax
59*1024*1024*1024
63350767616
#vm.nr_hugepages
45*1024/2 sga 45G
23040
#使修改生效
/sbin/sysctl -p
#确认修改成功
/sbin/sysctl –a
>=7.4 red hat linux
echo "fs.file-max = 6815744
kernel.sem = 10000 10240000 10000 1024
kernel.shmmni = 4096
kernel.shmall = 3932000
kernel.shmmax = 16106127000
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 16777216
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.wmem_default = 16777216
fs.aio-max-nr = 6194304
vm.dirty_ratio=20
vm.dirty_background_ratio=3
vm.dirty_writeback_centisecs=100
vm.dirty_expire_centisecs=500
vm.swappiness=10
vm.min_free_kbytes=524288
net.core.netdev_max_backlog = 30000
net.core.netdev_budget = 600
#vm.nr_hugepages =
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2">> /etc/sysctl.d/oracle.conf && sysctl --system
vi /etc/sysconfig/network
hostname=hskf
vi /etc/hostname
HOSTNAME=hskf
vi /etc/hosts
10xxx hskf
创建组
userdel -r oracle
groupdel oinstal
--
groupadd -g 1000 oinstall
groupadd -g 1200 dba
groupadd -g 1201 oper
groupadd -g 1202 backupdba
groupadd -g 1203 dgdba
groupadd -g 1204 kmdba
groupadd -g 1300 asmdba
groupadd -g 1301 asmoper
groupadd -g 1100 asmadmin
groupadd -g 1302 racdba
/usr/sbin/useradd -u 1000 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
passwd oracle
创建安装目录
mkdir -p /picclife/app/oracle
mkdir -p /picclife/app/12.2.0
chown -R oracle:oinstall /picclife
chown oracle:oinstall /picclife/app/oracle
chmod -R 775 /oracle/
chown -R oracle:oinstall /picclife/app/12.2.0
环境变量
su - oracle
vi .bash_profile
ORACLE_BASE=/picclife/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
ORACLE_SID=dev
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
PATH=$PATH:$ORACLE_HOME/bin:$GRID_HOME/bin:/sbin:/usr/sbin:/bin:/usr/local/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH
export NLS_LANG=american_america.ZHS16GBK
export PS1=`hostname`:'$PWD'"$ "
cd $ORACLE_BASE
ORACLE_TERM=xterm; export ORACLE_TERM
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export CLASSPATH
THREADS_FLAG=native; export THREADS_FLAG
export TEMP=/tmp
export TMPDIR=/tmp
umask 022
export PS1=`hostname`:'$PWD'"$ "
cd $ORACLE_BASE
stty erase ^H
软件包
上传软件包,进行解压安装
fs-3z3-vm0432:/picclife/software$ scp root@10.135.100.102:/picclife/software/V839960-01.zip .
unzip 命令未找到
yum -y install unzip
xhost + 命令未找到
yum –y install xorg-x11-server-utils
如果jar没有命令,说明Java包未安装,可以使用yum list Java*查询,本次测试环境x86_64,直接yum install –y xxx后解决。
jar xvf --有时候unzip无法解压>2g的文件,需要使用jar
export display=10.126.86.33:0.0
[root@fs-3z3-vm0432 ~]# xhost +
xhost: unable to open display "
2. 静默安装监听
静默安装监听
tdcxdb1:/picclife/app/grid$ netca -silent -responsefile $ORACLE_HOME/assistants/netca/netca.rsp
set line 200
col name for a20
select con_id, dbid, guid, name , open_mode from v$pdbs;
alter session set container=&PDBNAME;
Alter database open;
--配置tnsnames.ora
复制 修改server_name=pdb_name即可
--创建用户授予权限
Create user xx identified by xxx default tablespace xxx;
Grant connect,resource to xxx;
Grant unlimited tablespace to xx;
grant create table to confluence;
grant create sequence to confluence;
grant create trigger to confluence;