Oracle Technologies Blog

By ASKM

Explaining Patch c,d,g and Unified Driver

Posted by Srikrishna Murthy Annam on October 14, 2009

Explaining Patch c,d,g and Unified Driver:

The unzipped patch contains three  drivers “c,d,g” or “u”. These are called copy,database,generate drivers or Unified drivers. The unified driver is the combination of all the three c,d,g drivers.

Now we will see these drivers one by one ….

Copy Driver : (cXXXXX.drv )
— Copies all files to the appropriate directory ( ex:  .fmb , .pll files)
— Relinks executable

Ex :
copy    ap     forms/US      APXIISIM.fmb     110.8
Driver will check the versions of APXIISIM.fmb on your system. If it is less than 110.8, then it will copy this file to the $AU_TOP/forms/US directory.

copy    ap     patch/110/sql apaiithb.pls     110.2
Driver will check the versions of apaiithb.pls on your system. If it is less than 110.2, then it will copy this file to the $AP_TOP/patch/110/sql directory.

copy    fnd    resource      JE.pll           110.8
Driver will check the versions of JE.pll on your system. If it is less than 110.8, then it will copy this file to the $AU_TOP/resource directory.

Database Driver : ( dXXXXXX.drv )
This is the driver that runs .sql, .pls, .odf and other files that update the database. As mentioned previously, some common ways the database is updated by the this driver are:
— Create packages
— Create new error messages
— Add a new table or view to the database
— Add a new column to a table
— Add new seed data to a table

The database driver uses the same command structure:
<command>  <product>  <subdirectory>  <file>  <other arguments….>
However, as you will see, it uses the <other arguments> section much more. There are numerous different arguments that can be used, but following are some more common examples:
– sql Run the script directly from the worker
– sqlplus Spawn a new sqlplus session and run the script
– package Same as sqlplus but performs package version checking

Another argument you may see at the end of the command string is a ‘phase=’’ command. Before performing any actions, adpatch divides all actions contained in the patch driver file into phases based on information specified in the patch driver. Adpatch performs all actions grouped in one phase in parallel before proceeding to the next.
Many ‘d’ drivers in patches contain phase definitions that determine what order the files in the driver will
run. If the driver does not contain any phase definitions, then the files are executed in the order they appear in the driver.
There are currently around 19 different phases that can be defined, but some examples are:
Phase name      Action taken
seq             Create sequences
tab             Create tables and indexes
pls             Create package specifications (specs)
vw              Create Views
plb             Create package bodies

Following are some examples of common commands found in a dXXXXXX.drv driver, and a brief explanation.
sql  ar   patchsc/107/sql b512706a.sql  !AR_PERIOD_TYPES  &un_ar  &pw_ar sql  &phase=tab
Run the sql script $AR_TOP/patchsc/107/sql/b512706a.sql using the ar username and password. The !AR_PERIOD_TYPES is another parameter expected by the .sql script. As discussed previously the &phase argument specifies what type of action this script is doing, in this case creating a table, and when the script will be executed by the driver.

sql  ar   patchsc/107/sql    ARTEHPCS.pls    none none none package &phase=pls
Run the script $AR_TOP/patchsc/107/sql/ARTEHPCS.pls which creates a package (phase=pls).

sql ar patchsc/107/sql artcall5.sql none none none sqlplus &phase=tbm+5 &un_ar &pw_ar
Run the script $AR_TOP/patchsc/107/sql/artcall5.sql. The phase ‘tbm’ tells you that it is altering a table.
The +5 is a way of determining the order a script will run within a phase. For example, within a phase, commands would be run in the following order:
&phase=tbm
&phase=tbm+5
&phase=tbm+99

Generate Driver : (gXXXXXX.drv )
Following are some examples of commands in a ‘g’ driver. Once again, remember that
— The .fmb files are stored in $AU_TOP, and when generated the executable (.fmx) is stored under the product.
— The .pll is stored under $AU_TOP, and when generated the executable (.plx) is also stored under $AU_TOP.
genform    ap     forms/US     APXIISIM.fmb
Generate the form $AU_TOP/forms/US/APXIISIM.fmb and store the executable in $AP_TOP/forms/US/APXIISIM.fmx
genrep     ap     reports      APXIIADV.rdf
Generate the report $AP_TOP/reports/APXIIADV.rdf, and store the resulting file APXIIADV.rdf in the same directory.
genfpll    fnd    resource     JE.pll
Generate the PL/SQL library $AU_TOP/resource/JE.pll, and store the executable JE.plx in $AU_TOP/resource.

Unified Driver : ( uXXXXXXX.drv )
The u driver is a merged driver that is a combined c, d, and/or g driver. Oracle is beginning to release a majority of its patches as unified driver patches. If a patch is a unified driver patch, then only the u driver is applied.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: