ORACLE之打补丁

在这里先吐槽一下,打补丁,方法有很多,有的需要看文档,敲命令,有的直接解压覆盖,作为一名安安静静的美男子,能不能安安静静的装个补丁。


1.查看当前版本

select * from v$version;

然后oracle那个收费的网张Metalink下载对应的补丁版本;

2.修改环境变量

把opatch 添加到环境变量里面曲

ORACLE_SID=vicl; export ORACLE_SID
ORACLE_BASE=/oracle/app; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/db; export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$HOME/bin:/sbin:/oracle/app/db/OPatch/opatch 这里添加
alias sqlplus="rlwrap sqlplus"
alias rman="rlwrap rman"
export PATH

. .bash_profile  --使其生效

3.回滚
opatch rollback 12419378--补丁编号,出错了扫描滴就回滚吧。


4.解压看文档

4.1 p12419378_112010_LINUX.zip

解压后浏览里面的README.html就有安装的步骤。

重点一句

opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir ./12419378 就可以安装了

这种比较常见

4.2 p12419378_112010_LINUX.zip

解压之后会有个OPatch目录,直接覆盖你本机目‘/oracle/app/db/OPatch’录就可以了


4.3 p8670579_112010_LINUX.zip

这个就停复杂的,附上renme.txt

=========================================================================
Interim Patch for Base Bug: 8670579
=========================================================================

Date: 25th February 2010
-------------------------------------------------------------------------
 Platform Patch for      : Linux x86
 Product Patched         : NETWORK
 Product Version #       : 11.2.0.1
 RAC Rolling Installable : YES
 Online Installable     : NO

Bugs Fixed by this patch:
-------------------------
  8670579 - DBBETA :NETCA/DBCA FAILED WITH HOTSPOT VIRTUAL MACHINE

Patch Preinstall Steps
----------------------

1. For non-recommended patches, you must have the exact symptoms
   described in the service request (SR).

2. Confirm the version of Perl installed and configured for the ORACLE_HOME.

Oracle requires that all customers have at least Perl 5.00503 installed
and configured for patching activities inside the ORACLE_HOME.  Follow
these steps to check the Perl version for the ORACLE_HOME being patched:

  - source the ORACLE_HOME environment
  - execute "perl -v"
  - verify that the returned version of Perl is 5.00503 or higher

If the Perl configured for the ORACLE_HOME is not at 5.00503 or
higher, follow the directions in this metalink note to update to
a more recent version:

 https://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?p_id=189489.1

3. Verify the OUI Inventory.

OPatch needs access to a valid OUI inventory to apply patches.
Validate the OUI inventory with the following command:

  % opatch lsinventory

If the command errors out, contact Oracle Support and work to validate
and verify the inventory setup before proceeding.

4. Review and download the latest version of OPatch.

Oracle recommends that all customers be on the latest version of OPatch.
Please review the following metalink note and follow the instructions
to update to the latest version if needed:

 https://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?p_id=224346.1

5. Confirm executables appear in your system PATH.

The patching process will use the unzip and the opatch executables.  After
sourcing the ORACLE_HOME environment, confirm both of these exist before
continuing:

  - "which opatch"
  - "which unzip"

If either of these executables do not show in the PATH, correct the problem
before proceeding.

6. Create a location for storing the unzipped patch.  This location
will be referred to later in the document as <PATCH_TOP>.

7. Unzip the patch zip file into the <PATCH_TOP>.

  unzip -d <PATCH_TOP>  <ZIP_FILE>

8. Shut down services running from the ORACLE_HOME.

Before applying this patch, do a clean shut down of all services
running from the ORACLE_HOME.

  (a) In a non-RAC environment:

  Shut down all services that are running from this ORACLE_HOME.
  Confirm the return status from each shutdown command to verify
  the shutdown is successful and there are no errors.

  (b) In a RAC environment:

  For each node in the RAC system, shut down the services for
  the specific machine that are running from the ORACLE_HOME.
  OPatch will be used on each node in the RAC system one at
  a time.  If this patch is not rolling RAC installable treat
  it as a non-RAC environment and shut down all services.

  As an example, in the case of a two node RAC system:
     1. Stop instances running on node 1.
     2. Run 'opatch apply <PATCH_TOP>/8670579' on node 1.
     3. When the apply finishes, opatch asks for confirmation
        before going on to apply the patch to node 2.
     4. Start instances on node 1.
     5. Stop instances running on node 2.
     6. Ask opatch to continue to applying the patch to node 2.
     7. Start instances on node 2.      

9.  Apply pre-requisite updates.


Patch Installation Steps:
-------------------------

1.  Set your current directory to the directory where the patch is located.

% cd <PATCH_TOP>/8670579

2.  Apply the patch.

Use the following command to apply the patch to the ORACLE_HOME:

% opatch apply

When OPatch starts, it will validate the patch and make sure there
are no conflicts with the software already installed in the ORACLE_HOME.
OPatch categorizes two types of conflicts:

  (a) Conflicts with a patch already applied to the ORACLE_HOME
  In this case, please stop the patch installation and contact
  Oracle Support Services.

  (b) Conflicts with subset patch already applied to the ORACLE_HOME
  In this case, please continue the install, as the new patch
  contains all the fixes from the existing patch in the ORACLE_HOME.
  The subset patch will automatically be rolled back prior to the
  installation of the new patch.

Patch Post Install Instructions:
--------------------------------


Patch Deinstallation Instructions:
----------------------------------

1. Make sure to follow the same pre-install steps when deinstalling
a patch.  This includes verifying the inventory and shutting down
any services running from the ORACLE_HOME / machine before rolling
the patch back.

2. Change to the directory where the patch was unzipped.
  % cd <PATCH_TOP>/8670579

3. Run OPatch to deinstall the patch.
  % opatch rollback -id 8670579

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Knuuy

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值