本文主要是介绍Oracle 11g的PSU升级,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1、安装前备份 oracle 安装目录
chmod 777 /back
mkdir /back/oracle_home
tar -zcvf /back/oracle_home/gridhome20161031.tar $ORACLE_HOME
su - grid
tar -zcvf /back/oracle_home/gridhome20161031.tar $ORACLE_HOME
2、两节点使用root用户权限创建 OPATCH 目录
mkdir -p /install
将安装介质上传到 /install/oracle 目录
cd /install/oracle
mkdir psu
unzip psu补丁包名称 -d psu
修改权限和属主
chmod -R 775 psu
chown -R grid:oinstall psu
3、备份并替换新版OPatch
mv grid 用户的 OPatch
mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
ls $ORACLE_HOME
mv oracle 用户的 OPatch
mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
ls $ORACLE_HOME
root 用户解压 grid 用户的 OPatch 目录到 ORACLE_HOME 目录
cd /install/oracle
env
unzip p6880880_112000_Linux-x86-64.zip -d /u01/11.2.0/grid/
chown -R grid:oinstall /u01/11.2.0/grid/OPatch
root 用户解压 oracle 用户的 OPatch 目录到 ORACLE_HOME 目录
mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch_bak
cd /install/oracle
env
unzip p6880880_112000_Linux-x86-64.zip -d /u01/app/oracle/product/11.2.0/dbhome_1
chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/dbhome_1/OPatch
4、确认 root \ grid \ oracle 用户的 PATH 环境变量中包括 OPatch 的路径
export ORACLE_HOME=当前用户的 home 路径
export PATH=$PATH:$ORACLE_HOME/OPatch
5、srvctl stop database -d webmgrdb
6、生成ocm
--兼容性测试(grid 和 oracle 均要做)
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /install/27475913/22502505 -oh $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /install/27475913/27338049 -oh $ORACLE_HOME
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /install/27475913/27441052 -oh $ORACLE_HOME
7、打补丁
生成ocm
[grid@dg1 27475913]$ /u01/app/11.2.0/grid/OPatch/ocm/bin/emocmrsp
OCM Installation Response Generator 10.3.7.0.0 - Production
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
The OCM configuration response file (ocm.rsp) was successfully created.
cp ocm.rsp /home/grid
--打补丁
opatch auto /install/27475913 -oh /u01/app/11.2.0/grid -ocmrf /home/grid/ocm.rsp
8、重复第7步对数据库进行补丁升级。
生成ocm
[oracle@/home/oracle]$ /u01/app/11.2.0/grid/OPatch/ocm/bin/emocmrsp
OCM Installation Response Generator 10.3.7.0.0 - Production
Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name:
You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]: y
The OCM configuration response file (ocm.rsp) was successfully created.
cp ocm.rsp /home/oracle
--打补丁
opatch auto /install/27475913 -oh $ORACLE_HOME -ocmrf /home/oracle/ocm.rsp
9、升级包
cd $ORACLE_HOME/rdbms/admin
sqlplus / as sysdba
@?/rdbms/admin/catbundle.sql psu apply
————————————————————————————————————————————————————————————
本人主要从事架构优化、系统建设、系统运维等方面的工作,专注于Oracle、Mysql、Redis、PG、OGG等技术和系统建设、运维、优化,欢迎留言或者微信(deadknight9)交流,转载请注明出处。
这篇关于Oracle 11g的PSU升级的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!