7 - 10 minutes readFAQ: PATCH

Reader Mode

Q: After you apply a patch, there may be an invalid view. How do you validate the view?

A: Use following Query to find invalid objects:

SQL> select object_name, object_type from user_objects where status = ‘INVALID’;

Q. How do you compile all objects for the APPS schema?

A: Two way . you can use ADAMIN utility or use sql secipts for that:

SQL> @adcompsc.pls apps apps %

Q. How do you generate a form, report, library, or menu from a failed patch application?

A:

  • Find the name for the form that needs regenerating in Patch LOG file.
  • Logon to the server as the applmgr that contains the forms, reports, libraries, or menus that need to be regenerated
  • Set Enviroment Variable.
  • Run the corresponding command as follows:

For Forms:

f45gen userid=APPS/APPS module=[form name].fmb output_file=[full path of schema top]/forms/US/[form name].fmx module_type=form batch=no compile_all=special

For Reports:

r25convm userid=APPS/APPS source=/[full path of schema top]/reports/[report name].rdf dest=/[full path of schema top]/reports/[report name].rdf stype=rdffile dtype=rdffile logfile=[report name].log overwrite=yes batch=yes dunit=character

For PLL:

f45gen userid= APPS/APPS module=[library name].pll module_type=library output_file=/[full path of schema top]/resource/[library name].pll compile_all=Yes

For Menus:

FNDMDGEN APPS/APPS 0 Y [language codename]

Q. The Projects adpatch process may fail while running the database driver. What actions do you need to complete to finish the patch process?

A: You should restart the adpatch process for the database driver using only one worker.

Q. How do you determine version information about a form, view, package or executable?

A:

FORMS:

In the application, open the form select Help>About Oracle applications. Near the bottom of the information screen you will find a heading of “FORMS”. Under this heading you will find the name and version information of the currently selected form.

VIEWS:

Logon to the database using SQLPLUS as apps/ and run the following sql command:

SELECT text FROM user_views

WHERE name LIKE ‘[ENTER THE NAME OF THE VIEW IN ALL CAPS]’ AND text LIKE ‘%Header%’;

PACKAGES:

Logon to the database using SQLPLUS as apps/ and run the following sql command:

SELECT text

FROM user_source

WHERE name LIKE ‘[ENTER THE NAME OF THE PACKAGE IN ALL CAPS]’

AND text LIKE ‘%Header%’;

FAQ:

What log files are generated by ADPATCH and how are they named?

The log file created by ADPATCH is named by the user when they start ADPATCH. If the person applying patches does not give it a unique name each time, the log information is appended to the end of the existing file. That file is located in $APPL_TOP/admin/log and is named adpatch.log.

FAQ:

What worker log file generated by ADPATCH and how are they named?

Some patches may spawn workers and log file will be generated for each worker. These log files are named in the following way: adwork01.log, adwork02.log, etc… and are located in $APPL_TOP/admin/log.

FAQ:

How is the environment set and what kind of errors would ADPATCH generate if there were an issue with the environment?

ADPATCH should be run as APPLMGR, the owner of the APPL_TOP. The login should execute the environment file (sid.env), so ADPATCH should have this set. The errors you might encounter with an environment problem would be: ADPATCH will not know how to copy and will not be able to relink. In that case, you might get messages like:

Don’t know how to make.

FAQ:

Is there a file that lists all of the patches that have been applied to the application?

Yes, there are two files that are created in APPL_TOP: applptch.txt and applpatch.tmp.

FAQ:

Is there a command to list all to the patches for one application?

grep -i “begin bug ar” applptch.txt

FAQ:

You have unzipped a patch in your patch directory. Is there a quick way to remove it and all the sub-directories?

rm -rf

FAQ:

When applying patches, where should the patch files reside for adpatch to find them?

The patches can be copied anywhere but we may usually find that these are in a directory under $APPL_TOP.

FAQ:

Which drivers should be run first? If they are run in the wrong order can they be run again?

In general patches can include three different drivers: “c”, “d” and “g”.

The “C” drivers (copy) are file system drivers, these are used to update the file system with the new versions of certain files.

The “D” drivers are database drivers and they run SQL scripts that update database tables and objects.

The “G” (generate) drivers are also file system drivers , they generate forms and reports.

These drivers are run in alphabetical order c, d, then g. If they are run out of order, rerun them in the correct order.

FAQ:

Where (on which tier) do you run the three different patch drivers?

The “c” and “g” drivers are run on all tiers.

The “d” driver is only run on the database tier.

FAQ:

What is the basic process that adpatch runs with the “c” driver?

The “c” (copy) driver updates the file system. Below are a portion of a patch and an explanation of the activities within the patch.

copy fnd admin/sql fnddold.sql 110.4

copy fnd forms/US FNDADDTC.fmb 110.4

libout fnd lib afdict.o

copy fnd lib afdict.o110.1

libin fnd lib afdict.o

forcecopy fnd media FNDIEROR.gif

link fnd bin FNDCLOAD

Case 1

copy fnd forms/US FNDADDTC.fmb 110.4

ADPATCH performs version checks allowing it to not overlay a higher version object or sql files. If the version on the file system is the same or higher it skips the copy. In the above example, notice the version to the right of the filename. It uses this version to do the compare. The “fnd” next to the copy tells ADPATCH what applications top to use and “forms” points adpatch to the proper directory.

