關於ORACLE Bug 14143632和online patch
online patch
關於Bug 14143632和online patch
今天線上遇到Bug 14143632
錯誤程式碼
ORA-30927: Unable to complete execution due to failure in temporary table transformation
剛開始覺得不知所云,然後檢視METALINK
描述:
On ADG, queries that use a cursor-duration temporary table may fail with ORA-30927 errors.
Such queries use Star with Temp Transformation and subquery factoring (WITH clause).
他是存在於ACTIVE 端的使用WITH CLAUSE可能出現錯誤。
影響主要是11.2.0.3
我們線上PSU已經達到了11.2.0.3.15,但是PSU沒有包含這個BUG的補丁他的補丁是
14143632
修復後應用正常。
下載補丁後檢視是一個online補丁,也省事了,下面是ONLINE PATCH 安裝方式:
某些ORACLE補丁可以線上安裝具體檢視readme 描述
online補丁支援的系統
01 HP-UX Itanium .............................. ( requries OS Patch HPUX 11iv3 (11.31) + [March 2008 Quality Pack + PHKL_38038] )
02 IBM AIX on POWER Systems (64-bit) .. ( requires AIX 6.1 + TL-02 + SP-01 onwards )
03 IBM: Linux on POWER Systems
04 IBM: Linux on System z
05 Linux x86
06 Linux x86-64
07 Microsoft Windows x86 (32-bit) .......... ( requires Opatch tool version 11.2.0.1.1 )
08 Microsoft Windows x86-64 (64-bit)
09 Oracle Solaris on SPARC (64-bit) ........ ( requires SunOS kernel patch 137111-04 )
10 Oracle Solaris on x86-64 (64-bit) ........ ( requires kernel patch 137112-04 )
11 HP-PARISC Not supported
12 Windows/Itanium Not supported
步驟
1、檢查是否可以線上安裝
[oradba@yjfquery1 14143632]$ ../OPatch/opatch query -all online
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation. All rights reserved.
Oracle Home : /home/oradba/oracle/product/11.2.3
Central Inventory : /oracle/oraInventory
from : /home/oradba/oracle/product/11.2.3/oraInst.loc
OPatch version : 11.2.0.3.12
OUI version : 11.2.0.3.0
Log file location : /home/oradba/oracle/product/11.2.3/cfgtoollogs/opatch/opatch2016-08-10_10-39-12AM_1.log
--------------------------------------------------------------------------------
Patch created on 5 Jun 2015, 23:20:09 hrs PST8PDT
Need to shutdown Oracle instances: false
Patch is roll-backable: true
Patch is a "Patchset Update": false
Patch is a rolling patch: true
Patch is a FMW rolling patch: false
Patch is a FMW feature bearing patch: false
Patch is a sql patch: false
Patch has sql related actions: false
Patch is an online patch: true ---ture
Patch is a portal patch: false
Patch is an "auto-enabled" patch: false
Patch is translatable: false
2、線上安裝
單庫:
opatch apply online -connectString ::
rac:
opatch apply online -connectString :::,:::,...
../OPatch/opatch apply online -connectString tdb:sys:test
3、檢查安裝完成
../OPatch/opatch lsinventory
4、檢查日誌alertsid.log
Wed Aug 10 10:51:51 2016
Patch file bug14143632.pch is out of sync with oracle binary; performing fixup
Patch file bug14143632.pch has been synced with oracle binary
Patch bug14143632.pch Installed - Update #1
Patch bug14143632.pch Enabled - Update #2
Wed Aug 10 10:51:53 2016
Online patch bug14143632.pch has been installed
Online patch bug14143632.pch has been enabled
SQL> oradebug patch list
Patch File Name State
================ =========
bug14143632.pch ENABLED
5、rollback
opatch rollback -id -connectString :::,:::, ...
opatch rollback -id 10188727 -connectString db11202:sys:oracle -invPtrLoc /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
6、注意:
Online Patching Best Practices
-It is strongly recommended to rollback all online patches and replace them with regular (offline) patches on next instance shutdown
Online patches should be used when the patch needs to be applied urgently and a downtime cannot be scheduled.
-IMPORTANT: It is strongly recommended to rollback all online patches and replace them with regular (offline) patches on next instance
shutdown
-Apply one instance at a time When rolling back online patches, ensure all patched instances are included
-Avoids the dangerous and confusing situation of having different software across instances using the same $ORACLE_HOME
-Assess memory impact on a test system before deploying to production
Example: pmap command
-Never remove $ORACLE_HOME/hpatch directory
視乎oracle並不推薦online的安裝方式。
7、Others not recommended way are:
1. Using "oradebug" to disable the patch
SQL> oradebug patch disable .pch
2. Shutting the instance down and removing the orapatch*.cfg file. After stopping the instance do the following:
cd $ORACLE_HOME/hpatch
rm orapatch$ORACLE_SID.cfg
Removing the orapatch*.cfg removes all of the online patches currently installed for the instance.
8、關於patch中檔案
bug14143632.pch 實際上pch是一個預編譯的C/C++標頭檔案,我們可以使用GCC生成一個但是GCC生成的是gch
g++ t1.h
t1.h.gch
kgl.o kqr.o 編譯後的但是沒有庫檔案連線的二進位制檔案可以用GCC -c生成
g++ -c t1fu.cpp
t1fu.o
以下轉自網路:
那麼正常的流程是:將c.h和a.cpp合併,編譯成a.o;將c.h和b.cpp合併,編譯成b.o;
最後將a.o和b.o連結成可執行檔案。過程很簡單,浪費時間之處也一目瞭然:
標頭檔案c.h的內容實際上被解析了兩遍。也許你要說,當然要兩遍了,因為標頭檔案幾乎是不生成任何程式碼的,
只有依附於具體的.cpp檔案才有意義。正確,但那只是在程式碼執行過程中。但在程式碼編譯的時候呢?
編譯器讀入原始碼,首先將其解析成為一種內部的表示方式。這個過程與其所依附的.cpp檔案並無關係,
編譯器接著可以讀入.cpp檔案並同樣解析成內部表示,然後把兩段內部表示拼接起來,再進行接下來的操作。
既然編譯兩個.cpp檔案都要先對c.h進行解析,那幹嘛不把c.h解析好了儲存成臨時檔案,用時讀入,
不就可以省了一次解析的時間了嗎?——預編譯頭技術節省時間的原理正在於此,尤其是在這樣一個事實下:
對原始碼的“解析”這個步驟,確實是佔了編譯時間中很可觀的一部分。
對了,說了半天,從來沒有正面講過如何使用已經生成的預編譯頭。然而看到這裡也該明白了,是的,很簡單,
只要包含其所對應的.h檔案即可!比如你有個標頭檔案叫foo.h,另外有一大堆其它檔案都包含了這個foo.h,
原來沒有使用預編譯頭技術,現在忽然想使用了,於是把foo.h編譯成了 foo.h.gch。那其它檔案要做怎樣的修改?
——什麼都不用,一切照舊!聰明的GCC編譯器在查詢一個.h檔案之前,會自動查詢其目錄裡有沒有對應的.gch檔案,
如有,且可用,則用之;沒有,才用到真正的.h標頭檔案。——慢著,“如有,且可用”,什麼叫“可用”?——就是指這個
.gch格式要正確,版本要相容,而且如上所述,編譯兩者要用同樣的選項。如果.gch不可用,編譯器會給出一條警告,
告訴我們:這個預編譯頭不能用!我只好用原有的.h 標頭檔案啦!什麼?你說看不到這個警告?——當然,要先開啟 -Winvalid-pch
選項才行,其預設是關閉的。-H
具體參考metalink
RDBMS Online Patching Aka Hot Patching (文件 ID 761111.1)
關於Bug 14143632和online patch
今天線上遇到Bug 14143632
錯誤程式碼
ORA-30927: Unable to complete execution due to failure in temporary table transformation
剛開始覺得不知所云,然後檢視METALINK
描述:
On ADG, queries that use a cursor-duration temporary table may fail with ORA-30927 errors.
Such queries use Star with Temp Transformation and subquery factoring (WITH clause).
他是存在於ACTIVE 端的使用WITH CLAUSE可能出現錯誤。
影響主要是11.2.0.3
我們線上PSU已經達到了11.2.0.3.15,但是PSU沒有包含這個BUG的補丁他的補丁是
14143632
修復後應用正常。
下載補丁後檢視是一個online補丁,也省事了,下面是ONLINE PATCH 安裝方式:
某些ORACLE補丁可以線上安裝具體檢視readme 描述
online補丁支援的系統
01 HP-UX Itanium .............................. ( requries OS Patch HPUX 11iv3 (11.31) + [March 2008 Quality Pack + PHKL_38038] )
02 IBM AIX on POWER Systems (64-bit) .. ( requires AIX 6.1 + TL-02 + SP-01 onwards )
03 IBM: Linux on POWER Systems
04 IBM: Linux on System z
05 Linux x86
06 Linux x86-64
07 Microsoft Windows x86 (32-bit) .......... ( requires Opatch tool version 11.2.0.1.1 )
08 Microsoft Windows x86-64 (64-bit)
09 Oracle Solaris on SPARC (64-bit) ........ ( requires SunOS kernel patch 137111-04 )
10 Oracle Solaris on x86-64 (64-bit) ........ ( requires kernel patch 137112-04 )
11 HP-PARISC Not supported
12 Windows/Itanium Not supported
步驟
1、檢查是否可以線上安裝
[oradba@yjfquery1 14143632]$ ../OPatch/opatch query -all online
Oracle Interim Patch Installer version 11.2.0.3.12
Copyright (c) 2016, Oracle Corporation. All rights reserved.
Oracle Home : /home/oradba/oracle/product/11.2.3
Central Inventory : /oracle/oraInventory
from : /home/oradba/oracle/product/11.2.3/oraInst.loc
OPatch version : 11.2.0.3.12
OUI version : 11.2.0.3.0
Log file location : /home/oradba/oracle/product/11.2.3/cfgtoollogs/opatch/opatch2016-08-10_10-39-12AM_1.log
--------------------------------------------------------------------------------
Patch created on 5 Jun 2015, 23:20:09 hrs PST8PDT
Need to shutdown Oracle instances: false
Patch is roll-backable: true
Patch is a "Patchset Update": false
Patch is a rolling patch: true
Patch is a FMW rolling patch: false
Patch is a FMW feature bearing patch: false
Patch is a sql patch: false
Patch has sql related actions: false
Patch is an online patch: true ---ture
Patch is a portal patch: false
Patch is an "auto-enabled" patch: false
Patch is translatable: false
2、線上安裝
單庫:
opatch apply online -connectString ::
rac:
opatch apply online -connectString :::,:::,...
../OPatch/opatch apply online -connectString tdb:sys:test
3、檢查安裝完成
../OPatch/opatch lsinventory
4、檢查日誌alertsid.log
Wed Aug 10 10:51:51 2016
Patch file bug14143632.pch is out of sync with oracle binary; performing fixup
Patch file bug14143632.pch has been synced with oracle binary
Patch bug14143632.pch Installed - Update #1
Patch bug14143632.pch Enabled - Update #2
Wed Aug 10 10:51:53 2016
Online patch bug14143632.pch has been installed
Online patch bug14143632.pch has been enabled
SQL> oradebug patch list
Patch File Name State
================ =========
bug14143632.pch ENABLED
5、rollback
opatch rollback -id -connectString :::,:::, ...
opatch rollback -id 10188727 -connectString db11202:sys:oracle -invPtrLoc /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
6、注意:
Online Patching Best Practices
-It is strongly recommended to rollback all online patches and replace them with regular (offline) patches on next instance shutdown
Online patches should be used when the patch needs to be applied urgently and a downtime cannot be scheduled.
-IMPORTANT: It is strongly recommended to rollback all online patches and replace them with regular (offline) patches on next instance
shutdown
-Apply one instance at a time When rolling back online patches, ensure all patched instances are included
-Avoids the dangerous and confusing situation of having different software across instances using the same $ORACLE_HOME
-Assess memory impact on a test system before deploying to production
Example: pmap command
-Never remove $ORACLE_HOME/hpatch directory
視乎oracle並不推薦online的安裝方式。
7、Others not recommended way are:
1. Using "oradebug" to disable the patch
SQL> oradebug patch disable .pch
2. Shutting the instance down and removing the orapatch*.cfg file. After stopping the instance do the following:
cd $ORACLE_HOME/hpatch
rm orapatch$ORACLE_SID.cfg
Removing the orapatch*.cfg removes all of the online patches currently installed for the instance.
8、關於patch中檔案
bug14143632.pch 實際上pch是一個預編譯的C/C++標頭檔案,我們可以使用GCC生成一個但是GCC生成的是gch
g++ t1.h
t1.h.gch
kgl.o kqr.o 編譯後的但是沒有庫檔案連線的二進位制檔案可以用GCC -c生成
g++ -c t1fu.cpp
t1fu.o
以下轉自網路:
那麼正常的流程是:將c.h和a.cpp合併,編譯成a.o;將c.h和b.cpp合併,編譯成b.o;
最後將a.o和b.o連結成可執行檔案。過程很簡單,浪費時間之處也一目瞭然:
標頭檔案c.h的內容實際上被解析了兩遍。也許你要說,當然要兩遍了,因為標頭檔案幾乎是不生成任何程式碼的,
只有依附於具體的.cpp檔案才有意義。正確,但那只是在程式碼執行過程中。但在程式碼編譯的時候呢?
編譯器讀入原始碼,首先將其解析成為一種內部的表示方式。這個過程與其所依附的.cpp檔案並無關係,
編譯器接著可以讀入.cpp檔案並同樣解析成內部表示,然後把兩段內部表示拼接起來,再進行接下來的操作。
既然編譯兩個.cpp檔案都要先對c.h進行解析,那幹嘛不把c.h解析好了儲存成臨時檔案,用時讀入,
不就可以省了一次解析的時間了嗎?——預編譯頭技術節省時間的原理正在於此,尤其是在這樣一個事實下:
對原始碼的“解析”這個步驟,確實是佔了編譯時間中很可觀的一部分。
對了,說了半天,從來沒有正面講過如何使用已經生成的預編譯頭。然而看到這裡也該明白了,是的,很簡單,
只要包含其所對應的.h檔案即可!比如你有個標頭檔案叫foo.h,另外有一大堆其它檔案都包含了這個foo.h,
原來沒有使用預編譯頭技術,現在忽然想使用了,於是把foo.h編譯成了 foo.h.gch。那其它檔案要做怎樣的修改?
——什麼都不用,一切照舊!聰明的GCC編譯器在查詢一個.h檔案之前,會自動查詢其目錄裡有沒有對應的.gch檔案,
如有,且可用,則用之;沒有,才用到真正的.h標頭檔案。——慢著,“如有,且可用”,什麼叫“可用”?——就是指這個
.gch格式要正確,版本要相容,而且如上所述,編譯兩者要用同樣的選項。如果.gch不可用,編譯器會給出一條警告,
告訴我們:這個預編譯頭不能用!我只好用原有的.h 標頭檔案啦!什麼?你說看不到這個警告?——當然,要先開啟 -Winvalid-pch
選項才行,其預設是關閉的。-H
具體參考metalink
RDBMS Online Patching Aka Hot Patching (文件 ID 761111.1)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7728585/viewspace-2123264/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE ONLINE PATCH & ORA-00600[kcbgtcr_13]Oracle
- 近期關於 Xcode 10 和 CocoaPods 的 bugXCode
- 關於Oracle的BLOB和CLOBOracle
- MySQL:關於Bug #81119MySql
- MySQL:關於Bug #20939184MySql
- Oracle Critical Patch Update for October 2022Oracle
- 【mos 1265700.1】Oracle Patch Assurance - Data Guard Standby-First Patch ApplyOracleAPP
- 如何使用git 生成patch 和打入patchGit
- 4.1.4 關於啟動和停止Oracle RestartOracleREST
- [BUG反饋]關於設定選單的BUG
- [BUG反饋]兩個關於釋出文章的BUG
- 4.1 關於 Oracle RestartOracleREST
- 有關HTTP的PATCH提交方式HTTP
- [BUG反饋]關於後臺無法釋出文章的BUG
- 關於一些奇葩的相容bug
- 關於elementUI樹狀結構的bugUI
- 關於oracle中的undoOracle
- 4.2.1 關於配置Oracle RestartOracleREST
- 1 關於 Oracle Data GuardOracle
- 關於oracle的Spool命令Oracle
- oracle10.1.0.4.0bugOracle
- 關於 vs code 中文語言包的 bug
- 關於 PHP artisan config:cache 引發的 bugPHP
- 關於bug,測試應該怎麼提
- 關於Oracle Database Vault介紹OracleDatabase
- Oracle 12.2 新特性: Online PDB relocate (PDB hot move)Oracle
- oracle的一個bugOracle
- 【經典】連線oracle的總結(關於tnsname和監聽)Oracle
- [20190805]Oracle 12c New Feature – Online Partitioning.txtOracle
- oracle關於ORA-12988錯誤Oracle
- 關於oracle的空間查詢Oracle
- RAC和ASM環境下打patchASM
- [BUG反饋]關於ot模型中的時間型別欄位bug問題模型型別
- 發現了一個關於 gin 1.3.0 框架的 bug框架
- git stash關於程式碼中bug的查詢使用Git
- 打 patch 報錯:corrupt patch at line 36
- LINUX 的patch 製作,及打patchLinux
- 【ASK_ORACLE】關於Oracle索引分裂你需要知道的Oracle索引
- 關於轉儲Oracle索引資訊的相關命令Oracle索引