DBUA是Oracle极力推荐使用的升级工具,如果环境允许的话尽量使用DBUA来升级数据库。可以升级CDB,PDB,non-CDB。
安装18c数据库软件
- 新的Oracle环境变量:
ORACLE_BASE=/u02/app/oracle
ORACLE_HOME= /u02/app/oracle/product/18.1.0/dbhome_1
ORACLE_SID=cndba
- 资源配置:
[[email protected] ~]# vim /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 32768
oracle soft memlock 3145728
oracle hard memlock 3145728
- 创建新目录
mkdir -p /u02/app/oracle/product/18.1.0/dbhome_1
chown -R oracle:oinstall /u02
chmod -R 775 /u02/
- 解压18c到新的ORACLE_HOME下
unzip -d /u02/app/oracle/product/18.1.0/dbhome_1 Oracle18.1.0.zip
- DBCA安装数据库软件
只安装数据库软件

如果是单实例则选择第一个

选择企业版

修改为新的ORACLE_BASE目录

默认

安装前检查,内存不符合要求。18c建议的内存为8G

正在安装

执行root.sh脚本

升级前检查
- 运行检查脚本
脚本可以从MOS(ID 884522.1)中下载,也可以在新的$ORACLE_HOME/rdbms/admin/中找到,直接在源库上运行即可,然后根据检查结果修改即可。
- 在源库上执行脚本检查
[[email protected] software]nbsp;/u02/app/oracle/product/18.1.0/dbhome_1/jdk/bin/java -jar /u02/app/oracle/product
/18.1.0/dbhome_1/rdbms/admin/preupgrade.jar
==================
PREUPGRADE SUMMARY
==================
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade.log
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql
/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql
Execute fixup scripts as indicated below:
Before upgrade log into the database and execute the preupgrade fixups
@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql
After the upgrade:
Log into the database and execute the postupgrade fixups
@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql
Preupgrade complete: 2018-07-10T15:01:40
preupgrade.log里记录的是检查的详细信息,有不满足的对象可以通过查看该文件获取。根据提示:在升级前要执行preupgrade_fixups.sql脚本来修复不符合要求的对象。升级后需要执行postupgrade_fixups.sql脚本来修复。
- 下面截取部分日志:
Report generated by Oracle Database Pre-Upgrade Information Tool Version
18.0.0.0.0 on 2018-07-10T15:01:39
Upgrade-To version: 18.0.0.0.0
=======================================
Status of the database prior to upgrade
=======================================
Database Name: ORCL
Container Name: Not Applicable in Pre-12.1 database
Container ID: Not Applicable in Pre-12.1 database
Version: 11.2.0.3.0
Compatible: 11.2.0.0.0
Blocksize: 8192
Platform: Linux x86 64-bit
Timezone File: 14
Database log mode: ARCHIVELOG
Readonly: FALSE
Edition: EE
Oracle Component Upgrade Action Current Status
---------------- -------------- --------------
Oracle Server [to be upgraded] VALID
JServer JAVA Virtual Machine [to be upgraded] VALID
Oracle XDK for Java [to be upgraded] VALID
Oracle Workspace Manager [to be upgraded] VALID
OLAP Analytic Workspace [to be upgraded] VALID
Oracle Enterprise Manager Repository [to be upgraded] VALID
Oracle Text [to be upgraded] VALID
Oracle XML Database [to be upgraded] VALID
Oracle Java Packages [to be upgraded] VALID
Oracle Multimedia [to be upgraded] VALID
Oracle Spatial [to be upgraded] VALID
Expression Filter [to be upgraded] VALID
Rule Manager [to be upgraded] VALID
Oracle OLAP API [to be upgraded] VALID
…..
INFORMATION ONLY
================
14. Check the Oracle documentation for the identified components for their
specific upgrade procedure.
The database upgrade script will not upgrade the following Oracle
components: OLAP Catalog,OWB
The Oracle database upgrade script upgrades most, but not all Oracle
Database components that may be installed. Some components that are not
upgraded may have their own upgrade scripts, or they may be deprecated or
obsolete.
ORACLE GENERATED FIXUP SCRIPT
=============================
All of the issues in database ORCL
which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
executing the following
SQL>@/u01/app/oracle/cfgtoollogs/orcl/preupgrade/postupgrade_fixups.sql