- 执行修复脚本
会自动修复不满足升级条件的问题,如果有没有修复的问题需要手动去修复。
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_SIZE
alter system set DB_RECOVERY_FILE_DEST_SIZE=10g scope=spfile;
- 修改processes
alter system set processes=300 scope=spfile;
- 移除EM
SET 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身份登录数据库,执行脚本升级
[[email protected] 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下运行dbua