6 Running Rated Event Loader

Learn how to run Oracle Communications Billing and Revenue Management (BRM) Rated Event Loader (RE Loader), either manually or automatically using either Batch Controller or the RE Loader daemon.

This information applies only to the original processing method.

You can run RE Loader in the following ways:

  • Manually: see "Running the RE Loader Manually"

  • Automatically using Batch Controller: see "Configuring RE Loader to Run Automatically by Using Batch Controller").

    Batch Controller detects when a file is present in the RE Formatter output directory and starts the RE Loader batch handler. RE Loader batch handler starts the RE Loader utility (pin_rel) to load the events. RE Loader batch handler moves the original file to an archive directory if the records are successfully loaded or to a reject directory if the records are not successfully loaded.

  • Automatically using the RE Loader daemon: see "Configuring RE Loader to Run Automatically by Using the RE Loader Daemon").

    The RE Loader daemon detects when CDR files arrive in the input directory, and then processes them. The RE Loader daemon moves the original file to an archive directory if the records are successfully loaded or to a reject directory if the records are not successfully loaded.

For additional information about running RE Loader specifically with Pipeline Manager, see "About Running RE Loader with Pipeline Manager"

If your CDR files are small, Oracle recommends loading events by using the RE Loader daemon. You should compare the two methods by running them both in a test system.

If any errors occur during event loading, all events loaded in that session are deleted from the database. After events are successfully loaded, if any errors occur during the update procedure, you can correct the errors and then update the relevant events by rerunning the RE Loader utility. The utility detects that the events are loaded correctly and performs only the update procedure. See "Troubleshooting Rated Event Loading".

Running the RE Loader Manually

You can manually run RE Loader from the command line in the following ways:

  • pin_rel event_file_name

    This command loads events from event_file_name into the BRM database and then updates the account balances, bill items, and journals.

    Account balances, bill items, and journals are updated after all events have been loaded. If an error occurs during the loading phase, RE Loader cancels the process and all events loaded in the session are deleted from the BRM database.

    Note:

    For Pipeline Manager, the name of the file in the command line can be found in the pipeline registry file. For more information, see "Configuring EDR Output Processing".

  • pin_rel -override event_file_name

    This command starts an RE Loader process if one is not already running.

    Only one RE Loader process can load the same database tables at the same time because each process locks the tables while loading them. When an RE Loader process is started, it checks the status of its last process and waits if the last process is not complete. However, if the process was manually canceled, the status may not indicate that the process has ended, even though it is no longer running. In this case, you use the -override option to start a new RE Loader process.

Note:

Make sure you synchronize your rating and loading applications when running RE Loader.

See "Rated Event Loader pin_rel Utility" for information about the utility.

Manually Loading Events from One Directory

If you have only one directory and need to load more than one event type, you must make sure pin_rel can find the prerated event data record (EDR) file. pin_rel looks for the EDR file in the directory specified in the Infranet.rel.rated_event_file entry in the Infranet.properties file. Before you run RE Loader manually, make sure the input EDR file is in this specified directory. To do this, do one of the following each time you run RE Loader:

  • Move the EDR file to the directory specified in the Infranet.properties file.

  • Change the Infranet.rel.rated_event_file entry in the Infranet.properties file to point to the directory containing the EDR file.

Manually Loading Events from Multiple Directories

If you have set up multiple directories, run pin_rel in the directory that corresponds to the service event type to load.

Configuring RE Loader to Run Automatically by Using Batch Controller

To run RE Loader automatically, configure Batch Controller and the RE Loader batch handler. When a pre-rated event file is available, Batch Controller automatically starts the RE Loader batch handler, which runs the RE Loader utility (pin_rel).

To configure RE Loader to run automatically, do the following for each instance of RE Loader:

Configuring the RE Loader Batch Handler

