Purging request data from the BRPM
Data purging is an ongoing maintenance activity that enables you to delete requests and request-related data from the database. You can specify a date and all records on and before the specified date are deleted permanently.
From 5.0.03.001 onward, you can purge request data from the BRPM by using a rake task.
After purging the request data from the database, the following data is removed from the environment:
- Request folder, as configured in the automation_setting.rb file is deleted.
For example, opt/bmc/RPMHome/automation_results/request folder is deleted. - If the steps in the request contain attachments, the uploads folder where the attachments are stored by default is deleted.
- To see the results of the data purging rake task, use the following path to open the log file:
RPMhome\releases\yourCurrentVersion\RPM\portal.war\WEB-INF\log\purge_data_requests_with_dependency.log
After successful purging, the following request-related data is deleted from the database tables for the specified date:
- SERVERS_STEPS
- STEP_EXECUTION_CONDITIONS
- LARGE_STRINGS
- AUDITS
- STEP_SCRIPT_ARGUMENTS
- SCHEDULED_JOBS
- NOTES
- AUTOMATION_QUEUE_DATA
- JOB_RUNS
- UPLOADS
- LINKED_ITEMS
- STEP_HOLDERS
- STEP_REFERENCES
- STEP_REFERENCES
- SERVER_ASPECTS_STEPS
- SERVER_GROUPS_STEPS
- DATA_RETRIEVER_VALUES
- STEPS
- ACTIVITY_LOGS
- REQUEST_PROPERTIES
- PROPERTY_VALUES
- TEMPORARY_PROPERTY_VALUES
- MESSAGES
- EMAIL_RECIPIENTS
- REQUEST_PACKAGE_CONTENTS
- REQUESTS
Rake task format
The format for a rake task to purge request data from the BRPM is as follows:
This rake task consists of the following parameters to purge data from BRPM:
Parameter | Description |
---|---|
date | Enter the date from which the data must be purged. The date must be in DD/MM/YYYY format. If a user misses to enter the date, the default date will be one year from the date of the request being made. |
include_plan_requests | Enter a flag value to show if the request is included or not. Enter YES (for included plan request) or NO (for excluded plan request). If a user misses to enter a flag value, the default flag value is NO. |
New in 5.0.04request_status | Enter the status of the requests using a || separator. The following are the available request status options:
|
New in 5.0.04request_environment | Enter the environment of the request. For multiple environments, use the || separator. |
To purge data from the BRPM
After the rake task is executed, you cannot restore the deleted data. Perform the following steps for purging data for a specified period.
Go to RPMhome\releases\yourCurrentVersion\RPM\portal.war\WEB-INF 5.0.03.004 or later or RPMhome\releases\yourCurrentVersion\RPM 5.0.03.003 or EARLIER and set the environment variable by running the following command.
./opt/bmc/RLM5.0.03/bin/setenv.shRun the rake task.
The rake task where date is specified in a DD/MM/YYYY format and the flag value for include_plan_request is YES, is shown as follows:
Rake task for deleting requests that include requests associated with a planjruby -S rake purge_data:requests_with_dependency["05/02/2018","yes"] RAILS_ENV=productionFor examples of the rake tasks including combinations of two or more parameters, see Examples of rake tasks.
Rake task for deleting requestsjruby -S rake purge_data:requests_with_dependency["05/02/2018"] RAILS_ENV=productionThe following sample message is displayed.
Version 5.0.03.004RAILS_ROOT=/opt/bmc/RLM/releases/5.0.03.004/RPM/portal.war/WEB-INF
W, [2019-12-13T15:58:32.015000 #23527] WARN -- Wildfly:
Creating scope :descending. Overwriting existing method Audit.descending.
W, [2019-12-13T15:58:33.248000 #23527] WARN -- Wildfly:
Creating scope :active. Overwriting existing method User.active.
W, [2019-12-13T15:58:33.250000 #23527] WARN -- Wildfly:
Creating scope :inactive. Overwriting existing method User.inactive.
This rake task will delete all requests older than
2020-02-05T00:00:00+00:00
Please wait preparing estimates...
W, [2019-12-13T15:58:49.783000 #23527] WARN -- Wildfly:
Creating scope :problem. Overwriting existing method Step.problem.
W, [2019-12-13T15:58:50.825000 #23527] WARN -- Wildfly:
Creating scope :scheduled. Overwriting existing method Step.scheduled.Version 5.0.03.003 or earlierRAILS_ROOT=/opt/bmc/RLM5.0.03/releases/5.0.03.00/RPM
W, [2018-02-05T23:24:04.033000 #16109] WARN -- TorqueBox: Creating scope :descending. Overwriting existing method Audit.descending.
W, [2018-02-05T23:24:11.528000 #16109] WARN -- TorqueBox: Creating scope :active. Overwriting existing method User.active.
W, [2018-02-05T23:24:11.530000 #16109] WARN -- TorqueBox: Creating scope :inactive. Overwriting existing method User.inactive.
This rake task will delete all requests older than 2018-02-05T00:00:00+00:00
Please wait preparing estimates...
W, [2018-02-05T23:24:41.552000 #16109] WARN -- TorqueBox: Creating scope :problem. Overwriting existing method Step.problem.
W, [2018-02-05T23:24:46.199000 #16109] WARN -- TorqueBox: Creating scope :scheduled. Overwriting existing method Step.scheduled.
=========================================================================================================
SERVERS_STEPS: 143,183
STEP_EXECUTION_CONDITIONS: 3
LARGE_STRINGS: 0
AUDITS: 686,865
STEP_SCRIPT_ARGUMENTS: 143,279
SCHEDULED_JOBS: 8,830
NOTES: 79,502
AUTOMATION_QUEUE_DATA: 0
JOB_RUNS: 70,660
UPLOADS: 904
LINKED_ITEMS: 0
STEP_HOLDERS: 0
STEP_REFERENCES: 72
SERVER_ASPECTS_STEPS: 1,002
SERVER_GROUPS_STEPS: 0
DATA_RETRIEVER_VALUES: 6
STEPS: 90,580
ACTIVITY_LOGS: 443,578
REQUEST_PROPERTIES: 339
PROPERTY_VALUES: 0
TEMPORARY_PROPERTY_VALUES: 310
MESSAGES: 0
EMAIL_RECIPIENTS: 24,475
REQUEST_PACKAGE_CONTENTS: 0
REQUESTS: 10,004
---------------------------------------------------------------------------------------------------------
Total tables: 25, records: 1,703,592
=========================================================================================================
Are you sure you want to delete requests? [y/n]- Type y to continue with the purging and press Enter.
- You can type n to skip the purging task. The database tables that are cleaned are displayed in the console.
After the rake task is executed successfully, the following sample message is displayed with the location of the log file.
elapsed_time: 6.5 mm.ss
Detailed log is
located at:
/opt/bmc/RLM5.0.03/releases/5.0.03.00/RPM/log/purge_data_requests_with_dependency.log
Examples of rake tasks
New in 5.0.04
New in 5.0.04
New in 5.0.04
New in 5.0.04