Labels

DB (11) Query (11) R12 (8) FWM (7) scripts (7) APPS (6) AD Tools (5) Patch (4) Concurrent request (3) DB Vault (3) Performance Tuning (3) RMAN (3) tips (3) LOG (2) clone (2) ASM (1) RAC (1) error (1) metalink (1) standby (1)
Showing posts with label Patch. Show all posts
Showing posts with label Patch. Show all posts

Saturday, 7 January 2017

adpatch

Modes of adpatch:  
Interactive mode
Non-Interactive mode
Test mode
Pre-Install mode

Interactive Mode:  
It is the default mode of adpatch when we don’t use anything. We can apply patch in this mode by going into patch directory and simply type adpatch in command prompt and hit enter.

Non-Interactive:
$adpatch Interactive=no (It uses default files to store prompt values and can be applied from patch directory.)

Test Mode:
$adpatch apply=no (This mode is purposely used to check the what exactly patch is doing and will do everything without actually changing anything.)

PreInstall Mode:
$adpatch preinstall=y  (When we apply patch in preinstall mode, it updates all AD utilities befre upgrade or update.)

Adpatch Options:
noautoconfig, nocompiledb, nocopyportion, nocompilejsp, nodatabaseportion, nogenerateportion, hotpatch, nolink, nogenform, nomaintainmrc, noprereq

Default File location:
defaultsfile=$APPL_TOP/admin/$SID/defaults.txt

Stop and resume adpatch:
adctrl, option 3 "Tell worker to shutdown/quit"
Backup FND_INSTALL_PROCESSES, AD_DEFERRED_JOBS
Backup $APPL_TOP/admin/<SID>/restart/(.rf9)
Drop FND_INSTALL_PROCESSES, AD_DEFERRED_JOBS
Remove $APPL_TOP/admin/<SID>/restart/(.rf9)

Wednesday, 4 January 2017

EBS Applications Patch Download Script - Wget

Script Usage:
Enter "username" and "passsword" in script, refer readme url for "ARU"

sh wget.sh <patch_name> <ARU_number>
sh wget.sh p17204589_12.2.0_R12_GENERIC.zip 16610006

 Script:
#!/bin/sh

export LANG=C

# SSO username and password
SSO_USERNAME=

SSO_PASSWORD=
PATCH_NAME=$1
ARU_NUM=$2

WGET=/usr/bin/wget
COOKIE_FILE=/tmp/$$.cookies
LOGDIR=.
LOGFILE=$LOGDIR/wgetlog-`date +%m-%d-%y-%H:%M`.log
OUTPUT_DIR=.

if [ "$SSO_PASSWORD " = " " ]
then
 echo "Please edit script and set SSO_PASSWORD"
 exit
fi

SSO_RESPONSE=`$WGET --user-agent="Mozilla/5.0" https://updates.oracle.com/Orion/Services/download 2>&1|grep Location`
SSO_TOKEN=`echo $SSO_RESPONSE| cut -d '=' -f 2|cut -d ' ' -f 1`
SSO_SERVER=`echo $SSO_RESPONSE| cut -d ' ' -f 2|cut -d 'p' -f 1,2`
SSO_AUTH_URL=sso/auth
AUTH_DATA="ssousername=$SSO_USERNAME&password=$SSO_PASSWORD&site2pstoretoken=$SSO_TOKEN"
$WGET --user-agent="Mozilla/5.0" --secure-protocol=auto --post-data $AUTH_DATA --save-cookies=$COOKIE_FILE --keep-session-cookies $SSO_SERVER$SSO_AUTH_URL -O sso.out >> $LOGFILE 2>&1
rm -f sso.out
$WGET  --user-agent="Mozilla/5.0"  --load-cookies=$COOKIE_FILE --save-cookies=$COOKIE_FILE --keep-session-cookies "https://updates.oracle.com/Orion/Services/download/"$PATCH_NAME"?aru="$ARU_NUM"&patch_file="$PATCH_NAME -O $OUTPUT_DIR/$PATCH_NAME   >> $LOGFILE 2>&1