To configure the RE Loader batch handler:

  1. Give the SampleRelHandler.pl file a unique name. You will configure Batch Controller to call the handler using this name.

  2. Create the following subdirectories: An archive subdirectory where successfully processed files can be stored and a reject subdirectory where unsuccessfully processed files can be stored.

  3. Open the SampleRelHandler_config.values file and modify the entries shown in Table 6-1.

    Table 6-1 Mandatory RE Loader Batch Handler Configuration Entries

    Entry Description

    $FILETYPE

    Specifies the event record file-name pattern to look for. To load only specific files, change the value of this entry. The default is *.dat.bc (any data file processed by Batch Controller).

    Batch Controller runs the RE Loader batch handler for each file with a name that matches this pattern.

    Tip: You can use an asterisk (*) to represent zero or more characters in the file name. No other wildcards are supported.

    $HANDLER_DIR

    Specifies the full path to the directory containing the RE Loader batch handler, which is this processing directory.

    $pinRELDir

    Specifies the full path to the directory containing the RE Loader application, which is this processing directory.

    $pinREL

    Specifies the full path to the batch application executable.

    $STAGING

    Specifies the full path to the event output directory.

    If you specify a directory other than the event output directory, use the Linux command that links the event output directory to the input staging directory.

    $PROCESSING

    Specifies the full path to the directory from which event record files are processed. The default is defined in the $pinRELDir environment variable.

    This must be the same directory specified in the following RE Loader Infranet.properties entries:

    • infranet.rel.default.interim_directory

    • infranet.rel.storable_class.classname.interim_directory

    $ARCHIVE

    Specifies the full path to the directory where a successfully processed file is archived. This is the archive subdirectory created in step 2. Change this value if you used a name other than the default, $pinRELDir/archive.

    $REJECT

    Specifies the full path to the directory where an unsuccessfully processed file is stored. This is the reject subdirectory created in step 2. Change this value if you used a name other than the default, $pinRELDir/reject.

  4. Save and close the file.

Configuring Batch Controller

The RE Loader package includes Batch Controller. If your system already has Batch Controller installed, the RE Loader installer does not install another. Use the sample Batch Controller properties file (BRM_home/apps/pin_rel/SampleBatchControllerInfranet.properties) to configure Batch Controller.

The default configuration for the sample Batch Controller runs RE Loader batch handler whenever a rated event record file appears in the event output directory. You can change this setting to trigger the RE Loader batch handler at specified times or based on other kinds of occurrences by editing the event entries that trigger the RE Loader batch handler. See "Setting Activity Times and Triggers" in BRM System Administrator's Guide.

The optimal number of RE Loader processes to configure is at least three. Depending on the size of your files and the time it takes to load events, configuring four or five processes might save time.

To configure Batch Controller:

  1. Copy the BRM_home/apps/pin_rel/SampleBatchControllerInfranet.properties file to your BRM_home/apps/batch_controller directory and change its name to Infranet.properties.

  2. Open the BRM_home/apps/batch_controller/Infranet.properties file.

  3. Edit the BRM connection parameters.

    See "Using Configuration Files" in BRM System Administrator's Guide.

  4. Set the relHandler.start.string parameter to the path of the RE Loader batch handler and to the name of the handler script that you gave it when configuring the RE Loader batch handler. See step 1 in "Configuring the RE Loader Batch Handler".

    For example:

    relHandler.start.string    BRM_home/apps/pin_rel/REL_handler_name.pl
    
  5. (Optional) To change the number of RE Loader batch handler processes you want to run, set the maximum batch handler entries.

    Note:

    The number of RE Loader batch handler processes called depends on the number of event record files in the event output directory. If you change these entries, test RE Loader's performance.

    relHandler.max.at.highload.time 3
    relHandler.max.at.lowload.time 3
    
  6. Set the cdrFileEvent.file.location parameter to specify the location of the event output directory:

    cdrFileEvent.file.location /export/Portal/integRate
    
  7. Set the cdrFileEvent.file.pattern parameter to which files should be processed by Batch Controller:

    cdrFileEvent.file.pattern cdr*.dat

    Note:

    You can use an asterisk (*) as a wildcard character to represent zero or more characters in the file name.

  8. Save and close the file.

  9. Stop and restart Batch Controller.

For more information about configuring Batch Controller, see "Controlling Batch Operations" in BRM System Administrator's Guide.

