1.关闭数据库
2.备份数据库软件
3.patch
查看当前patch状态
$
/u01/app/oracle/product/10.2.0/db_1/OPatch/opatch lsinventoryInvoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Jun_05_13-38-00-CST_Sun.log
Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2011_Jun_05_13-38-00-CST_Sun.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 10g 10.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
应用patch
$
unzip p4518443_10201_LINUX.zip Archive: p4518443_10201_LINUX.zip
creating: 4518443/
creating: 4518443/files/
creating: 4518443/files/opmn/
creating: 4518443/files/opmn/lib/
inflating: 4518443/files/opmn/lib/libons.so
creating: 4518443/files/lib/
inflating: 4518443/files/lib/libons.so
creating: 4518443/etc/
creating: 4518443/etc/config/
inflating: 4518443/etc/config/inventory
inflating: 4518443/etc/config/actions
creating: 4518443/etc/xml/
inflating: 4518443/etc/xml/GenericActions.xml
inflating: 4518443/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 4518443/README.txt
$
cd 4518443/$
/u01/app/oracle/product/10.2.0/db_1/OPatch/opatch applyInvoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Jun_05_13-39-27-CST_Sun.log
ApplySession applying interim patch '4518443' to OH '/u01/app/oracle/product/10.2.0/db_1'
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '4518443' for restore. This might take a while...
Backing up files affected by the patch '4518443' for rollback. This might take a while...
Patching component oracle.rdbms, 10.2.0.1.0...
Copying file to "/u01/app/oracle/product/10.2.0/db_1/opmn/lib/libons.so"
Copying file to "/u01/app/oracle/product/10.2.0/db_1/lib/libons.so"
ApplySession adding interim patch '4518443' to inventory
OPatch succeeded.
查看patch状态
$
/u01/app/oracle/product/10.2.0/db_1/OPatch/opatch lsinventoryInvoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Jun_05_13-39-49-CST_Sun.log
Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2011_Jun_05_13-39-49-CST_Sun.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 10g 10.2.0.1.0
There are 1 products installed in this Oracle Home.
Interim patches (1) :
Patch 4518443 : applied on Sun Jun 05 13:39:32 CST 2011
Created on 7 Dec 2005, 09:44:27 hrs US/Eastern
Bugs fixed:
4518443
--------------------------------------------------------------------------------
OPatch succeeded.
查看patch详细信息
$
/u01/app/oracle/product/10.2.0/db_1/OPatch/opatch lsinventory -detailInvoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Jun_05_13-40-44-CST_Sun.log
Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2011_Jun_05_13-40-44-CST_Sun.txt
...
Interim patches (1) :
Patch 4518443 : applied on Sun Jun 05 13:39:32 CST 2011
Created on 7 Dec 2005, 09:44:27 hrs US/Eastern
Bugs fixed:
4518443
Files Touched:
libons.so --> ORACLE_HOME/opmn/lib/libons.so
libons.so --> ORACLE_HOME/lib/libons.so
Patch Location in Inventory:
/u01/app/oracle/product/10.2.0/db_1/inventory/oneoffs/4518443
Patch Location in Storage area:
/u01/app/oracle/product/10.2.0/db_1/.patch_storage/4518443_Dec_7_2005_09_44_27
--------------------------------------------------------------------------------
OPatch succeeded.
移除patch
$
/u01/app/oracle/product/10.2.0/db_1/OPatch/opatch rollback -id 4518443 -ph /home/oracle/4518443/Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Jun_05_13-44-43-CST_Sun.log
RollbackSession rolling back interim patch '4518443' from OH '/u01/app/oracle/product/10.2.0/db_1'
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
Backing up files affected by the patch '4518443' for restore. This might take a while...
Patching component oracle.rdbms, 10.2.0.1.0...
Deleting file "/u01/app/oracle/product/10.2.0/db_1/opmn/lib/libons.so"
Copying file to "/u01/app/oracle/product/10.2.0/db_1/lib/libons.so"
RollbackSession removing interim patch '4518443' from inventory
OPatch succeeded.
查看patch状态
$
/u01/app/oracle/product/10.2.0/db_1/OPatch/opatch lsinventoryInvoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation. All rights reserved..
Oracle Home : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventory
from : /u01/app/oracle/product/10.2.0/db_1/oraInst.loc
OPatch version : 10.2.0.1.0
OUI version : 10.2.0.1.0
OUI location : /u01/app/oracle/product/10.2.0/db_1/oui
Log file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch-2011_Jun_05_13-45-04-CST_Sun.log
Lsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory-2011_Jun_05_13-45-04-CST_Sun.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 10g 10.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
$ /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch apply
4.启动数据库
SQL>
startupORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 1219736 bytes
Variable Size 142607208 bytes
Database Buffers 268435456 bytes
Redo Buffers 7168000 bytes
Database mounted.
Database opened.
SQL>
select status from v$instance;STATUS
------------
OPEN
成功!