Wednesday 19 December 2012

Removing OAF personalization document in the database using JDR_UTILS package

This method only requires access to the database and must be used with great care to ensure the correct document is deleted. For this method you need to know the document name of the OAF page with the personalization

Run the following commands to show the available personalization documents:

set serverout on;
exec jdr_utils.listcustomizations('/oracle/apps/<product>/<subcategories>/<pagename>');
exec jdr_utils.listcustomizations('/oracle/apps/fnd/framework/navigate/webui/HomePG');
exec jdr_utils.listcustomizations('/oracle/apps/eam/workorder/webui/CreateUpdateWOPG');


This will print the details:
exec jdr_utils.printdocument('/oracle/apps/eam/workorder/lov/server/customizations/site/0/MaterialsVO');
This returns the documentnames of the personalization document for this OAF page.

For example for SITE level on Homepage
/oracle/apps/fnd/framework/navigate/webui/customizations/site/0/HomePG

SQL> exec jdr_utils.listcustomizations('/oracle/apps/eam/workorder/webui/CreateUpdateWOPG');
/oracle/apps/eam/workorder/webui/customizations/site/0/CreateUpdateWOPG

PL/SQL procedure successfully completed.

Backup the personalization document by exporting it to a file

adjava -mx128m -nojit oracle.jrad.tools.xml.exporter.XMLExporter /oracle/apps/<product>/<subcategories>/customizations/<personalizationlevel>/<personalizationid>/ /<pagename> \
-username apps -password <appspwd> -dbconnection "(description=(address_list=(ADDRESS=(PROTOCOL=TCP)(HOST=<myHost>)(PORT=<port>)))(CONNECT_DATA=(SID=<SID>)))" \
-rootdir /tmp

This create an XML document in the /tmp directory, like
/tmp/oracle/apps/<product>/<subcategories>/<personalizationlevel>/<personalizationid>/<pagename>.xml


Delete the personalization document

SQL> exec jdr_utils.deletedocument('/oracle/apps/<product>/<subcategories>/customizations/<personalizationlevel>/<personalizationid>/<pagename>');
For the home page example this is:
SQL> exec jdr_utils.deletedocument('/oracle/apps/fnd/framework/navigate/webui/customizations/site/0/HomePG');

Restart Apache to ensure that Java caching is cleared
To restore the personalization document deleted, use the command (optional)
-adjava -mx128m -nojit oracle.jrad.tools.xml.importer.XMLImporter \
/tmp/oracle/apps/<product>/<subcategories>/<personalizationlevel>/<personalizationid>/<pagename>.xml \
-username apps -password apps -dbconnection "(description=(address_list=(ADDRESS=(PROTOCOL=TCP)(HOST=<myHost>)(PORT=<port>)))(CONNECT_DATA=(SID=<SID>)))" -rootdir /tmp


No comments:

Post a Comment