With the above statement ADPATCH will copy the file FNDADDTC.fmb (from the patch directory) to $FND_TOP/forms. The copy actually moves the existing FNDADDTC.fmb file to FNDADDTC.fmbO and then physically copies the new file version to FNDADDTC.fmb. The file FNDADDTC.fmbO will remain on the file system.

Case 2

libout fnd lib afdict.o

Libout is a utility that removes files from the library archive. The archive file resides in the lib directory under the TOP directory of the application. The name of the file is lib.a. So the archive file for FND is located in $FND_TOP/lib and is named libfnd.a. The actual command that libout executes is:

ar -d libfnd.a afdict.o

This removes the object file (afdict.o) from the library file (libfnd.a).

Case 3

libin fnd lib afdict.o

Libin is the utility that adds an object file to the library file. The actual command that libin executes is:

ar -rv libfnd.a afdict.o

The object file (afdict.o) is appended to the bottom of the library file. Libin is executed even if the copy did NOT take place because the information was already removed with the libout command.

Case 4

forcecopy fnd media FNDIEROR.gif

Similar to copy, but no version checking is done. Forcecopy copies the target file irregardless of the presence or version of the file currently on the target system.

Case 5

link fnd bin FNDCLOAD

The link process is similar to a compile. It links new object files together with the other objects files to create the executable. The command that the above link is using:

adrelink force=y “fnd FNDCLOAD”

The “fnd” is the top that the executable is being relinked in. The executable FNDCLOAD has to be in the proper case that it would normally appear in the $FND_TOP/bin directory.

FAQ:

What does adpatch actually do with a ‘d’ driver?

The “d” (database) drivers alter the tables in the database. These patches can create tables, add indexes and alter the APPS schema.

FAQ:

What does adpatch actually do with a ‘g’ driver?

The “g” (generate) drivers generate forms, .plls (PL/SQL libraries), reports and menus.

The following is an excerpt from a “g” driver:

genform fnd forms/US FNDWFNOT.fmb

genrep fnd reports FNDCPWKM.rdf

genfpll fnd resource JL.pll

genmenu fnd resource/US FNDMENU.mmb

Case1

genform uses f45gen to generate forms.

Syntax is:

f45gen userid=APPS/APPS module=.fmb

output_file=/forms/US/.fmx

module_type=form batch=no compile_all=special

Case2

genrep uses r25convm to generate reports

Syntax is:

r25convm userid=APPS/APPS

source=//reports/.rdf

dest=//reports/.rdf stype=rdffile

dtype=rdffile logfile=.log overwrite=yes batch=yes dunit=character

Case3

genfpll uses f45gen to generate .plls (forms libraries)

Syntax is:

f45gen userid= APPS/APPS module=.pll module_type=library

output_file=/ /resource/.pll

compile_all=Yes

Case4

genmenu uses FNDMDGEN to generate menus

Syntax is:

FNDMDGEN APPS/APPS 0 Y

DB_TO_RUNTIME .msb

FAQ:

What happens when a patch is applied where the version is lower than the current version?

Higher versions contained within the patch are copied, the lower versions are ignored.

FAQ:

Which patches can be backed out should there be a problem?

It is always recommended that you perform a cold backup of a system prior to applying any patch. It is also recommended that you apply patches to a test system first. However, for those cases where you have not done these two steps; you should know that database drivers ‘d’ CANNOT be backed out without a system backup. If the “c” or “g” drivers need to be backed out, reverse the steps from the “c” driver and relink, then reverse the steps from the “g” driver. This will require you to manually review the driver files and create commands that will do the opposite of the process. There is no utility that you can use to reverse the patch.

For the section of the above patch, you need to do the following:

libout fnd lib afdict.o

copy fnd lib afdict.o 110

libin fnd lib afdict.o

Dearchive afdict.o from libfnd.a, then copy rename afdict.oO to afdict.o and then archive afdict.o into the library file.

1st

libout fnd lib afdict.o

ar -dv libfnd.a afdict.o

2nd

copy fnd lib afdict.o 110

To reverse this:

cp afdict.o0 afdict.o

3rd

libin fnd lib afdict.o

ar -rv libfnd.a afdict.o

This will place the old object file back into the library file.

4th

link fnd bin FNDCLOAD

Now the executable needs to be relinked.

adrelink force=y ranlib=y “fnd FNDCLOAD

5th

Copy fnd forms/US FNDADDTC.fmb 110.4

This was the set that copied the file from the patch directory to $FND_TOP/forms. To reverse it:

cp FNDADDTC.fmbO FNDADDTC.fmb

Adpatch command to generate the form:

genform fnd forms FNDADDTC.fmb

To reverse it:

f45gen userid=APPS/APPS module= FNDADDTC.fmb

output_file=$FND_TOP/forms/US/ FNDADDTC.fmx

module_type=form batch=no compile_all=special

FAQ:

How will we check the log files for error?

Log files are located in APPL_TOP/admin/log.

We should check main log file (adpatch.log, by default) as well as other files generated by AutoPatch such as (adrelink.log, admvcode.log, adwork*.log, and others).

ADPATCh also produce as information log file, adpatch.lgi. This contains message on action that AutoPatch did not perform.

Related Articles

Responses

Your email address will not be published. Required fields are marked *

Password Reset
Please enter your e-mail address. You will receive a new password via e-mail.