26 Converting Nonpartitioned Classes to Partitioned Classes

If you did not enable partitioning for one or more storable classes when you installed Oracle Communications Billing and Revenue Management (BRM), follow the procedures in this chapter to convert specified nonpartitioned storable classes to partitioned storable classes in the BRM database.

Before partitioning your storable classes, read the following:

About Converting Nonpartitioned Classes to Partitioned Classes

If you did not enable partitioning for one or more storable classes when you installed BRM, you can do so after installation.

The partitioning conversion feature splits the table of a specified storable class 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. See "Event and Item Objects Stored in partition_historic."

  • 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.

Note:

For information on how partitioning is enabled when you install BRM, see "Overview of Enabling Partitioning during Installation".

Converting Nonpartitioned Classes to Partitioned Classes

To convert nonpartitioned storable classes to partitioned storable classes, perform these tasks:

  1. Increasing Disk Space for Tables and Indexes

  2. Installing the Partitioning Package

  3. (Optional) Reconfiguring the Parameters

  4. Merging the pin_setup.values File

  5. Backing Up Your BRM Database

  6. Running the Partitioning Conversion Scripts

  7. Adding Purgeable Partitions to Tables

  8. Restarting BRM

Increasing Disk Space for Tables and Indexes

Before adding partitions to your tables, increase the disk space allocated for the tables and indexes in your BRM database.

Tip:

Oracle recommends that you add enough space for 6 to 12 months of data.

Installing the Partitioning Package

Note:

If you already installed the partitioning package, features in that package cannot be reinstalled without first being uninstalled. To reinstall a feature, uninstall it, and then install it again.

To install the partitioning package:

  1. Download the software to a temporary directory (temp_dir).

    Important:

    • If you download to a Windows workstation, use FTP to copy the .bin file to a temporary directory on your UNIX server.

    • You must increase the heap size used by the Java Virtual Machine (JVM) before running the installation program to avoid ”Out of Memory” error messages in the log file. See "Increasing Heap Size to Avoid 'Out of Memory' Error Messages" in BRM Installation Guide.

  2. Make sure no users are logged in to BRM.

  3. Go to the directory where the Third-Party package is installed and source the source.me file.

    Caution:

    You must source the source.me file to proceed with installation. Otherwise, ”suitable JVM not found” and other error messages appear.

    Bash shell:

    source source.me.sh
    

    C shell:

    source source.me.csh
    
  4. Go to temp_dir and run the following command:

    7.5.0_PartitionUpg_platform_32_opt.bin
    

    where platform is solaris, linux, aix_32, or hpux_ia64.

    Note:

    You can use the -console parameter to run the installation in command-line mode. To use the graphical user interface (GUI) installation, install a GUI application such as X Windows and set the DISPLAY environment variable before you install the software.
  5. Follow the instructions displayed during installation. The default installation directory for the partitioning package is opt/portal/7.5.

    Note:

    The installation program does not prompt you for the installation directory if BRM or the partitioning package is already installed on the machine and automatically installs the package in the directory in which BRM is installed (BRM_Home).
  6. Go to the directory where you installed the partitioning package and source the source.me file:

    Bash shell:

    source source.me.sh
    

    C shell:

    source source.me.csh
    

(Optional) Reconfiguring the Parameters

The partitioning conversion configuration file, partition.cfg, controls the parameters of your conversion. If necessary, change the parameters to meet your business requirements.

To reconfigure the parameters:

  1. Log in as user pin.

  2. Open the BRM_Home/upgrade/partition/partition.cfg file in a text editor such as vi.

  3. Change the default parameters as necessary. For information on each parameter, see the comments in the partition.cfg file.

  4. Save and close the file.

Merging the pin_setup.values File

Copy any customizations from your backed-up pin_setup.values file into the BRM_Home/setup/pin_setup.values file.

Backing Up Your BRM Database

Make a complete offline backup of your BRM database, and make sure the backup is completely valid and usable. For more information on performing full database backups, see your database software documentation.

In addition to the backup, use the Oracle export utility to export all BRM tables. This helps you restore individual tables if necessary.

Running the Partitioning Conversion Scripts

Converting from a nonpartitioned storable class to a partitioned storable class should take about 30 minutes. The size of your tables does not affect the speed of this conversion.

To run the partitioning conversion scripts:

  1. Go to BRM_Home/upgrade/partitioning.

  2. Run the following command:

    perl partitioning.pl
    

This runs a series of scripts that perform the nonpartitioning-to-partitioning conversion.

Check the log and pinlog files in the directory specified by the UPGRADE_LOG_DIR parameter in your partition.cfg file (by default, BRM_Home/upgrade/partition/sqllog). These log files show how long each script took to run and list any errors that occurred.

Important:

If errors are reported, fix them, and rerun the script.

Adding Purgeable Partitions to Tables

Before your BRM system resumes generating data, use the partition_utils script to add purgeable partitions to your newly partitionable tables. See "Adding Partitions".

Restarting BRM

Start all BRM processes. See "Starting and Stopping the BRM System."

Note:

The object IDs of objects generated in your newly partitioned tables will be larger than the object IDs of objects generated in your old, nonpartitioned tables. (Depending on the table, object IDs are stored in either the POID_ID0 field or the OBJ_ID0 field.)

About the Conversion Scripts and Files

Table 26-1 lists the scripts and files used to convert your nonpartitioned storable classes to partitioned storable classes. These scripts and files are in the BRM_Home/upgrade/partition folder.

Important:

To convert custom storable classes, you might need to create additional SQL scripts. To use custom scripts in the conversion, add appropriate SQL file entries to the nonpartitioning-to-partitioning conversion configuration file, partition.cfg. See "(Optional) Reconfiguring the Parameters".

Table 26-1 Conversion Scripts and Files

Script or File Description

crt_pinlog.sql

SQL script that creates the pinlog files.

partition.cfg

Configuration file in which you must enter details about the Oracle database configuration before you run the conversion scripts. All the conversion Perl scripts parse this file to get the database connection parameters.

partitioning.pl

Master Perl script for the conversion process. This script calls other SQL scripts to perform the conversion.

pin_upg_common.sql

SQL script that creates the common routines needed for the conversion.

storable_class_name_tables_tobe_partitioned.sql

Custom SQL scripts that implement partitioning for the specified storable class (storable_class_name).

See "Converting Additional Nonpartitioned Classes to Partitioned Classes."

make_indexes_partition_ready.sql

optional_partitioning.sql

SQL scripts that implement partitioning.

upg_oracle_functions.pl

Perl script that performs many miscellaneous conversion tasks related to the BRM database.


Converting Additional Nonpartitioned Classes to Partitioned Classes

By default, the partitioning conversion feature enables you to convert the event, bill, invoice, item, and journal storable classes.

To convert additional nonpartitioned storable classes to partitioned storable classes:

  1. Create a SQL script named storable_class_name_tables_tobe_partitioned.sql, where storable_class_name is the name of the object type whose table you want to partition.

    For samples, see the following files in the BRM_Home/upgrade/partition/ directory, where BRM_Home is the directory in which BRM components are installed:

    • /event_tables_tobe_partitioned.sql

    • /item_tables_tobe_partitioned.sql

    • /bill_tables_tobe_partitioned.sql

    • /invoice_tables_tobe_partitioned.sql

    • /journal_tables_tobe_partitioned.sql

  2. Add the new SQL script to the @SQL_PARTITION_TABLES parameter in the BRM_Home/upgrade/partition/partition.cfg file.

  3. Run the partitioning.pl script, which converts the specified storable class from nonpartitioned to partitioned.

  4. Run the partition_utils.pl script, which adds purgeable partitions.