Oracle單實(shí)例升級(jí)補(bǔ)丁全過(guò)程記錄
1.當(dāng)前DB環(huán)境
[oracle@localhost ~]$ cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) [oracle@localhost ~]$ uname -r 3.10.0-1160.el7.x86_64 [oracle@localhost ~]$ lsnrctl status LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 08-AUG-2023 05:39:02 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 12-JAN-2023 00:13:37 Uptime 208 days 4 hr. 25 min. 25 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/19c/db_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "orcl" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... Service "orclXDB" has 1 instance(s). Instance "orcl", status READY, has 1 handler(s) for this service... The command completed successfully [oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 8 05:40:12 2023 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0
2.下載補(bǔ)丁包和opatch的升級(jí)包
要具有開(kāi)源精神
opatch升級(jí)包:
https://dxz.jb51.net/202308/yuanma/OPatch_jb51.rar
19.18的補(bǔ)丁包
鏈接: https://pan.baidu.com/s/10GbaiIoXqQHDqd7Q2p1clg提取碼: bqdh
3.檢查OPatch的版本
更新opatch,根據(jù)README要求,opatch工具版本至少12.2.0.1.34 或更高版本
[oracle@localhost ~]$ cd $ORACLE_HOME [oracle@localhost db_1]$ cd OPatch/ [oracle@localhost OPatch]$ ./opatch version OPatch Version: 12.2.0.1.17 OPatch succeeded.
升級(jí)opatch版本
#備份OPatch [oracle@localhost ~]$ mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.bak #解壓到$ORACLE_HOME目錄下 [oracle@localhost ~]$ unzip p6880880_190000_Linux-x86-64.zip -d $ORACLE_HOME #查看升級(jí)后的opatch的版本 [oracle@localhost ~]$ cd $ORACLE_HOME [oracle@localhost db_1]$ cd OPatch/ [oracle@localhost OPatch]$ ./opatch version OPatch Version: 12.2.0.1.36 OPatch succeeded.
4.檢查補(bǔ)丁是否沖突
[oracle@localhost ~]$ unzip p34762026_190000_Linux-x86-64.zip [oracle@localhost ~]$ chown -R oracle:oinstall 34762026/ [oracle@localhost ~]$ chmod 775 -R 34762026/ #檢測(cè)沖突,依次檢測(cè) [oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/33575402/ [oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/34765931/ [oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/34768559/ [oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/34768569/ [oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph /home/oracle/34762026/34863894/ #出現(xiàn)以下字樣,檢測(cè)成功 Oracle Interim Patch Installer version 12.2.0.1.36 Copyright (c) 2023, Oracle Corporation. All rights reserved. PREREQ session Oracle Home : /u01/app/oracle/product/19c/db_1 Central Inventory : /u01/oraInventory from : /u01/app/oracle/product/19c/db_1/oraInst.loc OPatch version : 12.2.0.1.36 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2023-08-08_06-47-50AM_1.log Invoking prereq "checkconflictagainstohwithdetail" Prereq "checkConflictAgainstOHWithDetail" passed. OPatch succeeded.
5.關(guān)閉數(shù)據(jù)庫(kù)實(shí)例,關(guān)閉監(jiān)聽(tīng)
[oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 8 06:53:08 2023 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> exit Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.3.0.0.0 [oracle@localhost ~]$ lsnrctl stop LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 08-AUG-2023 07:13:07 Copyright (c) 1991, 2019, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))) The command completed successfully
6.應(yīng)用patch
[oracle@localhost 34765931]$ pwd /home/oracle/34762026/34765931 [oracle@localhost 34765931]$ $ORACLE_HOME/OPatch/opatch apply Oracle Interim Patch Installer version 12.2.0.1.36 Copyright (c) 2023, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/19c/db_1 Central Inventory : /u01/oraInventory from : /u01/app/oracle/product/19c/db_1/oraInst.loc OPatch version : 12.2.0.1.36 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19c/db_1/cfgtoollogs/opatch/opatch2023-08-08_07-19-09AM_1.log Verifying environment and performing prerequisite checks... ......
7.加載變化的SQL到數(shù)據(jù)庫(kù)
安裝補(bǔ)丁之后,還需要將有變化的SQL加載到數(shù)據(jù)庫(kù)中,這里可以直接運(yùn)行Datapatch工具將這些修改的SQL重新加載到數(shù)據(jù)庫(kù)中,如果是RAC環(huán)境,只需要在一個(gè)節(jié)點(diǎn)執(zhí)行就可以了。
根據(jù)readme的說(shuō)明,操作步驟如下:
sqlplus /nolog SQL> Connect / as sysdba SQL> startup SQL> alter pluggable database all open; SQL> quit cd $ORACLE_HOME/OPatch ./datapatch -verbose

