0% found this document useful (0 votes)
74 views4 pages

Patch Steps New

This document provides instructions for applying a patch to an Oracle database and application. It includes steps to check for invalid objects before and after applying the patch, taking the application offline, applying the patch using adpatch, verifying the patch history, and bringing the application back online. It also mentions options for hot-patching without downtime and testing a patch in a non-production environment.

Uploaded by

Kishore Adikar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views4 pages

Patch Steps New

This document provides instructions for applying a patch to an Oracle database and application. It includes steps to check for invalid objects before and after applying the patch, taking the application offline, applying the patch using adpatch, verifying the patch history, and bringing the application back online. It also mentions options for hot-patching without downtime and testing a patch in a non-production environment.

Uploaded by

Kishore Adikar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Patch -

-----

Check whether the patch has a password ? - SR

Whether is patch is already applied ?

ad_applied_patches
A

ad_bugs
A
B
C

cat > patch.sql

select * from ad_bugs where bug_id=&&1 or bug_number='&&1'


/
select orig_bug_number,CREATION_DATE from applsys.ad_patch_run_bugs where
orig_bug_number like '%&&1%'
/
select orig_patch_name, driver_file_name from applsys.ad_patch_drivers where
orig_patch_name like '%&&1%'
/

-- compile the invalid objects

adadmin menu_option=CMP_INVALID workers=8


defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=adadmin2.log

-- Take a count of invalid objects


-- check for locks

echo "Purpose: To spool out the invalid objects before and after applying the
patch"
if [ $# -ne 2 ]; then
echo "Usage: $0 <appspass> <pre|post>"
exit 1;
fi
genInvList(){
USER=apps
PASS=$1
TYPE=$2
DATEFMT=`date +%Y%m%d-%H%M`

if [ "x$ORACLE_SID" = "x" ]; then


if [ "x$TWO_TASK" = "x" ]; then
echo "set up the env first, duh!"
exit
else
DB=`echo $TWO_TASK`
fi
else
DB=`echo $ORACLE_SID`
fi
sqlplus -s /nolog<<_END_
conn ${USER}/${PASS}@${DB}
set pages 10000
col owner for a14
col object_type for a20
col status for a10
col OBJECT_NAME for a30
spool ${DB}-${TYPE}-invalid-${DATEFMT}.lst
select to_char(sysdate,'dd-mon-yy hh24:mi:ss') from dual;
select instance_name,status from v\$instance;
select owner, object_type, object_name
from dba_objects
where status = 'INVALID'
order by owner, object_type, object_name;
select owner, count(status)
from dba_objects
where status = 'INVALID'
group by owner;

select 'Total Invalids: '||count(*) from dba_objects where status != 'VALID';


spool off
exit
_END_
}
genInvList $1 $2

sh invalid.sh apps pre

select count(*) from dba_objects where status='INVALID';


select substr(object_name,1,20) from dba_objects where status='INVALID'

select substr(object_name,1,20), object_type,owner from dba_objects where


status='INVALID' and object_type like '%PACKAGE%';

-- stop the application


cd $ADMIN_SCRIPTS_HOME
sh adstpall.sh apps/apps

-- enable the maintenance mode


adadmin defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt
logfile=adadmin.log menu_option=ENABLE_MAINT_MODE workers=4

-- apply the patch

adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt
logfile=u8416522.log patchtop=/home/oraprod/patches/8416522 driver=u8416522.drv
workers=8

-- the patch history is stored in the table - ad_applied_patches


SQL> select APPLIED_PATCH_ID,PATCH_NAME from ad_applied_patches where
PATCH_NAME='10634853';

-- Apply patch

select object_name, object_type,owner from dba_objects where status='INVALID';

sh invalid.sh apps post

-- disable the maintenance mode


adadmin defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt
logfile=adadmin.log menu_option=disable_MAINT_MODE workers=4

-- start the application


cd $ADMIN_SCRIPTS_HOME
sh adstrtal.sh apps/welcome123

-- Check for forms/concurrent managers - release the instance

-- send the patch log

Patch no PROD DEV TEST DBA Who requested Remarks Time


cloned on

123456 12/01/2012 Kishore PM SR ... 10


minutes

versioned control

-- Send the main

Hi,

The patch 23456 is succesfully applied on DEV instance, there is no increase in


invalid objects

I have attached patch log

Regards
A.Kishore

-- R12.1.1 to R12.1.3
-- Weekly backup of application

nohup tar -cvzf /u02/backup/apps_23aug.tar.gz apps &


nohup tar -cvzf /u02/backup/inst_23aug.tar.gz inst &

-- database - rman

Daily backup

Take a cold backup of the database and application tier. If possible


After the patch is applied update the log file
Check whether is for R12 (A) or R12.1.1 (B)

123446.A - R12 ~ . R12.0.6


455678.B - R12.1.1 ~ R12.1.3

R12.2 - ?

perl adcfgclone.pl appsTier - inst_top (log files, start and stop scripts)

-- one step - hotpatch - 5 kb - readme files - u don't need to shutdown

adadmin menu_option=CMP_INVALID workers=8


defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt logfile=adadmin2.log

select count(*) from dba_objects where status='INVALID';

adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt
logfile=u10634853.log patchtop=/home/oracler12/patches/10634853
driver=u10634853.drv workers=8 options=hotpatch

select count(*) from dba_objects where status='INVALID';

-- Test mode

adpatch defaultsfile=$APPL_TOP/admin/$TWO_TASK/adalldefaults.txt
logfile=u10634853.log patchtop=/home/oracler12/patches/10634853
driver=u10634853.drv workers=8 options=hotpatch apply=n

-- How to apply OPatch

10.1.2 -
echo $ORACLE_HOME

$ORACLE_HOME/OPatch/opatch apply -

if you get inventory issues

$ORACLE_HOME/OPatch/opatch apply -invPtrLoc $ORACLE_HOME/oraInst.loc

You might also like