# 10.2.0.1 升級 到 10.2.0.5
环境介绍:
当前Oracle版本:10.2.0.1+数据库
升级Oracle版本:10.2.0.5+数据库
[oracle@XAG140 ~]$ rman target /
RMAN> shutdown immediate;
手工刪除臨時及重做日誌文件
RMAN> startup nomount;
RMAN> set DBID=3165604684 (原DB ID)
RMAN> configure device type sbt_tabe clear;
RMAN> configure channel device type sbt_tabe clear;
RMAN> set decryption identified by 'mpbak00001';
RMAN> restore controlfile from '/u01/app/oracle/flash_recovery_area/MPACC/backupset/2018_08_20/o1_mf_ncsnf_%TAG_fqnw7r93_.bkp';
RMAN> alter database mount;
RMAN> configure device type sbt_tabe clear;
RMAN> configure channel device type sbt_tabe clear;
RMAN> restore database; 【如有read only 表空間則先手工將文件拷貝到對應的目標目錄】; or [全備份用后面詞句] restore database check readonly;
RMAN> recover database; --可選
RMAN> exit;
[oracle@XAG140 ~]$ sqlplus / as sysdba
SQL> recover database using backup controlfile until cancel;
ORA-00279: change 973942 generated at 08/22/2018 15:21:06 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/oradata/MPACC/redo03.log
ORA-00280: change 973942 for thread 1 is in sequence #36
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
Log applied.
Media recovery complete.
SQL>
SQL> recover database using backup controlfile until cancel; #如有新歸檔文件加入則需退出sqlplus 重新登入才可自動識別。
ORA-00279: change 973942 generated at 08/22/2018 15:21:06 needed for thread 1
ORA-00289: suggestion : /u01/app/oracle/oradata/MPACC/redo03.log
ORA-00280: change 973942 for thread 1 is in sequence #36
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> alter database open resetlogs upgrade;
#手工升级库
SQL> SPOOL /home/oracle/update3.log
#重建数据字典
SQL> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catupgrd.sql
SQL> SPOOL OFF
#重建数据字典完成后,重启数据库
SQL> shutdown immediate;
SQL> startup mount;
SQL> alter system set job_queue_processes=0 scope=both;
SQL> show parameter job_queue_processes;
SQL> shutdown immediate;
SQL> startup
#编译无效对象
SQL> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/utlrp.sql
#检查升级后状态
SQL> select count(*) from dba_objects where status<>'VALID';
#查看版本
SQL>select * from v$version;
SQL>select tablespace_name,file_name,bytes/1024/1024mb from dba_temp_files
#最後檢查正常后 啟動job開關
SQL> alter system set job_queue_processes=20 scope=both;
最後 dbca 添加em 插件
#删除OEM的 dbconsole 和repository
[oracle@DB115 ~]$ emca -deconfig dbcontrol db -repos drop
STARTED EMCA at Nov 30, 2018 1:03:03 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: MPEMC
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:
Do you wish to continue? [yes(Y)/no(N)]: yes
#重建EM的dbcontrol 和 repository
[oracle@DB115 ~]$ emca -config dbcontrol db -repos create
STARTED EMCA at Nov 30, 2018 1:46:05 PM
EM Configuration Assistant, Version 10.2.0.1.0 Production
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Enter the following information:
Database SID: MPEMC
Listener port number: 1521
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------
You have specified the following settings
Database ORACLE_HOME ................ /u01/app/oracle/product/10.2.0/db_1
Database hostname ................ DB115
Listener port number ................ 1521
Database SID ................ MPEMC
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............
-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: yes