Steps to run Purge Script for CMS data :
----------------------------------------
The CMS data deletion involves Workorders, Titles and Metadata enhancement requrest deletion.

1. Login as oracle user on the CMS DB server.

2. Change directory to 

        cd /home/oracle/scripts/cms


3. Parameters of the purge scripts.

   a) Title purge script:
      --------------------
          TITLES_TOBE_DELETED      = Number of (soft deleted) titles are to be deleted under the batch from CMS database permanently.
          TITLE_RETENTION_MARGIN   = Number of days that a title must be soft deleted before selection for physical delete. 

   b) Work order purge script:
      ------------------------
          WORKORDER_RETENTION_DAYS = Number of days back from sysdate to retain the workorder data in CMS.

   c) Metadata Enhancement Request purge script:
      -------------------------------------------
          ME_REQUESTS_RETENTION_DAYS = Number of days back from sysdate to retain the Metadata Enhancement requests data in CMS.



4. Running purge scripts based on your requirement:

 (I) Purging Titles, WOs and ME Request data (all three):  
 
	  /home/oracle/scripts/cms/purge_cms_data.sh {TITLES_TOBE_DELETED} {TITLE_RETENTION_MARGIN} {WORKORDER_RETENTION_DAYS} {ME_REQUESTS_RETENTION_DAYS} >> /home/oracle/scripts/cms/purge_cms.log


 (II) Purging only Titles data, run the script as follows.

         /home/oracle/scripts/cms/purge_cms_titles.sh {TITLES_TOBE_DELETED} {TITLE_RETENTION_MARGIN} >> /home/oracle/scripts/cms/purge_titles.log



 (III) Purging only Work order data, run the script as follows.

         /home/oracle/scripts/cms/purge_cms_wos.sh {WORKORDER_RETENTION_DAYS} >> /home/oracle/scripts/cms/purge_wo.log



 (IV) Purging only Metadata Enhancement Requests data, run the script as follows.

         /home/oracle/scripts/cms/purge_cms_me.sh {ME_REQUESTS_RETENTION_DAYS} >> /home/oracle/scripts/cms/purge_cms_me.log


       Note: In RAC database setup: 

               a) If you want to run the purge scirpts from database node2, (as oracle user) 
                   please copy the /home/oracle/scripts/cms folder on to the db server node2 and maintain the same file permissions & file ownership.

               b) Run the purge script from either of the database server node, please don't run/schedule purge script on both the database servers.
		

Important Note: The purge script should only be run during periods of low or no activity on CMS application server.
