檢查及升級Oracle資料庫補丁版本

來源:互聯網
上載者:User

第一部分:檢查Oracle資料庫補丁版本

1. 查看所有版本資訊:
oracle@www.bkjia.com:~/product/11g/db/OPatch> ./opatch lsinventory
Invoking OPatch 11.1.0.8.2

Oracle Interim Patch Installer version 11.1.0.8.2
Copyright (c) 2010, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/product/11g/db
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.8.2
OUI version       : 11.1.0.7.0
OUI location      : /opt/oracle/product/11g/db/oui
Log file location : /opt/oracle/product/11g/db/cfgtoollogs/opatch/opatch2011-09-13_15-34-15PM.log

Patch history file: /opt/oracle/product/11g/db/cfgtoollogs/opatch/opatch_history.txt

Lsinventory Output file location : /opt/oracle/product/11g/db/cfgtoollogs/opatch/lsinv/lsinventory2011-09-13_15-34-15PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (2):

Oracle Database 11g                                                  11.1.0.6.0
Oracle Database 11g Patch Set 1                                      11.1.0.7.0
There are 2 products installed in this Oracle Home.

Interim patches (1) :

Patch  9352179      : applied on Tue Aug 09 12:09:19 CST 2011
Unique Patch ID:  12289084
   Created on 1 Apr 2010, 01:07:34 hrs PST8PDT
   Bugs fixed:
     7378322, 9068088, 8348481, 9054253, 6851110, 7206858, 7497788, 8974548
     7331867, 8251486, 8851675, 8211920, 9352179, 7013124, 7643188, 7135702
     7529174, 7196532, 7515779, 7705669, 8402548, 8608377, 7119382, 7510766
     9001453, 8364676, 9066130, 7424804, 7628387, 7408621, 7426336, 7553884
     8856696, 6843972, 7694979, 8565708, 6972189, 6598432, 6768362, 6501490
     8836375, 8216875, 7527650, 7719143, 8402551, 7454752, 8290478, 7412296
     8402555, 7719148, 8284633, 8318050, 7639602, 8539335, 8613137, 7650993
     8940197, 6970731, 7589862, 9170608, 7131291, 9109536, 7586451, 7446163
     8199266, 7460818, 9114072, 6618461, 7451927, 7373196, 8230457, 7336031
     7420394, 8413059, 8402562, 8914979, 8402637, 7393804, 8876094, 6196748
     7627743, 7348847, 8408887, 7183523, 8531282, 7441663, 7720494, 7719668
     8645846, 8539923, 9458811, 8534338, 8339404, 8236851, 9458814, 7602341
     9458816, 7036453, 7610362, 8855553, 7384419, 7690421, 9458819, 8419383
     8855559, 8543737, 7447559, 6772911, 7175513, 7341598, 7706138, 8243648
     8367827, 8365141, 7350127, 9027691, 8549480, 8462173, 7356443, 7593835
     8483871, 8242410, 7044551, 7572069, 7639121, 9458829, 8855565, 8825048
     7253531, 8328853, 8341623, 8409848, 6851669, 7318276, 8257122, 7013817
     8860821, 7309458, 8450529, 8306933, 8306934, 6840740, 9458831, 6981690
     8304329, 8281906, 7480809, 8855570, 8339352, 7340448, 8499600, 7393258
     8588540, 8790767, 8855575, 6599920, 7630416, 7426959, 8855577, 6980601
     8342506, 8717461, 6452375, 8607693, 6407486, 7653579, 7416901, 7281382
     8599477, 7535429, 8582594, 7475055, 8217795, 7409110, 7432514, 8362693
     7436152, 7680907, 7013835, 7708340, 8499043, 8361398, 6784747, 7524944
     7496908, 7662620, 8224083, 7385253, 9189647, 7225720, 6941717, 7122161
     8898852, 8363210, 7477246, 7377810, 7299153, 9118620, 8213302, 8909984
     9118622, 9209238, 8702276, 7497640, 6991626, 7630874, 7311909, 7432601
     7213937, 7462112, 7352414, 7516867, 8199107, 7296258, 6812439, 6870937
     7219752, 7263842, 8287680, 6900214, 8870559, 6882739, 8813366, 8990527
     8352304, 7500792, 8352309, 7538000, 8834636, 8324760, 7652888, 7330434
     7113299, 7307972, 8487273, 7462709, 7486595, 8650661, 9032717, 8658581
     8244217, 7515145, 7499911, 7411865, 7276960, 8890026, 7432556, 7613481
     7522002, 8674263, 7452373, 8221425, 9188010, 7438445, 7334226, 9197917
     8284438, 7494333, 7318049, 8250643, 7834195, 8214576, 6679303, 8815639
     8277580, 7715244, 7675269, 7516536, 8490879, 6980597, 8301559, 7499353
     8496830, 7357609, 7462589, 6647480, 8416414, 7830065, 7189645, 7203349
     8702535, 7436280, 6955744, 7506785, 7366290, 6977167, 8570572, 7702085
     8348464, 7185872, 8625762, 6059178, 7257038, 8542307, 8833297, 8578132
     7606362, 7330611, 8226397, 7628866, 6903819, 8391256, 7676737, 7258928
     7829321, 7311601, 8433270, 7511040, 7434194, 8369094, 8563941, 8563942
     8563943, 8563944, 8563945, 8563946, 7716219, 8563947, 7345904, 8563948
     7556778, 8220734, 6870994, 7597354, 9135679, 7523787
--------------------------------------------------------------------------------
OPatch succeeded.

2. 查詢指定某個補丁號
oracle@www.bkjia.com:~/product/11g/db/OPatch> ./opatch lsinventory | grep 9352179
Patch  9352179      : applied on Tue Aug 09 15:19:13 CST 2011
     7331867, 8251486, 8851675, 8211920, 9352179, 7013124, 7643188, 7135702

補充:如果執行 ./opatch lsinventory 時報錯:
oracle@bmsuitedba:/opt/oracle/product/11/OPatch> ./opatch lsinventory
Invoking OPatch 11.1.0.6.2

Oracle Interim Patch Installer version 11.1.0.6.2
Copyright (c) 2007, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/oracle/product/11
Central Inventory : /opt/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.1.0.6.2
OUI version       : 11.1.0.7.0
OUI location      : /opt/oracle/product/11/oui
Log file location : /opt/oracle/product/11/cfgtoollogs/opatch/opatch2011-09-13_16-24-45PM.log

Inventory load failed... OPatch cannot load inventory for the given Oracle Home.

LsInventorySession failed: Unable to create patchObject

OPatch failed with error code 73

那麼極有可能是因為opatch版本過低的原因,需要下載更高版本的opatch使用,如:p6880880_111000_Linux-x86-64.zip,直接解壓後就可以使用了。


第二部分:給oracle打補丁

若資料庫版本是11.1.0.6.0,現在要將資料庫升級為11.1.0.7.3,那麼要進行下面的操作:

1. 11.1.0.6.0版本的oracle在官方網站上有zip包可以直接下載得到,安裝後的版本就是11.1.0.6.0;

2. 11.1.0.7.0版本是在11.1.0.6.0的基礎之上,通過打一大補丁才可以得到,這個大補丁需要有oracle的帳號方可以下載,當然網上可能有網友共用出來的。比如為:p6890831_111070_Linux-x86-64.zip,解壓後得到Disk1目錄,然後進行如下操作:
oracle@bmsuitedba:~/setup> cd Disk1/
oracle@bmsuitedba:~/setup/Disk1> ls
11107_buglist.htm  install  patch_note.htm  response  runInstaller  stage
oracle@bmsuitedba:~/setup/Disk1> ./runInstaller     --這一步需要圖形介面

3. 11.1.0.7.3版本是在11.1.0.7.0的基礎之上,通過打小補丁才可以得到。比如補丁號為:9352179,補丁包為:p9352179_111070_Linux-x86-64db.zip
解壓後得到9352179目錄:
oracle@bmsuitedba:~/setup> cd 9352179/
oracle@bmsuitedba:~/setup/9352179> /opt/oracle/product/11/OPatch/opatch apply   -- 注意,執行這一步,必須要進入到剛才解壓出來的補丁包的目錄中,然後通過使用完整的opatch路徑來執行opatch,否則會報錯

附:如果使用oracle安裝時的opatch版本過低,就會在執行opatch打版本過程中出錯,此時需要另外下載一個高版本的opatch包,比如在上面的操作中就會報錯,需要使用這個版本的opatch包:p6880880_111000_Linux-x86-64.zip,直接解壓就可以使用了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.