Oracle DataGuard 升级 [11.2.0.1(2)

根据提示修正不符合升级条件的地方。

--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 immediate

4.6 新版本软件对应的环境变量
修改环境变量中指定11.2.0.4,并用source或者重新使用oracle用户登录生效

export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME= /u01/app/oracle/product/11.2.0.4/dbhome_1

4.7 新版本软件环境,spfile,密码文件和网络配置相关文件
copy 参数文件spfile, network file「tnsnames.ora listener.ora sqlnet.ora」, 密码文件,

--拷贝参数文件spfile: [oracle@oracle1 ~]$ cp /u01/app/oracle/product/11.2.0/dbs/spfileorcl.ora /u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/ --拷贝密码文件: [oracle@oracle1 ~]$ cp /u01/app/oracle/product/11.2.0/dbs/orapworcl /u01/app/oracle/product/11.2.0.4/dbhome_1/dbs/orapworcl --拷贝网络配置相关文件「tnsnames.ora listener.ora sqlnet.ora」 [oracle@oracle1 ~]$ cp /u01/app/oracle/product/11.2.0/network/admin/*.ora /u01/app/oracle/product/11.2.0.4/dbhome_1/network/admin/ --修正DG listener.ora 中静态监听内容(ORACLE_HOME),然后重启监听文件 SID_LIST_LISTENER= (SID_DESC=(GLOBAL_DBNAME = orcl)(ORACLE_HOME = /u01/app/oracle/product/11.2.0.4/dbhome_1)(SID_NAME = orcl) )

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='*';

alter system set log_archive_dest_state_2=enable scope=both sid='*'; alter system set log_archive_dest_state_3=enable scope=both sid='*'; show parameter log_archive_dest_state_2 show parameter log_archive_dest_state_3 6.备库开启日志恢复

备库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.定时任务检查修正

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/ab73e937a57c092e3ffa408a98b955a9.html