Sunday, June 24, 2018

Method 4 - Removing 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 (See Introduction section)

1) Login to SQLPlus as APPS user

2) Run the following commands to show the available personalization documents

SQL> set serverout on;
SQL> exec jdr_utils.listcustomizations('/oracle/apps/<product>/<subcategories>/<pagename>');
e.g.

SQL> exec jdr_utils.listcustomizations('/oracle/apps/fnd/framework/navigate/webui/HomePG');

3) This returns the document names 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

4) Backup the personalization document by exporting it to a file (so it can be reloaded if needed). Make sure you are backing up the correct document. It should have "/customizations/" in the document name.

From the web server, use the OS command:

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

5) Delete the personalization document. Be VERY careful you are deleting the personalization and not the base document !

SQL> exec jdr_utils.deletedocument('/oracle/apps/<product>/<subcategories>/customizations/<personalizationlevel>/<personalizationid>/<pagename>');
SQL> commit;
For the home page example this is:

SQL> exec jdr_utils.deletedocument('/oracle/apps/fnd/framework/navigate/webui/customizations/site/0/HomePG');
SQL> commit;
6) Restart Apache to ensure that Java caching is cleared

7) Retest the issue and confirm that OAF page is not accessible again

8) To restore the personalization document deleted, use the following 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