Sunday, September 16, 2018

Oracle CPU and PSU patching, some useful notes



installing CPU from /tmp

chmod 777 /tmp/CPU_oracle -R
chown oracle.oinstall /opt/oracle/112/product/11.2.0/dbhome_2/bin/extjobO


substituting in bash_profile patch version with sed

cd /opt/oracle/
for i in `ls -a | grep ".bash_profile"`; do sed -s 's/jan2018/jul2018/g'  -i $i; done  #-i to save

deleting old Opatch in 11.2.0.4

mv /opt/oracle/112/product/11.2.0/dbhome_2/OPatch /opt/oracle/112/product/11.2.0/dbhome_2/OPatch.old


copy new Opatch

cp -r /tmp/CPU_oracle/cpujul2018/OPatch /opt/oracle/112/product/11.2.0/dbhome_2


cd /opt/oracle/

Creating backup of ORACLE_HOME and oraInventory

mv 112.tar.gz `date +%d-%m-%Y`_112.tar.gz
mv oraInventory.11g.tar.gz  `date +%d-%m-%Y`_oraInventory.tar.gz


root
tar -pczvf oraInventory.11g.tar.gz /opt/oracle/oraInventory.11g
tar -pczvf 112.tar.gz /opt/oracle/112/product/11.2.0/dbhome_2 


add new env to .bash_profile for faster patch installation

to .bash_profile

export version=cpujul2018
export cpu=/opt/oracle/112/product/11.2.0/dbhome_2/OPatch
#export cpu=/tmp/CPU_oracle/$version/OPatch
export PATH=$cpu:$PATH
export PATH=$PATH:/sbin
export PATH=$PATH:/usr/ccs/bin
alias cdcpu='cd /tmp/CPU_oracle/$version'
alias psuapply='unset ORACLE_PATH; cd $ORACLE_HOME/rdbms/admin; sqlplus  "/as sysdba" <<aaa  @catbundle.sql psu apply aaa'
alias psuapply12='unset ORACLE_PATH;cd $ORACLE_HOME/OPatch;./datapatch -verbose '
export ORA_INVENTORY=/opt/oracle/oraInvenotry.11g



deleting old Opatch in  12c

mv /opt/oracle/122/product/12.2.0/dbhome_1/OPatch /opt/oracle/122/product/12.2.0/dbhome_1/OPatch.old
cp -r /tmp/CPU_oracle/cpujul2018/122/cpujul2018/OPatch /opt/oracle/122/product/12.2.0/dbhome_1/


new env 

export version=cpujul2018
export cpu=/opt/oracle/122/product/12.2.0/dbhome_1/OPatch
#export cpu=/tmp/CPU_oracle/$version/OPatch
export PATH=$cpu:$PATH
export PATH=$PATH:/sbin
export PATH=$PATH:/usr/ccs/bin
alias cdcpu='cd /tmp/CPU_oracle/$version'
alias psuapply='unset ORACLE_PATH; cd $ORACLE_HOME/rdbms/admin; sqlplus  "/as sysdba" <<aaa  @catbundle.sql psu apply aaa'
alias psuapply12='unset ORACLE_PATH;cd $ORACLE_HOME/OPatch;./datapatch -verbose '
export ORA_INVENTORY=/opt/oracle/oraInvenotry.11g


for fixing one bug in JUL2018 psu


chown oracle.oinstall /opt/oracle/112/product/11.2.0/dbhome_2/bin/extjobO


No comments:

Post a Comment