Redhat7。x从11。2。0。4升级到18。0。0(DBUA)
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资源配置:[root@18c ~]# 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.zipDBCA安装数据库软件
只安装数据库软件
如果是单实例则选择第一个
选择企业版
修改为新的ORACLE_BASE目录
默认
安装前检查,内存不符合要求。18c建议的内存为8G
正在安装
执行root.sh脚本
升级前检查运行检查脚本
脚本可以从MOS(ID 884522.1)中下载,也可以在新的$ORACLE_HOME/rdbms/admin/中找到,直接在源库上运行即可,然后根据检查结果修改即可。在源库上执行脚本检查[oracle@cndba 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执行修复脚本
会自动修复不满足升级条件的问题,如果有没有修复的问题需要手动去修复。SQL> @/u01/app/oracle/cfgtoollogs/orcl/preupgrade/preupgrade_fixups.sql Executing Oracle PRE-Upgrade Fixup Script Auto-Generated by: Oracle Preupgrade Script Version: 18.0.0.0.0 Build: 1 Generated on: 2018-07-10 15:01:33 For Source Database: ORCL Source Database Version: 11.2.0.3.0 For Upgrade to Version: 18.0.0.0.0 Preup Preupgrade Action Issue Is Number Preupgrade Check Name Remedied Further DBA Action ------ ------------------------ ---------- -------------------------------- 1. min_recovery_area_size NO Manual fixup required. 2. parameter_min_val NO Manual fixup recommended. 3. em_present NO Manual fixup recommended. 4. invalid_objects_exist NO Manual fixup recommended. 5. amd_exists NO Manual fixup recommended. 6. apex_manual_upgrade NO Manual fixup recommended. 7. dictionary_stats YES None. 8. trgowner_no_admndbtrg NO Informational only. Further action is optional. 9. pre_fixed_objects YES None. 10. tablespaces_info NO Informational only. Further action is optional. The fixup scripts have been run and resolved what they can. However, there are still issues originally identified by the preupgrade that have not been remedied and are still present in the database. Depending on the severity of the specific issue, and the nature of the issue itself, that could mean that your database is not ready for upgrade. To resolve the outstanding issues, start by reviewing the preupgrade_fixups.sql and searching it for the name of the failed CHECK NAME or Preupgrade Action Number listed above. There you will find the original corresponding diagnostic message from the preupgrade which explains in more detail what still needs to be done. PL/SQL procedure successfully completed.修改DB_RECOVERY_FILE_DEST_SIZEalter system set DB_RECOVERY_FILE_DEST_SIZE=10g scope=spfile;修改processesalter system set processes=300 scope=spfile;移除EMSET ECHO ON; SET SERVEROUTPUT ON; @/u02/app/oracle/product/18.1.0/dbhome_1/rdbms/admin/emremove.sql升级APEX
从18c开始,Oracle不会自动更新APEX组件,需要手动更新。
下载APEX:http://www.oracle.com/technetwork/developer-tools/apex/all-archives-099381.html
要写切换到解压的apex所在的目录下再以sysdba身份登录数据库,执行脚本升级[oracle@cndba apex]$ pwd /software/apex sqlplus / as sysdba SQL > @apexins.sql SYSAUX SYSAUX TEMP /i/
检查APEX版本COL COMP_NAME FORMAT A40 COL STATUS FORMAT A12 SELECT COMP_NAME, STATUS, VERSION FROM DBA_REGISTRY WHERE COMP_NAME="Oracle Application Express"; COMP_NAME STATUS VERSION ---------------------------------------- ------------ -------------------- Oracle Application Express VALID 5.1.4.00.08移除OLAP Catalog
从12c开始,不再支持OLAP Catalog。执行脚本移除@$ORACLE_HOME/olap/admin/catnoamd.sql再次检查SYS/SYSTEM用户下是否有无效对象
由于升级APEX造成有无效对象,但是不是SYS、SYSTEM用户下的无效对象。可以忽略SQL> select owner,object_type,count(*) from dba_objects where status="INVALID" group by owner,object_type order by owner,object_type; OWNER OBJECT_TYPE COUNT(*) ------------------------------ ------------------- ---------- APEX_030200 PACKAGE 1 APEX_030200 PACKAGE BODY 32 APEX_030200 SYNONYM 2 APEX_030200 VIEW 4 SCOTT FUNCTION 1开启归档和闪回
查看是否开启闪回和归档SQL> select log_mode,flashback_on from v$database; LOG_MODE FLASHBACK_ON ------------ ------------------ ARCHIVELOG YES 没有则手动开启归档和闪回。 shutdown immediate; startup mount; alter database archivelog; alter database flashback on;DBUA升级
在升级期间,DBUA会自动运行升级脚本并最小化停机时间。
在先决条件阶段,DBUA运行升级前检查脚本,并使用以下逻辑修改或创建所需的新表空间:如果数据文件是自动扩展的,并且有足够的磁盘空间来扩展,那么DBUA将继续升级。如果数据文件不是自动扩展的,那么DBUA会提示你并使文件自动扩展。如果表空间是自动扩展的,并且MAXSIZE初始化参数需要调整,那么DBUA会提示进行调整,并调整MAXSIZE参数。如果没有足够的磁盘空间来增长,那么DBUA会提示你通过添加更多的数据文件来创建空间。DBUA不会自动添加新的数据文件,因为DBUA无法确定在哪里创建文件。切换到新的ORACLE_HOME下运行dbuacd /u02/app/oracle/product/18.1.0/dbhome_1/bin/ ./dbua
选择要升级的数据库,并输入sysdba用户及密码
dbua再次执行升级前的检查脚本
检查结果,要确保满足升级条件:这里的无效对象是非SYS/SYSTEM用户的是升级APEX造成的。生效一个升级期间会自动修复。
DBUA会检查以下内容:回收站里是否有对象无效对象废弃和不支持的初始化参数时间区域数据文件版本
并行升级:根据CPU的个数来决定并行数,从而加快升级的速度
重新编译无效对象:在升级完成后,Oracle会自动编译无效对象 。如果没有勾选,则需要在升级后手动编译。
更新Time Zone:会更新Time Zone数据文件版本 。如果没有勾选,则手动更新。
创建一个还原点或已有的还原点,如果升级失败可以将数据库还原到原来状态。
创建一个RMAN全库备份或已有的备份。
有自己的备份和恢复策略。
使用之前的监听
这里不配置EM,可根据自己的需要配置
检查升级数据库的概要信息
开始升级,由于是虚拟机,升级更慢
查看组件是否正常
执行脚本utlu122s.sql验证所有组件是否工作正常。
SQL> @$ORACLE_HOME/rdbms/admin/utlu122s.sql
19:30:01 SQL> @$ORACLE_HOME/rdbms/admin/utlu122s.sql
Oracle Database Release 18 Post-Upgrade Status Tool 07-10-2018 19:30:0
Component Current Full Elapsed Time
Name Status Version HH:MM:SS
Oracle Server VALID 18.1.0.0.0 00:28:06
JServer JAVA Virtual Machine VALID 18.1.0.0.0 00:06:31
Oracle XDK VALID 18.1.0.0.0 00:00:55
Oracle Database Java Packages VALID 18.1.0.0.0 00:00:27
OLAP Analytic Workspace VALID 18.1.0.0.0 00:00:49
Oracle Text VALID 18.1.0.0.0 00:01:28
Oracle Workspace Manager VALID 18.1.0.0.0 00:02:00
Oracle Real Application Clusters OPTION OFF 18.1.0.0.0 00:00:00
Oracle XML Database VALID 18.1.0.0.0 00:03:43
Oracle Multimedia VALID 18.1.0.0.0 00:03:12
Spatial VALID 18.1.0.0.0 00:07:48
Oracle OLAP API VALID 18.1.0.0.0 00:00:37
Upgrade Datapatch 00:00:21
Final Actions 00:04:56
Post Upgrade 00:00:43
Post Upgrade Datapatch 00:00:14
Post Compile 00:25:19
Total Upgrade Time: 01:27:43
Database time zone version is 14. It is older than current release time
zone version 31. Time zone upgrade is needed using the DBMS_DST package.
Summary Report File = /u02/app/oracle/product/18.1.0/dbhome_1/cfgtoollogs/orcl/upgrade20180710171739/upg_summary.log
可以看到都正常。查看无效对象
SQL> select owner,object_type,count(*) from dba_objects where status="INVALID" group by owner,object_type order by owner,object_type;
OWNER OBJECT_TYPE COUNT(*)
--------------------- ----------------------------------- -------------------
APEX_050100 PACKAGE BODY 2
SCOTT FUNCTION 1
2 rows selected.
苹果M2芯片相较于M1,做了哪些改进?来源内容由半导体行业观察(IDicbank)编译自macworld,谢谢。M2为苹果推出另一系列成功的Mac和ipad奠定了基础,但这并不是革命性的改变。M1是一个很棒的芯片。它本
对于唐山事件,一政法大学男生发表奇谈怪论,简直了鲁迅先生在纪念刘和珍君中说过一句话我向来是不惮以最坏的恶意,来推测人的,然而我还不料,也不信竟会凶残到这地步。总有一些恶,是我们想不到的,比如唐山打人事件。说实话,那个视频我看了一
我们还能放心生活在阳光下吗?唐山那个打人视频让人看的头皮发麻。你在夜市上吃着烤串喝着啤酒,然后就被隔壁桌上的人给打了,劈头盖脸挨了十几个啤洒瓶子,一个人打你还不够,一桌人一起上一起打,不只是你挨打你同桌的人也
人老了,及时在三事上给予儿女帮助文夏莫01卷首语父母的怀抱,对于儿女而言,就像是一个小小的房子。虽然父母已经老去,但是一直在那里,静静地等待。只要子女们需要,大门就会随时敞开,等待他们归来。人生路上,做父母的总是
王心凌,重生了01童年女神昨天的520,因为有浪姐3和周杰伦演唱会重映,直接把不少人带回童年。姐姐们的初舞台还有宁静和那英的明争暗斗,真的太好看了!现在,我对这季浪姐,充满期待。还有几位童年女神
直播间里的明星,吃相越来越难看明星直播带货,早已不是新鲜事。可明星在直播间的吃相,越来越难看。今年年初,体育明星孙杨在直播间的奇葩行为,受到一众网友的嘲讽。在一场谁先开口谁就输的沉浸式直播中,直播间粉丝每达到一
一首集自然美和人文美于一体的民歌八百里洞庭我的家为歌而赞文李纪圣湖南民歌八百里洞庭我的家是八十年代创作的民歌,由石煌远作词,杨歌阳作曲,李琼演唱。最早听这首歌,我是在湖南某部服役,有一天从收音机里收听到这首民歌。当时给人耳目一新
近两年5名省部级大老虎因受贿数亿元被判死缓,看看都是谁?综合中纪委最高检网站消息,近两年多来,先后有5名省部级领导以受贿罪被判死缓,有的还被判终身监禁,不得减刑假释这名涉案大老虎受贿数额巨大,少则2亿元多则7亿多元,可谓贪得无厌罪大恶极
唐山烧烤店打人事件不要低估人心的恶,但也请相信人性的善导语唐山烧烤店打人事件轰动一时,引起了千万人关注。可恶的渣男骚扰女子不成还动手打人,以多欺少可怜的女孩们丝毫没有还手的能力,被打成重伤住进医院。好在天网恢恢疏而不漏,法律不会放过任
上映首日票房破亿,被侏罗纪世界3轰炸两小时,智商被侮辱时隔103天,中国内地电影市场单日大盘终于破亿!侏罗纪世界3几乎凭一己之力撑起了上升曲线!猫眼预测侏罗纪世界3内地总票房10亿,几乎能无悬念超越神奇动物3新蝙蝠侠成为今年7月前票房
断供后市值减少上万亿?苹果对此表态,自己或许没有那么重要引言资本在退出俄方市场时,有很大一部分因素是当地的经济状态较差,已经无法维持资本的正常运作,苹果公司在退出俄方市场时的想法也是如此。苹果公司为了迅速地从俄方市场中退出所选择的是一种