# Cleanup
rm -f $COOKIE_FILE

Wednesday, 19 November 2014

Patch

Adpatch

 AutoPatch - utility to apply patches for EBS

Options:
apply=n                                - test mode - generate only log file without apply
preinstall=y                          - preinstall mode -
options=noautoconfig          - to avoid autoconfig
options=nocheckfile            - do not check already executed exec, sql and exectier - cause performance issue
options=nocompiledb          - do not compile invalids in database
options=nocompilejsp         - do not compile jsp
options=nocopyportion       - do not execute copy driver portion
options=nodatabaseportion - do not execute database driver portion
options=nogenerateportion - do not execute generate driver portion
options=hotpatch                - apply patch without maintance mode
options=integrity                - check patch integrity - cause performance issue
options=nomaintainmrc      - do not execute maintain MRC schema - for translation and documentation patches
options=noprereq                - do not check prereq
options=validate                 - validate all schemas in database
options=nojcopy                 - do not copy new java class from the patch
options=noforcecopy          - checks for file version and copy only the new version from patch
options=nolink                    - do not relink executables
options=nogenform             - do not generate form files
options=nogenrep                - do not generate report files

Maintance Mode:
sqlplus apps/apps  @$APPL_TOP/ad/12.0.0/patch/115/sql/adsetmmd.sql ENABLE ENABLE
select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;
Output: MAINT/NORMAL

adadmin -> 5.Change Maintenance Mode -> 1.Enable Maintenance mode/2.Disable Maintenance mode

Apply prereq patch when main patch fails

1. adctrl->option 3(tell all works to quit)->option 5(tell manager that all worker have quit)
2. sqlplus apps/apps
3. alter table ad_deferred_jobs rename to ad_deferred_jobs_old;
4. alter table fnd_install_processes rename to fnd_install_processes_old;
5. mv $APPL_TOP/admin/<SID>/restart $APPL_TOP/admin/<SID>/restart_old
6. apply prereq patch
7. sqlplus apps/apps
8. alter table ad_deferred_jobs_old rename to ad_deferred_jobs;
9. alter table fnd_install_processes_old rename to fnd_install_processes;
10. mv $APPL_TOP/admin/<SID>/restart_old $APPL_TOP/admin/<SID>/restart
11. apply main patch
12. adctrl->option 2(change status to fixed/restart)

Log file:
$APPL_TOP/admin/$SID/log/

Tables:
ad_bugs || ad_applied_patches || ad_patch_run_bugs || ad_patch_runs || ad_patch_drivers

 

Opatch 

Apply Patch on RAC database
 
1. Check Oracle service status
crs_stat -t
2. Stop database instance one by one
srvctl stop instance -i prod1 -d prod
srvctl stop instance -i prod2 -d prod
3. Stop ASM instance on each node one by one
srvctl stop asm -n rac-node1
srvctl stop asm -n rac-node2

4. Stop nodapplications one by one on each node
srvctl stop nodeapps -n rac-node1
srvctl stop nodeapps -n rac-node2

5. Check status again
crs_stat -t
6. Apply patch
opatch apply


Sunday, 3 March 2013

Patch

Patch in Non-Interactive Mode:


adpatch defaultsfile=/u03/applrac/apps/apps_st/appl/admin/PRODTEST/defaults.txt logfile=u10274966.log patchtop=/home/applrac/gdc/12feb/p10274966_R12.PJT.B_R12_GENERIC/10274966 driver=u10274966.drv workers=8 interactive=no

Script to generate patch line

echo "Enter patch top:"
read patch_top
echo "Enter patch number:"
read patch_number
cd $patch_top
mv backup backup_old
ls
echo "adpatch defaultsfile=/u03/applrac/apps/apps_st/appl/admin/PRODTEST/defaults.txt logfile=u$patch_number.log patchtop=$patch_top driver=u${patch_number}.drv workers=8 interactive=no"