Opatching PSU in Oracle Database 11g Release 2(11.2.0.4) RAC on RHEL6

1) 升级opatch工具

1.1) For GI home
su - root

export GI_HOME=$(grep '^+ASM' /etc/oratab |awk -F: '{ print $2 }')
[[ -d "${GI_HOME}/OPatch" ]] && mv ${GI_HOME}/OPatch ${GI_HOME}/OPatch_$(date +%Y%m%d)
.zip -d ${GI_HOME}
ls -ld ${GI_HOME}/OPatch*
chown -R grid:oinstall ${GI_HOME}/OPatch
chmod -R +x ${GI_HOME}/OPatch
ls -ld ${GI_HOME}/OPatch*
su - grid
${ORACLE_HOME}/OPatch/opatch version
# --创建响应文件
(;;echo -e 'Y\n')|${ORACLE_HOME}/OPatch/ocm/bin/emocmrsp -no_banner -output /tmp/ocm.rsp

1.2) For DB home
su - oracle

[[ -d "${ORACLE_HOME}/OPatch" ]] && mv ${ORACLE_HOME}/OPatch ${ORACLE_HOME}/OPatch_$(date +%Y%m%d)
ls -ld ${ORACLE_HOME}/OPatch*
.zip -d ${ORACLE_HOME}
ls -ld ${ORACLE_HOME}/OPatch*
${ORACLE_HOME}/OPatch/opatch version

2) 安装GI PSU补丁

su - root
export GI_HOME=$(grep '^+ASM' /etc/oratab |awk -F: '{ print $2 }')
export DB_HOME=$(grep -Ev '^#|^$|+ASM' /etc/oratab |awk -F: '{ print $2 }')
# su - grid -c "(sleep 3;echo -e '\n';sleep 3;echo -e 'Y\n')|${GI_HOME}/OPatch/ocm/bin/emocmrsp -no_banner -output /tmp/ocm.rsp"
su - grid -c "unzip -oq p28317141_112040_Linux-x86-64.zip -d /apps/soft"
export UNZIPPED_PATCH_LOCATION=/apps/soft/
export LANG=C
${GI_HOME}/OPatch/opatch auto ${UNZIPPED_PATCH_LOCATION}/ -ocmrf /tmp/ocm.rsp

-- 检查确认
su - grid -c "${GI_HOME}/bin/crsctl status res -t"
su - grid -c "${GI_HOME}/OPatch/opatch lspatches;${GI_HOME}/OPatch/opatch lsinventory"
su - oracle -c "${DB_HOME}/OPatch/opatch lspatches;${DB_HOME}/OPatch/opatch lsinventory"

3) 升级数据字典

su - oracle
sqlplus /nolog << EOF
connect / as sysdba
@?/rdbms/admin/catbundle.sql psu apply
@?/rdbms/admin/utlrp.sql
set lines  pages
col action_time for a20
col action for a15
col namespace for a12
col version for a18
col
col bundle_series for a15
col comments for a28
prompt db version
select to_char(t1.action_time,'yyyy-mm-dd hh24:mi:ss') action_time,t1.action,t1.namespace,t1.version,id,t1.bundle_series,t1.comments from dba_registry_history t1 order by t1.action_time;
prompt
prompt comp info
col comp_name for a48
col comp_id for a12
col version for a16
col status for a12
col modified for a20
select t2.comp_id, t2.comp_name, t2.version, t2.status, to_char(to_date(t2.modified,'dd-mm-yyyy hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') modified from dba_registry t2 order by t2.modified,t2.comp_id;
quit;
EOF

4) 安装OJVM PSU

su - oracle

# 关闭db home的所有服务
srvctl stop database -d orcl

# 冲突检查
PATCH_TOP_DIR=/apps/soft/
cd ${PATCH_TOP_DIR}/
opatch prereq CheckConflictAgainstOHWithDetail -ph ./

# 安装补丁
(;;;;echo -e 'Y\n')|${ORACLE_HOME}/OPatch/opatch apply

# 结果检查确认
${ORACLE_HOME}/OPatch/opatch lspatches;${ORACLE_HOME}/OPatch/opatch lsinventory

5) 升级数据字典

sqlplus /nolog << EOF
host srvctl start instance -d orcl -i orcl1
connect / as sysdba
alter system set cluster_database=false scope=spfile;
host srvctl stop instance -d orcl -i orcl1
connect / as sysdba
startup upgrade
@?/sqlpatch//postinstall.sql
alter system set cluster_database=true scope=spfile;
host srvctl stop instance -d orcl -i orcl1
host srvctl start database -d orcl
connect / as sysdba
@?/rdbms/admin/utlrp.sql
set lines  pages
col action_time for a20
col action for a15
col namespace for a12
col version for a24
col
col bundle_series for a15
col comments for a28
prompt db version
select to_char(t1.action_time,'yyyy-mm-dd hh24:mi:ss') action_time,t1.action,t1.namespace,t1.version,id,t1.bundle_series,t1.comments from dba_registry_history t1 order by t1.action_time;
prompt
prompt comp info
col comp_name for a48
col comp_id for a12
col version for a16
col status for a12
col modified for a20
select t2.comp_id, t2.comp_name, t2.version, t2.status, to_char(to_date(t2.modified,'dd-mm-yyyy hh24:mi:ss'),'yyyy-mm-dd hh24:mi:ss') modified from dba_registry t2 order by t2.modified,t2.comp_id;
quit;
EOF

