Question

1
Replies
733
Views
TariniDash Member since 2011 25 posts
Cognizant Technology Solutions India Ltd.
Posted: 5 years ago
Last activity: 5 years 4 months ago
Closed
Solved

Delete safely rulesets through SQL script

Customer has three regions and they are full of junk rule and data. How can we delete rulesets in bulk safely through SQL script?

Pega provided Ruleset delete wizard is not working properly to delete a ruleset. It's stuck and shows the screen calculating ...rule count. I tried deleting version wise but that will take months to delete all the rulesets as there are 100s of rulesets. Any idea or suggestion.?

I am thinking to do it as below. Can somebody sugest this is a safe way to do it?

Back up

*****************

Create Table pr4_base_bck as select * from pr4_base where pyRuleSet = ‘RulesetName’

Create Table pr4_fieldvalue_bck as select * from pr4_fieldvalue where pyRuleSet = ‘RulesetName’

Create Table pr4_rule_bck where as select * from pr4_rule where pyRuleSet = 'RulesetName'

Create Table pr4_rule_file_bck as select * from pr4_rule_file where pyRuleSet = 'RulesetName'

Create Table pr4_rule_flow_bck as select * from pr4_rule_flow where pyRuleSet = 'RulesetName'

Create Table pr4_rule_property_bck as select * from pr4_rule_property where pyRuleSet = 'RulesetName'

Create Table pr4_rule_sysgen_bck as select * from pr4_rule_sysgen where pyRuleSet = 'RulesetName'

Delete

****************

delete from pr4_base where pyRuleSet = ‘RulesetName’

delete from pr4_fieldvalue where pyRuleSet = ‘RulesetName’

delete from pr4_rule where pyRuleSet = 'RulesetName'

delete from pr4_rule_file where pyRuleSet = 'RulesetName'

delete from pr4_rule_flow where pyRuleSet = 'RulesetName'

delete from pr4_rule_property where pyRuleSet = 'RulesetName'

delete from pr4_rule_sysgen where pyRuleSet = 'RulesetName'

***Updated by moderator: Marissa to close post***

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

System Administration Data Integration
Moderation Team has archived post
Share this page LinkedIn