CentOS7.5 install Oracle12.1 and update

Stella981
• 阅读 299

CentOS7.5 install Oracle12.1 and update
1.1 、 install centos7.5
1.2 、 vi etc/sysctl.conf
add row:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
vm.swappiness = 0
vm.vfs_cache_pressure = 62
# net.core.default_qdisc = fq
# net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1800
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
#### net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
1.3 、 vi etc/security/limits.conf
add row:
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240oracle hard stack 32768
1.4 、 vi etc/pam.d/login
add row:
session required /lib64/security/pam_limits.so
session required pam_limits.so
1.5 、 vi etc/profile
add row:
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
1.6 、 vi etc/hosts
add row:127.0.0.1 oracle12c oracle12c.localdomain
sysctl -p
1.7 、 for group in oinstall dba backupdba oper dgdba kmdba; do
groupadd $group
; done
1.8 、 useradd -g oinstall -G dba,oper,backupdba,dgdba,kmdba -d
/home/oracle -m
oracle
1.9 、 passwd oracle
1.10 、 vi home/oracle/.bash_profile
add row:
export ORACLE_BASE=/opt/oracle #oracle 数据库安装目录
export ORACLE_HOME=$ORACLE_BASE/12c #oracle 数据库
路径
export ORACLE_SID=oracle12c #oracle 启动数据库实例名
export ORACLE_TERM=xtermexport ORACLE_HOSTNAME=oracle12c.localdomain
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
export LANG=C # 防止安装过程出现乱码
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK # 设
置 Oracle 客户端字符集,必须与 Oracle# 安装时设置的字符集保持
一致,如: ZHS16GBK ,否则出现数据导入导出中文乱码问题
1.11 、 mount -B /run/media/birdofprey/CentOS\ 7\ x86_64/ /mnt
1.12 、 cp -r /etc/yum.repos.d/ /etc/yum.repos.d.backup
1.13 、 vi etc/yum.repos.d/CentOS-Base.repo
contents:
[base]
name=CentOS-$releasever - Base
baseurl=file:///mnt
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
1.14 、 yum -y install binutils compat-libstdc++ compat-libstdc++-
33 elfutils-libelf-devel gcc gcc-c++ glibc-devel glibc-headers ksh
libaio-devel libstdc++-devel make sysstat unixODBC-devel
binutils-* compat-libstdc++* elfutils-libelf* glibc* gcc-* libaio*
libgcc* libstdc++* make* sysstat* unixODBC* wget unzip
compat-libcap1.i686 compat-libcap1.x86_64
1.15 、 upload oracle12cinstall.zip
1.16 、 ./runInstaller2、update 12.1
2.1、download zip
p28259833_121020_Linux-x86-64.zip #### Database Patch Set Update 12.1.0.2.181016
p28440711_121020_Linux-x86-64.zip #### OJVM PATCH SET UPDATE 12.1.0.2.181016
p6880880_121010_Linux-x86-64.zip #### OPatch Version: 12.2.0.1.16
2.2、以 oracle 登陆用户,vi .bash_profile :
add row:
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
2.3、mv $ORACLE_HOME/Opatch $ORACLE_HOME/Opatch.backup
2.4、unzip p6880880_121010_Linux-x86-64.zip
2.5、mv Opatch/ $ORACLE_HOME/
2.6、sqlplus / as sysdba
SQL>SHUTDOWN IMMEDIATE;
2.7、lsnrctl stop
2.8、cd <PATCH_TOP_DIR>/28440711
2.9、opatch prereq CheckConflictAgainstOHWithDetail -ph ./ && opatch apply
2.10、cd cd <PATCH_TOP_DIR>28259833 && opatch apply
2.11、sqlplus / as sysdba
SQL>startup;
SQL>alter pluggable database {databasename} open;
SQL>show pdbs;
2.12、cd $ORACLE_HOME/Opatch
2.13、./datapatch -verbose
2.14、shutdown
2.15、startup
2.16、alter pluggable database all open;
2.17、sqlplus / as sysdba
SQL> select comments from dba_registry_history;
COMMENTS
--------------------------------------------------------------------------------
RAN jvmpsu.sql
RDBMS_12.1.0.2.0DBPSU_LINUX.X64_161210
SQL>select * from product_component_version
3、update linux kernel and configure autostart oracle12c
3.1、[oracle@localhost ~]$ vi /lib/systemd/system/oracle-rdbms.service
row:
# /etc/systemd/system/oracle-rdbms.service
# Invoking Oracle scripts to start/shutdown Instances defined in /etc/oratab
# and starts Listener
[Unit]
Description=Oracle Database(s) and Listener
Requires=network.target
[Service]
Type=forking
Restart=no
ExecStart=/opt/oracle/12c/bin/dbstart /opt/oracle/12c ### 按照用户自己的 ORACLE_HOME 编写ExecStop=/opt/oracle/12c/bin/dbshut /opt/oracle/12c ### 按照用户自己的 ORACLE_HOME 编写
User=oracle
[Install]
WantedBy=multi-user.target
# kongxx
# CSDN
# https://blog.csdn.net/kongxx/article/details/82155876
3.2、[oracle@localhost ~]$ systemctl daemon-reload
[oracle@localhost ~]$ systemctl enable oracle-rdbms.service
3.3、[oracle@localhost ~]$ vi /etc/oratab
rewrit:
oracle12c:/opt/oracle/12c:Y
3.4、download linux-kernel package:
kernel-ml-4.18.3-1.el7.elrepo.x86_64.rpm,
kernel-ml-devel-4.18.3-1.el7.elrepo.x86_64.rpm,
kernel-ml-doc-4.18.3-1.el7.elrepo.noarch.rpm,
kernel-ml-headers-4.18.3-1.el7.elrepo.x86_64.rpm,
kernel-ml-tools-4.18.3-1.el7.elrepo.x86_64.rpm,
kernel-ml-tools-libs-4.18.3-1.el7.elrepo.x86_64.rpm,
perf-4.18.3-1.el7.elrepo.x86_64.rpm,
python-perf-4.18.3-1.el7.elrepo.x86_64.rpm
rpm -ivh *.rpm --force –nodeps
cat /boot/grub2/grub.cfg | grep menuentry
menuentry 'CentOS Linux (4.18.3-1.el7.elrepo.x86_64) 7 (Core)'
grub2-set-default "CentOS Linux (4.18.3-1.el7.elrepo.x86_64) 7 (Core)"
grub2-editenv list
4、update oracle12c is archivelog mode and rman dbbackup full database
4.1、sqlplus / as sysdba
SQL>shutdown immediate;
SQL>startup mount;
SQL>alter database archivelog;
SQL>alter database open;
SQL>alter pluggable database oracle12cpdb open;
SQL> select log_mode from v$database;
4.2、rman target /
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
'/opt/oracle/oracle12cdbbackupfull/oracle12c/control%F.bak';
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE 1024 M;
4.3、cd $ORACLE_BASE && mkdir oracle12cdbbackupfull && cd oracle12cdbbackupfull/
vi dbfullbackup.rman
row:
run{
crosscheck backup of database;
delete noprompt backupset;
backup as backupset database
format
'/opt/oracle/oracle12cdbbackupfull/oracle12c/oracle12cdbbackupfull%U_%d_%T_%s_
%p.bak'include current controlfile
plus archivelog format '/opt/oracle/oracle12cdbbackupfull/oracle12c/oracle12carchivelog%U_%d_
%T_%s_%p.bak' delete all input;
report obsolete;
delete noprompt obsolete;
}
4.4、vi oracle12cdbfullbackup.sh
row:
!#/bin/bash
cd /opt/oracle/oracle12cdbbackupfull
rman target / @dbfullbackup.rman
chmod +x oracle12cdbfullbackup.sh
4.5、crontab -e
row:
0
3
*
*
*
/opt/oracle/oracle12cdbbackupfull/oracle12cdbfullbackup.sh
/opt/oracle/oracle12cdbbackupfull/rman.log 2>&1
>

感谢打赏,不论多少,都感激不尽

点赞
收藏
评论区
推荐文章
blmius blmius
1年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Easter79 Easter79
1年前
swap空间的增减方法
(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap
helloworld_34035044 helloworld_34035044
11个月前
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Stella981 Stella981
1年前
Python3:sqlalchemy对mysql数据库操作,非sql语句
Python3:sqlalchemy对mysql数据库操作,非sql语句python3authorlizmdatetime2018020110:00:00coding:utf8'''
Wesley13 Wesley13
1年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Wesley13 Wesley13
1年前
Java爬虫之JSoup使用教程
title:Java爬虫之JSoup使用教程date:201812248:00:000800update:201812248:00:000800author:mecover:https://imgblog.csdnimg.cn/20181224144920712(https://www.oschin
Wesley13 Wesley13
1年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
1年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
1年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
1年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_