Tuesday, April 28, 2009

Applied Patches View

I was testing patching in Grid Control 10.2.0.4 a few weeks ago.
I found that when the Schedule Deployment Job executes, if the
patching step of the database completes, the Grid Control repository
view mgmt$applied_patches is not updated with the applied patch
immediately, but waits till the entire job completes.

If a later step fails, the entire job is marked as failed, and the
Grid Control Repository Applied Patches view is not updated,
even though the database has already been patched.

Instead of this, I felt, the Grid Control Repository Applied Patches
should be updated as soon as the patching step completes. Actually
it works in a different way. Let me explain.

MGMT$APPLIED_PATCHES is a view which gathers the information
from the following 4 tables in the repository:

mgmt_inv_container con,
mgmt_ecm_snapshot snap,
mgmt_inv_patch patch,
mgmt_targets tgt

The definition of the view is:

CREATE OR REPLACE FORCE VIEW "SYSMAN"."MGMT$APPLIED_PATCHES"
("PATCH", "BUGS", "INSTALLATION_TIME", "HOST",
"HOME_LOCATION", "HOME_NAME", "CONTAINER_GUID", "TARGET_GUID") AS
SELECT
to_char(patch.id) as patch,
ecm_util.concat_col('distinct BUG_NUMBER',
'mgmt_inv_patch_fixed_bug',
'PATCH_GUID = ''' || patch.patch_guid || '''',',') as bugs,
patch.timestamp as installation_time,
tgt.target_name as host,
con.container_location as home_location,
con.container_name as home_name,
con.container_guid,
tgt.target_guid
FROM
mgmt_inv_container con,
mgmt_ecm_snapshot snap,
mgmt_inv_patch patch,
mgmt_targets tgt
WHERE
con.snapshot_guid = snap.snapshot_guid AND
snap.is_current = 'Y' AND
snap.snapshot_type = 'host_configuration' AND
con.container_guid = patch.container_guid AND
tgt.target_name = snap.target_name
WITH READ ONLY;

As you can see there is a WHERE clause saying:
snap.is_current = 'Y' AND
snap.snapshot_type = 'host_configuration'.

Host configuration is manually executed at user request from
Deployment tabs or every 24 hours. If a patch is applied with
Opatch (ie. outside Grid Control at the unix or dos prompt)
then you MUST run the RefreshHostConfiguration job from
Deployments tab if you want the view updated immediately,
if not after 24 hours the info will be available.

If a patch is applied with Deployment procedures then there is
a step at the end of the DP that runs the RefreshHostConfiguration
job. If the whole DP job fails before reaching the
RefreshHostConfiguration job then of course this step
will not execute and the view will not be updated.

Thanks to the Oracle EM support team for this information.

No comments:

Disclaimer

Opinions expressed in this blog are entirely the opinions of the writers of this blog, and do not reflect the position of Oracle corporation. No responsiblity will be taken for any resulting effects if any of the instructions or notes in the blog are followed. It is at the reader's own risk and liability.

Blog Archive