【UP_ORACLE】使用AutoUpgrade工具升級Oracle 11.2.0.4至12.2.0.1
說明
AutoUpgrade工具的功能包含了:
1. 升級前識別問題
2. 執行升級前和升級後操作
3. 部署升級
4. 執行升級後操作
5. 自動啟動升級後的 Oracle 資料庫
注:如果ORACLE_HOME裡面包含了autoupgrade.jar,建議下載最新的autoupgrade.jar( 最新的jar包在MOS 2485457.1)。
實驗環境
搭建平臺:VMware Workstation
OS:RHEL 7.6
DB:Oracle 11.2.0.4 & 12.2.0.1
升級步驟
1. 生成config檔案模板
(1)檢查java版本, 需要升級到jdk1.8(linux 7預設版本)
$ java -version openjdk version "1.8.0_161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
(2)生成config檔案模板
$ java -jar ./autoupgrade.jar -create_sample_file config
(3)編輯config檔案
$ cp sample_config.cfg config.cfg $ vi config.cfg global.autoupg_log_dir=/u01/app/oracle/cfgtoollogs/autoupgrade # # Database number 1 - Full DB/CDB upgrade # upg1.log_dir=/u01/app/oracle/cfgtoollogs/autoupgrade/employee # Path of the log directory for the upgrade job upg1.sid=PROD1 # ORACLE_SID of the source DB/CDB upg1.source_home=/u01/app/oracle/product/11.2.0/dbhome_1 # Path of the source ORACLE_HOME upg1.target_home=/u01/app/oracle/product/12.2.0/dbhome_1 # Path of the target ORACLE_HOME upg1.start_time=NOW # Optional. [NOW | +XhYm (X hours, Y minutes after launch) | dd/mm/yyyy hh:mm:ss] upg1.upgrade_node=hhw # Optional. To find out the name of your node, run the hostname utility. Default is ''localhost'' upg1.run_utlrp=yes # Optional. Whether or not to run utlrp after upgrade upg1.timezone_upg=yes # Optional. Whether or not to run the timezone upgrade upg1.target_version=12.2 # Oracle version of the target ORACLE_HOME. Only required when the target Oracle database version is 12.2
2. 執行analyze操作檢查升級的前置條件
$ java -jar autoupgrade.jar -config config.cfg -mode analyze AutoUpgrade is not fully tested on OpenJDK 64-Bit Server VM, Oracle recommends to use Java HotSpot(TM) AutoUpgrade 22.4.220712 launched with default internal options Processing config file ... +--------------------------------+ | Starting AutoUpgrade execution | +--------------------------------+ 1 Non-CDB(s) will be analyzed Type 'help' to list console commands upg> Job 100 completed ------------------- Final Summary -------------------- Number of databases [ 1 ] Jobs finished [1] Jobs failed [0] Please check the summary report at: /u01/app/oracle/cfgtoollogs/autoupgrade/cfgtoollogs/upgrade/auto/status/status.html /u01/app/oracle/cfgtoollogs/autoupgrade/cfgtoollogs/upgrade/auto/status/status.log
檢視生成的status.html是否顯示“SUCCESS”
如果不開啟歸檔,會報錯:
3. 下載並安裝12.2的安裝包並打最新PSU
這一步如果不打PSU,則會報錯:
2022-09-09 09:16:27.452 ERROR Dispatcher failed: 34Error: UPG-1411 35Invalid version /u01/app/oracle/product/12.2.0.1/dbhome_1/rdbms/admin/ of catctl.pl for AutoUpgrade; patch the target home 36Cause: Invalid version of catctl.pl and catctl.pm
此處下載過程過程省略, 下載地址在MOS 2118136.2
注:這裡我用的是檔案系統庫(非ASM),只需下載DB的PSU,如果涉及到GI,則需要下載GI的PSU(裡面包括了DB的PSU)
打PSU過程:
$ su - oracle $ unzip -d $ORACLE_HOME /home/oracle/soft/p6880880_122010_Linux-x86-64.zip $ cd ~/soft/ $ unzip p33587128_122010_Linux-x86-64.zip $ cd 33587128 $ $ORACLE_HOME/OPatch/opatch apply $ $ORACLE_HOME/OPatch/opatch lspatches 33587128;Database Jan 2022 Release Update : 12.2.0.1. 220118 (33587128) OPatch succeeded.
4. 升級到12.2步驟
(1)$ java -jar autoupgrade.jar -config config.txt -mode deploy
注:該命令僅適用於本地升級,異地升級命令見後文。
檢視進度:
upg> lsj +----+-------+---------+---------+-------+--------------+--------+------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE| +----+-------+---------+---------+-------+--------------+--------+------------+ | 100| LHR11G|DBUPGRADE|EXECUTING|RUNNING|22/09/09 09:29|01:02:17|98%Upgraded | +----+-------+---------+---------+-------+--------------+--------+------------+ Total jobs 1
(2)檢視元件升級情況:
SQL > select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry; COMP_ID COMP_NAME VERSION ATUS ---------- ---------------------------------------- --------------- --------------- CATALOG Oracle Database Catalog Views 12.2.0.1.0 UPGRADED CATPROC Oracle Database Packages and Types 12.2.0.1.0 UPGRADED JAVAVM JServer JAVA Virtual Machine 12.2.0.1.0 UPGRADED XML Oracle XDK 12.2.0.1.0 UPGRADED CATJAVA Oracle Database Java Packages 12.2.0.1.0 UPGRADED APS OLAP Analytic Workspace 12.2.0.1.0 UPGRADED XOQ Oracle OLAP API 11.2.0.4.0 VALID OWM Oracle Workspace Manager 12.2.0.1.0 UPGRADED CONTEXT Oracle Text 12.2.0.1.0 UPGRADED XDB Oracle XML Database 12.2.0.1.0 UPGRADED ORDIM Oracle Multimedia 11.2.0.4.0 UPGRADING SDO Spatial 11.2.0.4.0 VALID APEX Oracle Application Express 3.2.1.00.12 VALID
(3)升級完成:
+----+-------+----------+---------+-------+--------------+--------+-------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE| +----+-------+----------+---------+-------+--------------+--------+-------------+ | 100| LHR11G|POSTFIXUPS|EXECUTING|RUNNING|22/09/09 09:29|01:08:19|Remaining 3/4| +----+-------+----------+---------+-------+--------------+--------+-------------+ Total jobs 1 upg> Job 100 completed ------------------- Final Summary -------------------- Number of databases [ 1 ] Jobs finished [1] Jobs failed [0] Jobs pending [0] Please check the summary report at: /home/oracle/cfgtoollogs/upgrade/auto/status/status.html /home/oracle/cfgtoollogs/upgrade/auto/status/status.log
注:
如果是 異機升級(比如用備份恢復到異機),則需要使用如下兩個命令:
1)java -jar autoupgrade.jar -config config.txt -mode fixups
2)java -jar autoupgrade.jar -config config.txt -mode upgrade
(4)升級完成後步驟
alter system set compatible='12.2.0' scope=spfile; ##重啟DB生效
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69992972/viewspace-2915272/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11.2.0.4升級到12.2.0.1Oracle
- Oracle 10.2.0.5升級至11.2.0.4Oracle
- 圖形化升級單機oracle 11.2.0.4 到 12.2.0.1Oracle
- Oracle 11.2.0.4 RAC psu補丁升級至11.2.0.4.2Oracle
- 11.2.0.3 database異機升級至11.2.0.4Database
- Oracle-Database-12c-12.2.0.1升級實戰OracleDatabase
- oracle資料庫升級11.2.0.3升級到11.2.0.4Oracle資料庫
- oracle rac 11.2.0.3 升級到11.2.0.4Oracle
- oracle for windows 11.2.0.1升級到11.2.0.4OracleWindows
- Oracle:Oracle RAC 11.2.0.4 升級為 19cOracle
- 【UP_ORACLE】Oracle 19c之從19.3升級到19.9Oracle
- 靜默升級oracle 11g (從11.2.0.1升級到11.2.0.4)Oracle
- 使用DBUA升級 Oracle 11.2.0.4到Oracle 19C的問題記錄Oracle
- oracle資料庫11.2.0.3升級到11.2.0.4Oracle資料庫
- 【XTTS】Oracle XTTS V4--Oracle11.2.0.4+ 遷移升級TTSOracle
- Oracle資料庫異機升級(10.2.0.5 --> 11.2.0.4)Oracle資料庫
- 探索Oracle之資料庫升級二 11.2.0.3升級到11.2.0.4完整步驟Oracle資料庫
- 【UP_ORACLE】使用DBUA一鍵化靜默升級到19C以及DBUA引數詳解Oracle
- 圖形化升級單機oracle 11.2.0.1 到 11.2.0.4Oracle
- Oracle RAC 10.2.0.5升級到11.2.0.4遇到的問題Oracle
- 探索Oracle之資料庫升級三 回退升級操作(11.2.0.4Downgrade 11.2.0.3)Oracle資料庫
- ORACLE 10gR2 RAC升級至10.2.0.4Oracle 10g
- vm+win+oracle10g 升級至 10.2.0.4Oracle
- 探索Oracle之資料庫升級六 11.2.0.4.3 Upgrade12c(12.2.0.1)Oracle資料庫
- MongoDB 3.2 升級至 3.4.6MongoDB
- Twitter API升級至1.1API
- 如何升級Oracle Grid Infrastructure和RAC從11.2.0.3到11.2.0.4?OracleASTStruct
- Oracle 11.2.0.4打PSU至11.2.0.4.170718Oracle
- php5.6 升級至7.2.7PHP
- ThinkPHP升級至 5.1.18 版本PHP
- RAC升級11.2.0.1到11.2.0.4的實戰
- 單例項環境下Oracle 11.2.0.3升級到11.2.0.4的過程單例Oracle
- dbua升級oracle 10.2.0.1 0 到11.2.0.4 失敗後還原過程Oracle
- postgresql9.5.0升級至10.3SQL
- Chitika:60%的iPhone使用者升級至iOS 6iPhoneiOS
- win10升級遮蔽工具怎麼使用_win10升級遮蔽工具如何操作Win10
- 【邏輯DG滾動升級三】ORACLE11204 邏輯DG滾動升級至12C---正式升級Oracle
- 升級opatch工具