根据提示修正不符合升级条件的地方。
--purge DBA_RECYCLEBIN; select count(*) from DBA_RECYCLEBIN; purge DBA_RECYCLEBIN; --EXECUTE dbms_stats.gather_dictionary_stats; EXECUTE dbms_stats.gather_dictionary_stats;4.5 升级前确认无效对象数量
select count(*) from dba_objects where status<>'VALID'; 这里是0。 --正常关闭数据库: shutdown immediate4.6 新版本软件对应的环境变量
修改环境变量中指定11.2.0.4,并用source或者重新使用oracle用户登录生效
4.7 新版本软件环境,spfile,密码文件和网络配置相关文件
copy 参数文件spfile, network file「tnsnames.ora listener.ora sqlnet.ora」, 密码文件,
4.8 升级数据库
--upgrade模式打开数据库 SQL> startup UPGRADE SQL> @?/rdbms/admin/catupgrd.sql SQL> startup SQL> @?/rdbms/admin/utlu112s.sql SQL> select count(*) from dba_objects where status<>'VALID'; 460 SQL> @?/rdbms/admin/utlrp.sql 0 SQL> shutdown immediate SQL> startup 5.主库启用归档向备库传输show parameter log_archive_dest_state_X
alter system set log_archive_dest_state_X=enable scope=both sid='*';
备库mount状态下开启日志恢复,等待恢复完成,终止日志恢复然后将数据库在open状态后再开启日志恢复。
--mount状态下开启日志恢复 startup mount alter database recover managed standby database disconnect from session; --等待恢复完成... --取消日志恢复 alter database recover managed standby database cancel; --打开数据库 alter database open; --open状态下开启日志恢复 alter database recover managed standby database using current logfile disconnect from session; 7.检查备库、主库升级情况select ACTION_TIME,ACTION,NAMESPACE,VERSION,ID from registry$history;
select ACTION_TIME,ACTION,NAMESPACE,VERSION,ID from registry$history ACTION_TIME ACTION NAMESPACE VERSION ID --------------------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ ---------- 08-FEB-17 03.39.36.894771 AM VIEW INVALIDATE 8289601 08-FEB-17 03.39.36.926136 AM UPGRADE SERVER 11.2.0.4.0 8.定时任务检查修正