Configuring RE Loader to Run Automatically by Using the RE Loader Daemon

The RE Loader daemon detects when CDR files arrive in the input directory, and then processes them. RE Loader daemon moves the original file to an archive directory if the records are successfully loaded or to a reject directory if the records are not successfully loaded.

To run RE Loader automatically by using the RE Loader daemon:

  1. Configure the RE Loader Infranet.properties file. See "Configuring the Rated Event Loader Infranet.properties File".

  2. Use the pin_ctl utility to run the BRM_home/bin/start_rel_daemon script. See "Running the pin_ctl Utility" in BRM System Administrator's Guide.

To stop the RE Loader daemon, run the BRM_home/bin/stop_rel_daemon script.

You can also run these scripts manually.

About Running RE Loader with Pipeline Manager

You can find information about running RE Loader with Pipeline Manager under the following topics:

About Running RE Loader Manually with Pipeline Manager

When you run RE Loader manually from a command line, you specify the location of the pipeline output file in the command line.

Figure 6-1shows the RE Loader work flow when you run it manually from a command line:

Figure 6-1 Work Flow of Manual Execution of RE Loader

Description of Figure 6-1 follows
Description of "Figure 6-1 Work Flow of Manual Execution of RE Loader"

About Running RE Loader Automatically Using the Batch Controller with Pipeline Manager

To schedule RE Loader to run automatically, you must set up the following components:

  • Batch Controller, which detects when an EDR file is present in the pipeline output directory and starts the RE Loader batch handler.

  • RE Loader batch handler, which moves the EDR file from the pipeline output directory to the RE Loader processing directory and starts the RE Loader utility (pin_rel).

Figure 6-2 shows the RE Loader work flow when you schedule loading of events:

Figure 6-2 Workflow of Scheduled Execution of RE Loader



The following actions are performed when RE Loader is scheduled to run automatically:

  1. Batch Controller detects an EDR file in a pipeline output directory and starts the RE Loader batch handler.

  2. The RE Loader batch handler moves the EDR file from the pipeline output directory to the RE Loader processing directory and starts the RE Loader utility (pin_rel).

  3. RE Loader processes the file, loads the events into the BRM database, and updates the account balances, billing items, and journals. For more information, see "Pipeline Manager RE Loader Process Overview".

  4. RE Loader batch handler moves the original file to an archive directory if the records are successfully loaded or to a reject directory if the records are not successfully loaded.

    Note:

    The RE Loader batch handler loads one file at a time. You can load more than one file at a time by configuring Batch Controller to call several RE Loader batch handler processes. For more information, see "About Running Multiple RE Loader Processes".

About Running the RE Loader Daemon with Pipeline Manager

When you run the RE Loader daemon, the daemon creates RE Loader threads to load EDR files. Each RE Loader thread loads one EDR file. The number of threads that the RE Loader daemon creates depends on the maximum number of threads that you configure to run simultaneously at a particular time. Because you can configure multiple threads that can run at a time, you can load more than one EDR file simultaneously. This helps in increasing loading performance.

For example, if you configure 10 threads to run simultaneously at peak time, the RE Loader daemon creates 10 threads, which means that 10 EDR files are loaded at the same time.

Note:

Running the RE Loader daemon is the preferable method if most of the EDR files that you want to load are of small size.

To run the RE Loader daemon, you must set up the following components:

You can also run the RE Loader daemon by using the pin_ctl utility.

Figure 6-3 shows the RE Loader work flow when you run the RE Loader daemon:

Figure 6-3 Workflow of RE Loader Daemon



The following actions are performed when you run the RE Loader daemon:

  1. The RE Loader daemon detects an EDR file in a pipeline output directory.

  2. The RE Loader daemon creates RE Loader threads up to the maximum number of threads configured.

  3. The RE Loader threads process the files, load the events into the BRM database, and update the account balances, billing items, and journals.

  4. The RE Loader threads move the original file to an archive directory if the records are successfully loaded or to a reject directory if the records are not successfully loaded. These directories are configured in the RE Loader Infranet.properties file.