Tuesday 1 September 2009

Dodging up a package

No time to build a package, well try this on for size…

All you need to to is copy all of the package name files from central objects, copy the serialized objects and generate a manifest – job done!

So in my little example below, I want to get all CRP code (PY812) that is in package PY812CF into PD812CF.  Now, I’m not that much of a cowboy, I’m actually in a sandpit environment which is a exact copy of PROD – honest…  No breach of change control here…  Noooo sirrrreeee.

Remember the goal…  The goal is to leave all of the metadata tables thinking that the same old package is deployed – you are just changing all of the code beneath…  The perfect crime!

The @ syntax at the end of the table name is a reference to a database link.

I truncate all of the existing PD812CF package central objects.  Don’t truncate the F98770 table, it’s the package manifest.

select 'INSERT INTO PD812.' || table_name ||' SELECT * FROM PY812.' || substr(table_name,1,6) || 'PY812CF@jde_d2jde ;'
from all_tables
where owner = 'PD812'
and table_name like '%CF' and table_name not like '%F98770%'

Leave the F98770, this is the manifest.

I then copy the F989999 and F989998 over, but you could let them JITI.

Log into the generation machine with WebDevelopment=TRUE (see one of my older posts) and generate the manifest.

Job done.  You might want to copy the enterprise server binaries over too, just to be sure.

No comments: