Opatch升级数据库

来源:互联网 发布:cnc编程还是模具设计好 编辑:程序博客网 时间:2024/05/18 16:39

1、下载Opatch地址

https://updates.oracle.com/download/6880880.html

数据库版本

SQL> select * from v$version;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionPL/SQL Release 11.2.0.1.0 - ProductionCORE    11.2.0.1.0      ProductionTNS for Linux: Version 11.2.0.1.0 - ProductionNLSRTL Version 11.2.0.1.0 - Production

在$ORACLE_HOME目录下有一个Opatch包,小版本的升级都通过该工具来完成

[oracle@pr product]$ cd $ORACLE_HOME[oracle@pr product]$ ls -al | grep OPatchdrwxr-xr-x  6 oracle dba  4096 Nov 10 05:26 OPatch

11.2.0.1自带的OPatch的版本是不能提供升级功能的。所以,我们通常需要首先升级OPatch,之后才能进行打补丁

2、 升级OPatch

首先要确定OPatch版本

<span style="font-size:12px;">[oracle@pr OPatch]$ ./opatch versionInvoking OPatch 11.1.0.6.6OPatch Version: 11.1.0.6.6OPatch succeeded.</span>


11.2.0.1自带的Opatch版本为11.1.0.6.6,首先升级OPatch,在升级之前备份

[oracle@pr product]$ tar zcvf opatch_bak.tar OPatch/OPatch/OPatch/docs/OPatch/docs/Prereq_Users_Guide.txtOPatch/docs/Users_Guide.txt……省略      [oracle@pr product]$ ls -al | grep opatch-rw-r--r--  1 oracle dba 1187636 Feb  2 02:07 opatch_bak.tar

从mos上下载补丁文件:

[oracle@gpsdb2 ~]$ ls -al | grep p6880-rw-r--r--   1 oracle oinstall  33020933 Feb  2 14:55 p6880880_112000_Linux-x86-64.zip
[oracle@gpsdb2 ~]$ unzip p6880880_112000_Linux-x86-64.zip -d $ORACLE_HOME

检查OPatch的版本

[oracle@pr OPatch]$ ./opatch versionOPatch Version: 11.2.0.3.6OPatch succeeded.

3、补丁的安装

更新OPtach之后,就能下载相应的PSU进行更新

关闭监听、关闭数据库

[oracle@pr ~]$ lsnrctl stopLSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-FEB-2015 02:54:40Copyright (c) 1991, 2009, Oracle.  All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=pr)(PORT=1521)))The command completed successfully[oracle@pr ~]$ ssSQL*Plus: Release 11.2.0.1.0 Production on Mon Feb 2 02:54:45 2015Copyright (c) 1982, 2009, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.






0 0
原创粉丝点击