Friday, June 21, 2013

whatpatchdetail


What EBusiness Suite Patch Details (Parent and Included Patches) Based on Date.
What Patches and Included Patches were Applied after a specified-date ?

Example: 

#---------------------------------------------------------------#
#- whatpatchdetail:                                            -#
#---------------------------------------------------------------#


23-MAY-13        OATC (oratest) Apps eBusiness Patch Summary
20:17:33                EBusiness Patches Sorted by Date

                              Bug     ARU
Patch                Patch    Abbrev  Release
Date                 Number   iation  Name
-------------------- -------- ------- -------
10-MAY-2013 00:32:08 10197697 fnd     R12
10-MAY-2013 00:32:14 10051072 fnd     R12
10-MAY-2013 00:32:14 9198540  fnd     R12
11-MAY-2013 01:07:15 8668357  frm     R12
14-MAY-2013 19:23:57 12728634 sqlap   R12
14-MAY-2013 19:29:20 14559297 pjc     R12
14-MAY-2013 19:29:20 11804121 pjc     R12
16-MAY-2013 22:48:16 12747567 frm     R12
16-MAY-2013 22:48:17 10136174 frm     R12



#!/usr/bin/ksh
#whatpatchdetail ()
#-----------------------------------------------------------------------#
#    Module Name:  whatpatchdetail   (c) Copyright May 2012             #
#                                                                       #
#    Purpose:      Report on the eBusiness Suite Patches Sorted by Date #
#                                                                       #
#    Maintenance                                                        #
#    Date          Author        Description                            #
#    -----------   ------------  -------------------------------------  #
#    03-May-2010   M.Barone      Module design/creation                 #
#-----------------------------------------------------------------------#
{
        DIRNAM=$(dirname $0)
        ORASID=$(echo $CONTEXT_NAME | cut -f1 -d'_')
        HNAME=$(uname -n)

        #---------------------------------------------------------------#
        #  TEST:  Number ($#) of arguments passed to this function?     #
        #---------------------------------------------------------------#
        if      [ $# = 0 ]
        then
            clear
            echo
            echo  " #--------------------------------------------------#"
            echo  " # whatpatchdetail:                                 #"
            echo  " #--------------------------------------------------#"
            echo

            #-----------------------------------------------------------#
            #  Trap: Set CNTL-C CNTL-D CNTL-\Before Password Protection #
            #-----------------------------------------------------------#
            trap        "stty echo; return"     2
            trap        "stty echo; return"     3
            stty -echo

            read PASSWD?" Please Enter the Oracle APPS Passwd:  "

            stty echo
            echo
            #------------------------------------------------------------#
            #  Trap: Reset CNTL-C CNTL-D CNTL-\After Password Protection #
            #------------------------------------------------------------#
            trap        2
            trap        3 

            read PTCHDT?" Please Enter the Patch FROM-Date (DD-MON-YY): "

            clear
        else
            PASSWD=$1
            clear
        fi

#------------------------------------------------------------------------#
#  Initialize                                                            #
#------------------------------------------------------------------------#
        SPOOLNM=/tmp/whatpatchdetail_$$.txt
#------------------------------------------------------------------------#
#  SQL*Plus ("Here-Document")                                            #
#------------------------------------------------------------------------#
sqlplus  -s  /nolog  <<-END_FILE

        CONNECT  APPS/$PASSWD

        SPOOL ${SPOOLNM}

        clear   BREAKS
        clear   BUFFER
        clear   COLUMNS
        clear   COMPUTES
        clear   SCREEN
        clear   SQL
        clear   TIMING

        set     feedback        off
        set     flush           on
        set     heading         on
        set     pause           off
        set     space           1
        set     termout         on
        set     verify          on
        set     linesize        80
        set     pagesize        999

        prompt #---------------------------------------------------------#
        prompt #- What eBusiness Patch (whatpatchdetail)                -#
        prompt #---------------------------------------------------------#

        COLUMN  datevalue       NOPRINT NEW_VALUE       DATEVAR
        COLUMN  timevalue       NOPRINT NEW_VALUE       TIMEVAR

        COLUMN bugnmbr format A8  HEADING 'Patch|Number'      WORD_WRAPPED
        COLUMN bugabbr format A7  HEADING 'Bug|Abbrev|iation' WORD_WRAPPED
        COLUMN bugname format A7  HEADING 'ARU|Release|Name'  WORD_WRAPPED
        COLUMN bugdate format A20 HEADING 'Patch|Date'        WORD_WRAPPED
        COLUMN bugdesc format A5  HEADING 'Appl|Short|Name'   WORD_WRAPPED 

        TTITLE  CENTER  '${ORASID} (${HNAME}) Oracle Apps Patch Detail'  -
                LEFT    DATEVAR                                  skip 1  -
                CENTER  'eBusiness Patches Sorted by Date'               -
                LEFT    TIMEVAR                                  skip 2

        alter session set NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';

        prompt #---------------------------------------------------------#
        prompt #- whatpatchdetail:                                      -#
        prompt #---------------------------------------------------------#
        prompt


        SELECT  TO_CHAR(sysdate, 'DD-MON-YY')   datevalue,
                TO_CHAR(sysdate, 'HH24:MI:SS')  timevalue,
                release_name
        FROM    fnd_product_groups;

        prompt
        prompt #---------------------------------------------------------#
        prompt #- whatpatchdetail:                                      -#
        prompt #---------------------------------------------------------#
        prompt

        SELECT  creation_date           bugdate,
                bug_number              bugnmbr,
                trackable_entity_abbr   bugabbr,
                aru_release_name        bugname
        FROM    AD_BUGS ADB
        WHERE   creation_date           >=  TO_DATE('$PTCHDT', 'DD-MON-YY')
        ORDER BY 1;

END_FILE

print
print  "Please see  /tmp/whatpatchdetail_$$.txt"
print
}
 

No comments:

Post a Comment