Oracle12C升级到18C
Oracle 12C 升级 到 18C
公司主营业务:成都网站制作、网站建设、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联建站是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联建站推出博乐免费做网站回馈大家。
一:版本检查
二: 准备18C 安装包
三:创建目录
四:安装Oracle 软件
五:升级前检查
六:升级
七:验证
八:问题
环境说明:
OS:Red Hat Enterprise Linux Server release 7.5 (Maipo)
DB:Oracle 12.2.0.1.0 升级到 Oracle 18.3.0.0
一:版本检测 Oracle DB 18c - 手动升级到 Non-CDB Oracle Database 18c 的完整核对清单 (Doc ID 2469647.1)
二 : 准备 18C 安装包
--- LINUX.X64_180000_db_home.zip
[root@cjcos package]# pwd
/package
[root@cjcos package]# ll -rth
total 7.5G
drwxr-xr-x. 2 oracle oinstall 42 Jan 16 12:05 Oracle_1903_for_Linux
-rw-r--r-- 1 oracle oinstall 3.3G Jan 19 10:36 linuxx64_12201_database.zip
-rw-r--r-- 1 oracle oinstall 4.3G Jan 19 10:55 LINUX.X64_180000_db_home.zip
三 :创建目录
[root@cjcos yum.repos.d]# mkdir -p /u01/app/oracle 18
[root@cjcos yum.repos.d]# chown -R oracle:oinstall /u01/app/oracle 18
[root@cjcos yum.repos.d]# chmod -R 775 /u01/app
[root@cjcos yum.repos.d]# su - oracle
[oracle@cjcos ~]$ mkdir -p /u01/app/oracle 18 /product/1 8 .0.0/dbhome_1
[oracle@cjcos ~]$ cd /u01/app/oracle 18 /product/1 8 .0.0/dbhome_1
四:安装Oracle 软件
[oracle@cjcos dbhome_1]$ pwd
/u01/app/oracle18/product/18.0.0/dbhome_1
[oracle@cjcos dbhome_1]$ unzip -q /package/LINUX.X64_180000_db_home.zip
[root@cjcos ~]# xhost +
access control disabled, clients can connect from any host
[oracle@cjcos dbhome_1]$ cd /package/database/
[oracle@cjcos database]$ ./runInstaller
[root@cjcos ~]# /u01/app/oracle18/product/18.0.0/dbhome_1/root.sh
五:升级前检查
停机扩大内存到10G
[ root@cjcos ~]# free -m
total used free shared buff/cache available
Mem: 9740 335 9088 9 317 9318
Swap: 4991 0 4991
[oracle@cjcos ~]$ export ORACLE_BASE=/u01/app/oracle12
[oracle@cjcos ~]$ export ORACLE_HOME=$ORACLE_BASE/product/12.0.0/dbhome_1
[oracle@cjcos ~]$ export ORACLE_SID=cjcdb01
[oracle@cjcos ~]$ /u01/app/oracle18/product/18.0.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle18/product/18.0.0/dbhome_1/rdbms/admin/preupgrade.jar
==================
PREUPGRADE SUMMARY
==================
/u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/preupgrade.log
/u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/preupgrade_fixups.sql
/u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/postupgrade_fixups.sql
Execute fixup scripts across the entire CDB:
Before upgrade:
1. Execute preupgrade fixups with the below command
$ORACLE_HOME/perl/bin/perl -I$ORACLE_HOME/perl/lib -I$ORACLE_HOME/rdbms/admin $ORACLE_HOME/rdbms/admin/catcon.pl -l /u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/ -b preup_cjcdb01 /u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/preupgrade_fixups.sql
2. Review logs under /u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/
After the upgrade:
1. Execute postupgrade fixups with the below command
$ORACLE_HOME/perl/bin/perl -I$ORACLE_HOME/perl/lib -I$ORACLE_HOME/rdbms/admin $ORACLE_HOME/rdbms/admin/catcon.pl -l /u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/ -b postup_cjcdb01 /u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/postupgrade_fixups.sql
2. Review logs under /u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade/
Preupgrade complete: 2020-01-19T14:58:18
[oracle@cjcos preupgrade]$ vi preupgrade.log
[oracle@cjcos preupgrade]$ pwd
/u01/app/oracle12/cfgtoollogs/cjcdb01/preupgrade
[oracle@cjcos preupgrade]$ vim preupgrade.log
六:升级
[oracle@cjcos ~]$ cd /u01/app/oracle18/product/18.0.0/dbhome_1/bin/
[oracle@cjcos bin]$ ./dbua
SQL> conn / as sysdba
SQL> EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
SQL> alter session set container=cjcpdb01;
SQL> EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
七:验证
设置环境变量
[oracle@cjcos ~]$ vi .bash_profile
export PATH
#export ORACLE_BASE=/u01/app/oracle
#export ORACLE_BASE=/u01/app/oracle12
export ORACLE_BASE=/u01/app/oracle18
#export ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1
#export ORACLE_HOME=$ORACLE_BASE/product/12.0.0/dbhome_1
export ORACLE_HOME=$ORACLE_BASE/product/18.0.0/dbhome_1
#export ORACLE_SID=cjcdb
export ORACLE_SID=cjcdb01
# export ORACLE_SID=cjcdb02
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
[oracle@cjcos ~]$ source .bash_profile
监听状态
[oracle@cjcos ~]$ lsnrctl status
[oracle@cjcos admin]$ pwd
/u01/app/oracle12/product/12.0.0/dbhome_1/network/admin
[oracle@cjcos admin]$ vim tnsnames.ora
八:问题
一开始在Oracle Linux Server release 6.3 系统上,将11.2.0.4.0升级到12.2.0.1.0正常,再将12.2.0.1.0升级到18.3.0.0.0时,升级任务到70%,会报错 ORA-03114:
root@cjc cjcdb]# pwd
/u01/app/oracle18/cfgtoollogs/dbua/upgrade2020-01-16_10-06-36AM/cjcdb
[root@cjc cjcdb]# vim catupgrdcjcpdb0.log
尝试手动升级PDB :
[oracle@cjc ~]$ source .bash_profile
[oracle@cjc ~]$ $ORACLE_HOME/bin/dbupgrade -c cjcpdb
报错如下:
CJCPDB(3):Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x4] [PC:0x599B586, joevm_invokevirtual()+1414] [flags: 0x0, count: 1]
2020-01-16T14:49:57.835919+08:00
Errors in file /u01/app/oracle18/diag/rdbms/cjcdb/cjcdb/trace/cjcdb_ora_1102.trc (incident=14465) (PDBNAME=CJCPDB):
ORA-07445: exception encountered: core dump [joevm_invokevirtual()+1414] [SIGSEGV] [ADDR:0x4] [PC:0x599B586] [Address not mapped to object] []
CJCPDB(3):Incident details in: /u01/app/oracle18/diag/rdbms/cjcdb/cjcdb/incident/incdir_14465/cjcdb_ora_1102_i14465.trc
CJCPDB(3):Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
2020-01-16T14:50:09.995817+08:00
Dumping diagnostic data in directory=[cdmp_20200116145009], requested by (instance=1, osid=1102), summary=[incident=14465].
尝试重启PDB :
解决方案:
尝试多次安装均出现相同的问题,怀疑和操作系统版本过低,或操作系统内存过低有关,更换操作系统版本 Red Hat Enterprise Linux Server release 7.5 (Maipo) 并将内存由 4G 调大到 10G ,再次执行升级问题消失;
欢迎关注我的微信公众号"IT小Chen",共同学习,共同成长!!!
新闻标题:Oracle12C升级到18C
新闻来源:http://myzitong.com/article/joddse.html