【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 10.2.0.5升級至11.2.0.4Oracle
- oracle rac 11.2.0.3 升級到11.2.0.4Oracle
- Oracle:Oracle RAC 11.2.0.4 升級為 19cOracle
- oracle資料庫11.2.0.3升級到11.2.0.4Oracle資料庫
- 【UP_ORACLE】Oracle 19c之從19.3升級到19.9Oracle
- 靜默升級oracle 11g (從11.2.0.1升級到11.2.0.4)Oracle
- 【XTTS】Oracle XTTS V4--Oracle11.2.0.4+ 遷移升級TTSOracle
- 使用DBUA升級 Oracle 11.2.0.4到Oracle 19C的問題記錄Oracle
- 【UP_ORACLE】使用DBUA一鍵化靜默升級到19C以及DBUA引數詳解Oracle
- 【邏輯DG滾動升級三】ORACLE11204 邏輯DG滾動升級至12C---正式升級Oracle
- ThinkPHP升級至 5.1.18 版本PHP
- MongoDB 3.2 升級至 3.4.6MongoDB
- ORACLE windows和linux環境下 10g升級到11.2.0.4 並安裝11.2.0.4.19補丁OracleWindowsLinux
- postgresql9.5.0升級至10.3SQL
- glibc2.12升級至2.15
- php5.6 升級至7.2.7PHP
- oracle 10 rac 升級 10.2.0.1升級到10.2.0.5Oracle
- win10升級遮蔽工具怎麼使用_win10升級遮蔽工具如何操作Win10
- openssh升級7.4p1至8.4p1、openssl升級至openssl-1.1.1h
- Mac升級至macOS High Sierra後導致git無法使用MacGit
- 【Oracle升級】Oracle指令碼升級11g to 19c non-CDBOracle指令碼
- oracle之 11.2.0.4 bbed安裝Oracle
- ORACLE 11.2.0.4 DG(Broker) for linux 部署OracleLinux
- 內網gitlab11.2升級至11.4.5內網Gitlab
- Linux平滑編譯升級php至5.5.0Linux編譯PHP
- A Oracle Data Guard Broker 升級和降級Oracle
- 【邏輯DG滾動升級二】ORACLE11204 邏輯DG滾動升級至12C---DG端前期準備Oracle
- 12. Oracle版本、補丁及升級——12.3. 升級Oracle
- 如何Fedora 24升級至Fedora 25版?Fedora24升級至Fedora25版的詳細教程
- 【UP_ORACLE】如何給Oracle DG打補丁(一)整體思路Oracle
- Oracle 12c升級指南Oracle
- 【邏輯DG滾動升級一】ORACLE11204 邏輯DG滾動升級至12C---生產端前期準備Oracle
- confluence 4.2 升級至 6.10.x 記錄
- iOS12升級與降級至iOS11.4./11.3.1教程 iOS12怎麼升級iOS
- Oracle database 升級(文件)to 10.2.0.4 from 10.2.0.1OracleDatabase
- 連載三:Oracle升級文件大全Oracle
- 【Oracle版本升級圖--小麥苗】Oracle
- Centos7 升級至openssh-9.8p1CentOS