Opatching PSU in Oracle Database 11g Release 2 RAC on RHEL6的更多相关文章

  1. Oracle Database 11g Release 2 Standard Edition and Enterprise Edition Software Downloads

    Oracle Database 11g Release 2 Standard Edition and Enterprise Edition Software DownloadsOracle 数据库 1 ...

  2. Oracle Database 11g Release 2(11.2.0.3.0) RAC On Redhat Linux 5.8 Using Vmware Workstation 9.0

    一,简介 二,配置虚拟机 1,创建虚拟机 (1)添加三块儿网卡:   主节点 二节点 eth0:    公网  192.168.1.20/24   NAT eth0:    公网  192.168.1 ...

  3. 在redhat6.4下安装 Oracle® Database 11g Release 2

    OS版本: 安装过程的相关信息: pdksh 安装好后根据需要设置oracle开机自启动http://www.cnblogs.com/softidea/p/3761671.html 设置环境变量NLS ...

  4. Oracle Database 11G R2 标准版 企业版 下载地址(转)

    转自:http://blog.itpub.net/628922/viewspace-759245/ 不需要注册,直接复制到迅雷或其他下载软件中即可下载. oracle 11.2.0.3 下载地址: L ...

  5. Oracle Database 11g Express Edition学习笔记

    修改字符集 使用用户system,通过sqlplus程序连接到Oracle数据库,输入以下命令,查看字符集: SQL> select userenv('language') from dual; ...

  6. CHAPTER 1 Architectural Overview of Oracle Database 11g

    Which SGA structures are required, and which are optional? The database buffer cache, log buffer, an ...

  7. Oracle Database 12c Release 1下载安装(自身经历)

    1.访问Oracle官网:https://www.oracle.com/index.html,下载Oracle Database 12c Release 1 (注意:File1和File2都要下载!! ...

  8. Oracle Database 11g Express Editon介绍及安装

    一.Oracle Database 11g Express版本介绍 公司项目开发中,使用的数据库是Oracle 10g和MySQL 5.5,最新因为开发需要,需要从后台读取一些数据.使用的客户端是PL ...

  9. Oracle Database 11g Express Edition 使用小结(windows)

    如何启动oraclewindows系统服务中有一个服务叫:[OracleService[SID]]SID是你安装oracle xe时候的实例名,如果你没有改默认的是[XE], OracleServic ...

随机推荐

  1. 简明log4j配置教程

    先准备好log4j需要对应的开发包: apache-log4j-extras-1.2.17.jar slf4j-api-1.6.1.jar slf4j-log4j12-1.6.1.jar 然后就是在项 ...

  2. Oracle TO_DATE() 函数格式化时间【全】

    TO_DATE格式(以时间:2007-11-02   13:45:25为例)          Year:             yy two digits 两位年                显 ...

  3. 并发修改异常(ConcurrentModificationException)

    并发修改异常(ConcurrentModificationException) 这个异常,使用集合的时候应该很常见,这个异常产生的原因是因为java中不允许直接修改集合的结构. 先贴上个有趣的例子,给 ...

  4. Android的Intent你知道多少?

    https://blog.csdn.net/sinat_34383316/article/details/76039483 https://blog.csdn.net/u014492609/artic ...

  5. HDU4704(SummerTrainingDay04-A 欧拉降幂公式)

    Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submi ...

  6. django-templates过滤器

    常用内置过滤器: 过滤器会更改量或便签参数的值: title过滤器: {{ django|title }} 在下列context中 {'django': 'the web framework for ...

  7. CentOS7查看开放端口命令及开放端口号

    CentOS 7查看以开放端口命令:firewall-cmd —list-ports 查看端口是否开放命令:第一个方法就是使用lsof -i:端口号命令行,例如lsof -i:80.如果没有任何信息输 ...

  8. Flex 常用布局

    1.flex布局 1.1  容器指定为flex布局 .box{display: flex;} 1.2 行元素指定flex布局 .box{display:inline-flex} 2.容器的属性 2.1 ...

  9. SD从零开始11-12

    SD从零开始11 定价中的条件技术(Condition Technique in Pricing) 定价程序Pricing Procedure 所有定价中允许的条件类型都包含在定价程序中: 通过为每个 ...

  10. 免费的局域网协作办公方式—onlyoffice文档协作

    局域网内想享受协作办公的乐趣,请移步到这里按照步骤部署.https://blog.csdn.net/hotqin888/article/details/79337881 它是免费开源的,经过作者的一些 ...