6 Managing Database Partitions
Learn how to organize your Oracle Communications Billing and Revenue Management (BRM) cloud native database by using partitioned tables.
Topics in this document:
Converting Nonpartitioned Classes to Partitioned Classes
If you did not enable partitioning for one or more storable classes when you deployed BRM cloud native, you can do so after deployment. The partitioning conversion feature splits a storable class's table in the BRM database into the following partitions:
-
partition_migrate: Holds all objects created before the nonpartitioned storable classes were converted to partitioned storable classes. The BRM purge utility, partition_utils, cannot purge objects in this partition. To purge them, you must develop your own tools based on sound Oracle database management principles.
-
partition_historic: Holds nonpurgeable events created after the nonpartitioned storable classes were converted to partitioned storable classes. Nonpurgeable events should not be purged from the database.
-
partition_last: A spillover partition that is not intended to store objects you want to purge or preserve. If you do not add purgeable partitions to your tables before BRM resumes generating objects, purgeable objects created after the upgrade are stored in this partition.
To convert nonpartitioned storable classes to partitioned storable classes, perform these tasks:
-
Add the following lines to the oc-cn-helm-chart/brmapps_scripts/loadme.sh script:
#!/bin/sh cd /oms/apps/partition; perl partitioning.pl ClassName exit 0;
where ClassName is the name of the storable class that you want to partition, such as /product or /bill.
-
The brm-apps-partition-cfg ConfigMap (configmap_partition_cfg.yaml) controls your conversion parameters, such as your database's name and the partition logging directory. If necessary, edit the parameters in the file and then run the helm upgrade command.
-
Enable the brm-apps job. In your override-values.yaml file for oc-cn-helm-chart, set ocbrm.brm_apps.job.isEnabled to true.
-
Run the helm upgrade command to update the BRM Helm release:
helm upgrade BrmReleaseName oc-cn-helm-chart --values OverrideValuesFile -n BrmNameSpace
where:
-
BrmReleaseName is the release name for oc-cn-helm-chart and is used to track this installation instance.
-
OverrideValuesFile is the file name and path to your override-values.yaml file.
-
BrmNameSpace is the namespace in which to create BRM Kubernetes objects for the BRM Helm chart.
-
The brm_apps job runs a series of partitioning scripts that perform the conversion.
Check the log and pinlog files in the directory specified by the $PARTITION_LOG_DIR parameter in your configmap_partition_cfg.yaml file. These log files show how long each script took to run and list any errors that occurred. If any errors are reported, fix them and rerun the script.
Adding Partitions to Your BRM Cloud Native Database
You can add partitions to your database by using the partition_utils utility. For information about the utility's syntax and parameters, see "partition_utils" in BRM System Administrator's Guide.
To add partitions to the database in your BRM cloud native environment:
-
Add the appropriate lines for running the partition_utils utility to the oc-cn-helm-chart/brmapps_scripts/loadme.sh script.
For example, these lines add delayed event partitions for 12 months:
#!/bin/sh cd /oms/apps/partition; partition_utils -o enable -t delayed -c /event/delayed/session% cd /oms/apps/partition; partition_utils -o add -t delayed -s StartDate -u month -q 12 -f exit 0;
where StartDate is the starting date for the new partitions in the format MMDDYYYY. The start date must be the day after tomorrow or later. You cannot create partitions starting on the current day or the next day. For example, if the current date is January 1, the earliest start date for the new partition is January 3.
-
The brm-apps-partition-cfg ConfigMap (configmap_partition_cfg.yaml) controls your conversion parameters, such as your database's name and the partition logging directory. If necessary, edit the parameters in the file.
-
Enable the brm-apps job. In your override-values.yaml file for oc-cn-helm-chart, set ocbrm.brm_apps.job.isEnabled to true.
-
Run the helm upgrade command to update the BRM Helm release:
helm upgrade BrmReleaseName oc-cn-helm-chart --values OverrideValuesFile -n BrmNameSpace
The brm_apps job runs a series of partitioning scripts that perform the conversion.
Dropping Partitions from Your BRM Cloud Native Database
You can drop a subset of real-time, delayed-event, or prepaid partitions that occur between a specified start date and end date. By default, partitions that contain objects associated with open items are not removed. You can use the -f parameter to remove partitions that contain objects associated with open items, but this parameter must be used with care.
Note:
Before you remove partitions that contain objects associated with open items, verify that removing them does not conflict with your business practices.
To drop partitions from the database in your BRM cloud native environment:
-
Add the appropriate lines for running the partition_utils utility to the oc-cn-helm-chart/brmapps_scripts/loadme.sh script. Include the -f option to remove partitions even if they contain objects associated with open items.
#!/bin/sh cd /oms/apps/partition; partition_utils -o remove -s StartDate -e EndDate [-f] exit 0;
where:
-
StartDate is the start of the date range for the objects you want to remove. The format is MMDDYYYY.
-
EndDate is the end of the date range for the objects to remove. The format is MMDDYYYY.
-
-
By default, you can only remove partitions that are older than 45 days. To change the 45-day limitation, edit the following entries in the pin-conf-config-brm-apps-1 ConfigMap (configmap_pin_conf_brm_apps_1.yaml):
-
$MAX_REMOVE_REAL{'older_than'}
-
$MAX_REMOVE_DELAYED{'older_than'}
-
$MAX_REMOVE_PREPAID{'older_than'}
For more information, see "Customizing Partition Limitations" in BRM System Administrator's Guide.
-
-
The brm-apps-partition-cfg ConfigMap (configmap_partition_cfg.yaml) controls partition parameters, including the database name and the partition logging directory. If you need to change the partition parameters, edit them in the file.
-
Enable the brm-apps job. In your override-values.yaml file for oc-cn-helm-chart, set ocbrm.brm_apps.job.isEnabled to true.
-
Run the helm upgrade command to update the BRM Helm release:
helm upgrade BrmReleaseName oc-cn-helm-chart --values OverrideValuesFile -n BrmNameSpace
The brm_apps job runs a series of partitioning scripts that remove the partitions.