8.ORACLE升級(jí)補(bǔ)丁查詢(xún)
1.查詢(xún)dba_server_registry視圖
SQL> select comp_name,version from dba_server_registry;
2.查詢(xún)dba_registry_history
SQL> select * from dba_registry_history;
3.查詢(xún)product_component_version視圖
SQL> select product,version from product_component_version;
4.查詢(xún)v$version視圖
SQL> select * from v$version;
到此這篇關(guān)于Oracle單實(shí)例升級(jí)補(bǔ)丁的文章就介紹到這了,更多相關(guān)Oracle單實(shí)例升級(jí)補(bǔ)丁內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Oracle?REGEXP_LIKE模糊查詢(xún)用法例子
Oracle中偶遇正則表達(dá)式的使用,簡(jiǎn)直逆天,在數(shù)據(jù)統(tǒng)計(jì)方面,最長(zhǎng)用的就是regexp_like與regexp_replace兩個(gè)了,下面這篇文章主要給大家介紹了關(guān)于Oracle?REGEXP_LIKE模糊查詢(xún)用法例子的相關(guān)資料,需要的朋友可以參考下2022-11-11
Oracle數(shù)據(jù)庫(kù)中ORDER BY排序和查詢(xún)按IN條件的順序輸出
這篇文章主要介紹了Oracle數(shù)據(jù)庫(kù)中ORDER BY排序和查詢(xún)按IN條件的順序輸出的方法,其中ORDER BY的排序結(jié)果需要注意其是否穩(wěn)定,需要的朋友可以參考下2015-11-11
Oracle?CDB管理實(shí)現(xiàn)多租戶(hù)管理功能
這篇文章主要介紹了Oracle?CDB管理實(shí)現(xiàn)多租戶(hù)管理功能的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用oracle具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2022-12-12
oracle 多個(gè)字符替換實(shí)現(xiàn)
CSDN上的一個(gè)網(wǎng)友,需要一個(gè)sql語(yǔ)句的解決方案需求是這樣的求寫(xiě)oracle多個(gè)字符替換(有測(cè)試數(shù)據(jù))2009-10-10
Oracle中serveroutput參數(shù)一次設(shè)置永久保存方法
serveroutput是sqlplus的配置參數(shù),而不是數(shù)據(jù)庫(kù)的配置參數(shù),每次都需要修改并保存sqlplus的配置參數(shù),本文將介紹如何一次設(shè)置永久保存2012-11-11
oracle中print_table存儲(chǔ)過(guò)程實(shí)例介紹
存儲(chǔ)過(guò)程(Stored Procedure),就是一組用于完成特定數(shù)據(jù)庫(kù)功能的SQL語(yǔ)句集,該SQL語(yǔ)句集經(jīng)過(guò)編譯后存儲(chǔ)在數(shù)據(jù)庫(kù)系統(tǒng)中。這篇文章主要介紹了oracle中print_table存儲(chǔ)過(guò)程介紹,需要的朋友可以參考下2018-09-09
快速學(xué)習(xí)Oracle觸發(fā)器和游標(biāo)
oracle觸發(fā)器和游標(biāo)是面試中常問(wèn)到的知識(shí)點(diǎn),今天就抽空通過(guò)實(shí)例代碼給大家介紹Oracle觸發(fā)器和游標(biāo)的示例代碼,需要的朋友參考下吧2021-06-06
oracle數(shù)據(jù)庫(kù)定時(shí)任務(wù)dbms_job的用法詳解
這篇文章給大家詳細(xì)介紹了dbms_job的用法,用于安排和管理作業(yè)隊(duì)列,通過(guò)使用作業(yè),可以使ORACLE數(shù)據(jù)庫(kù)定期執(zhí)行特定的任務(wù)。有需要的朋友們可以參考借鑒。2016-09-09

