18 Using Commands with Oracle BAM

This chapter describes how to use the BAMCommand command-line utility to export, import, migrate, clear, and delete BAM metadata, data, and project artifacts. It also describes how to use the loadgen utility to simulate a data stream.

This chapter includes the following sections:

18.1 Using BAMCommand

This section describes how to run the BAMCommand command-line utility locally or remotely, and how to export, import, migrate, clear, and delete BAM metadata, data, and project artifacts.

This section includes the following topics:

18.1.1 Executing BAMCommand

BAMCommand can be executed from the FMW_HOME\soa\bam\bin directory on the Windows platform and from FMW_HOME/soa/bam/bin on UNIX platforms.

Entering bamcommand on the command line by itself lists the BAMCommand operations and parameters.

Before executing BAMCommand, you must set the JAVA_HOME environment variable to point to the root directory of the supported version of the Java Development Kit. See the Oracle BAM support matrix on the Oracle Technology Network web site for supported JDK versions.

18.1.2 Using the BAMCommand Configuration File

Use the BAMCommand configuration file to preset BAMCommand parameters and not have to type them on the command line each time you use BAMCommand. Command-line parameters override parameters in the configuration file. This file is located at FMW_HOME/soa/bam/bin/BAMCommandConfig.xml.

Here is an example BAMCommandConfig.xml file:

<host>www.example.com</host>
<port>7001</port>
<username>weblogic</username>
<password>abcdefg1</password>
<dbusername>SOAINFRA</dbusername>
<dbpassword>abcdefg1</dbpassword>
<dburl>jdbc:oracle:thin:@localhost:1521:orcl</dburl>

18.1.3 Running BAMCommand Remotely

You can run BAMCommand from a remote system (where Oracle BAM is installed) and execute the commands on a server located remotely. To run BAMCommand remotely, specify the properties -host and -port on the command line or in FMW_HOME/soa/bam/bin/BAMCommandConfig.xml, as shown below.

<host>www.example.com</host>
<port>7001</port>

The Oracle BAM version installed on the remote system should be same as the Oracle BAM Server version (that is, both servers should be from the same label).

18.1.4 Specifying the Command and Parameter Syntax

The basic structure of the BAMCommand command-line entry is as follows:

bamcommand [-host host] [-port port] [-username username] [-logfile filename] [-logmode [overwrite|append]] -cmd operation -param value...

All operation-specific parameters on the command line are in the following form:

-param value

The param portion is not case sensitive. If the value portion contains spaces or other special characters, it must be enclosed in double quotation marks. For example:

bamcommand -cmd export -name "/Samples/Call Center" -file "C:\CallCenter.zip"

This section includes the following topics:

18.1.4.1 Specifying General Parameters

The following parameters can be used in any BAMCommand commands:

  • cmd

    -cmd operation
    

    Specifies a single operation to be executed. Any parameters needed for the operation must also be on the command line.

    The cmd and cmdfile parameters are mutually exclusive. Exactly one of them must be present.

  • cmdfile

    -cmdfile filename
    

    Specifies the name of an XML file that contains operations to be processed. The XML file extension is optional.

    The cmd and cmdfile parameters are mutually exclusive. Exactly one of them must be present.

    The following is an example command file:

    <OracleBAMCommands continueonerror="1">
      <Export id="1" type="dataobject" name="DO1" file="file1"/>
      <Export id="2" type="dataobject" name="DO2" file="file2"/>
    </OracleBAMCommands>
    

    See Command File Structure for more information.

  • host

    -host www.example.com
    

    Optional parameter that specifies the host name of the Oracle BAM server. The default host name is specified in the default BAMCommand configuration file. See Running BAMCommand Remotely for more information.

  • port

    -port port
    

    Optional parameter that specifies the port of the Oracle BAM server. The default port is 7001, and is specified in the default BAMCommand configuration file. See Running BAMCommand Remotely for more information.

    If the Oracle BAM Server port number is changed from the default during the setup and configuration of Oracle BAM, then you must manually change the port number from 7001 to the new port number in the BAMCommand configuration file FMW_HOME/soa/bam/bin/BAMCommandConfig.xml.

  • username

    -username username
    

    Optional parameter that specifies the username that the command should run as. See Specifying Security Credentials for more information. BAMCommand prompts for the password unless it is configured in the FMW_HOME/soa/bam/bin/BAMCommandConfig.xml file.

  • logfile

    -logfile filename
    

    Optional parameter that specifies the name of the file to which results and errors are logged. If the file does not exist, it is created. If the file does exist, any existing contents are overwritten or appended to according to the logmode setting. If this parameter is not present, results and errors are output to the console.

    See Log File Structure for more information.

  • logmode

    -logmode [overwrite|append]
    

    Optional parameter that indicates whether an existing log file is to be overwritten or appended to. If this parameter is not present, overwrite is the default.

18.1.4.2 Specifying Security Credentials

BAMCommand requires users to provide security credentials when running operations. If no security credentials have been specified in the configuration file, BAMCommand securely prompts for a user name and password.

To use default credentials, add the username and password properties to the FMW_HOME/soa/bam/bin/BAMCommandConfig.xml file. For example:

<username>weblogic</username>
<password>abcdefg1</password>

However, the -username command-line parameter always overrides the username property specified in the configuration file.

The user name and password for running BAMCommand operations can come from the configuration file or command-line prompts. You can also specify the user name as a command-line parameter. The options are as follows:

  • If the user name and password are only specified in the configuration file (that is, -username parameter is not used in the command line), then the username and password values in the configuration file are used.

  • If only the user name is specified in the configuration file and the password is not, then the user name value is used, and BAMCommand prompts the user for the password at the command line.

  • If user name is specified on the command line, then that value is used, and BAMCommand prompts the user for a password. The password prompt occurs regardless of any properties specified in the configuration file. For example:

    bamcommand -cmd export -name TestDO -file C:\TestDO.zip -username username
18.1.4.3 Specifying Object Names

Whenever an object name is specified in a command, the following rules apply.

When specified on a command line, if the name contains spaces or characters that have special meaning to DOS or UNIX, the name must be quoted according to the rules for command lines.

Project artifacts must be prefixed by the project name. For example:

-name MyProject/MyAlert

The full internal name of data objects must be specified.

18.1.5 Summary of Individual Operations

This section summarizes the parameters for each BAMCommand operation. You can display a summary of these operations in the command window by entering bamcommand (without any parameters) at the command prompt.

Table 18-1 summarizes the operations available in BAMCommand.

Table 18-1 BAMCommand Operation Summary

Operation Parameters

clear

-name itemname

[-type [dataobject]]

For more information about clear see Clear.

delete

[-all [0|1]]

[-match pattern]

-name "projectname/itemname"

[-regex regularexpression]

[-type [dataobject|project|view|businessquery|dashboard|alert|kpi|parameter|ems|all]

For more information about delete see Delete.

export

[-all [0|1]]

[-append [0|1]]

[-contents [0|1]]

[-dependencies [0|1]]

-file filename

[-layout [0|1]]

[-match pattern]

-name "projectname/itemname"

[-owner [0|1]]

[-regex regularexpression]

[-type [dataobject|project|view|businessquery|dashboard|alert|kpi|parameter|ems|all]

For more information about export see Export.

import

[-batchsize integer]

[-contents [0|1]]

[-continueonerror [0|1]]

[-datamode [error|append|overwrite|update]]]

[-datatruncate [0|1]]

[-dbusername dbusername]

[-dburl dburl]

[-dbdriver dbdriver]

-file filename

[-migrate [0|1]]

[-mode [error|append|overwrite|update]]]

-name "projectname/itemname"

[-preserveowner [0|1]]

-setcol "columnname/overridevalue"

[-type [dataobject|project|view|businessquery|dashboard|alert|kpi|parameter|ems|all]

[-upgrade [0|1]]

For more information about import see Import.

rename

-name "projectname/itemname"

-newdisplayname "projectname/itemname"

[-type [dataobject|project|view|businessquery|dashboard|alert|kpi|parameter|ems]

For more information about rename see Rename.

start

bamcommand -cmd start -name <ems_name> -type ems

stop

bamcommand -cmd stop -name <ems_name> -type ems

18.1.6 Detailed Operation Descriptions

This section details each of the BAMCommand operations, including their parameters, and gives examples. It includes the following topics:

18.1.6.1 Clear

Clears the contents of a data object from the Oracle BAM server.

Table 18-2 Clear Operation Parameters

Parameter Description

-name itemname

The name of the item to be cleared. Required.

-type itemtype

The type of the item to be cleared. dataobject is the only allowed value and the default if this parameter is omitted. This is outlined through an example as follows.

Here is an example of how you can clear a data object:

bamcommand -cmd clear -name "Call Center" -type dataobject
18.1.6.2 Delete

Deletes an item from the Oracle BAM server.

Table 18-3 Delete Operation Parameters

Parameter Description

-all [0|1]

Controls whether all items of the specified type are deleted (This is illustrated in an example command statement after this table).

A nonzero or omitted value means delete all items of the specified type, a zero (0) value means only delete the named (or matched) items. Zero is the default if this parameter is omitted.

-match pattern

A DOS-style pattern matching string, using the asterisk (*) and question mark (?) characters. The items whose names match the pattern are deleted. This is illustrated in an example command statement after this table.

-name "projectname/ itemname"

The name of the item to be deleted. For project artifacts, the name of the project must be specified as a prefix.

-regex regularexpr

A regular expression pattern matching string. The items whose names match the pattern are deleted. See Regular Expressions for more information.

-type itemtype

The type of the item to be deleted. The following are valid:

  • dataobject (This is illustrated in an example command statement after this table)

  • project

  • view

  • businessquery

  • dashboard

  • alert

  • kpi

  • parameter

  • ems (Enterprise Message Source) (This is illustrated in an example command statement after this table.)

  • all

dataobject is the default if this parameter is omitted.

Here is an example of how you can delete a data object. This command deletes a data object named TestDO. Note that the dataobject type is assumed if the -type parameter is not specified.

bamcommand -cmd delete -name TestDO 

The following command deletes all objects of type EMS:

bamcommand -cmd delete -type ems -all 1

You can also delete items that have a common prefix at one go. For example, this command deletes all items that have names beginning with ACME.

bamcommand -cmd delete -match "ACME*" -type all
18.1.6.3 Export

Exports information about one or more objects in the Oracle BAM server to a ZIP file. See Export File Structure for an example of an export file.

Table 18-4 Export Operation Parameters

Parameter Description

-all [0|1]

Controls whether all items of the specified type are exported.

A nonzero or omitted value means export all items of the specified type, a zero value means only export the named (or matched) items. Zero (0) is assumed if this parameter is omitted.

For projects and project artifacts, only the items owned by the user running BAMCommand are exported, unless the user running BAMCommand is an administrator. When an administrator runs BAMCommand, any user's items may be exported.

-append [0|1]

Controls whether exported information is appended to existing ZIP files.

A nonzero or omitted value means append items of the specified type, a zero value means overwrite them. Zero (0) is assumed if this parameter is omitted.

-contents [0|1]

Controls whether content information (row, column values) is to be exported. Applies only to data objects. Cannot be used with the -type all parameter because the contents parameter is not available for other artifacts.

A nonzero value means export the content information. Zero (0) means do not export the content information. A nonzero value is the default if this parameter is omitted.

In addition, can only be used when:

  • All the data objects are exported using the parameter -all 1.

  • A set of data objects is exported using the regex or match parameter.

  • A single data object is exported.

-dependencies [0|1]

Controls whether dependent items are exported with the specified items.

A nonzero or omitted value means include dependent items, a zero value means ignore them. Zero (0) is assumed if this parameter is omitted.

-file filename

The name of the ZIP file to export to. Required.

If the file does not exist, it is created. If the file does exist, any contents are overwritten. The default extension is .zip.

-layout [0|1]

Controls whether data object layout (metadata) is exported.

A nonzero value means export the layout, a zero value means do not. Zero (0) is assumed if this parameter is omitted.

-match pattern

A DOS-style pattern matching string, using the asterisk (*) and question mark (?) characters. The items whose names match the pattern are exported.

-name "projectname/ itemname"

The internal name of the item to be exported. For project artifacts, the name of the project must be specified as a prefix.

-owner [0|1]

Controls whether ownership information is exported.

A nonzero value, such as -owner nonzero or -owner means export the ownership information, a zero value means do not. Zero (0) is assumed if this parameter is omitted, for example, -owner 0 or without the -owner option including total name -owner and its value such as bamcommand -cmd import -name DO.

-regex regularexpr

A regular expression pattern matching string. The items whose names match the pattern are exported. See Regular Expressions for more information.

-type itemtype

The type of the item to be exported. The following are valid:

  • dataobject

  • project

  • view

  • businessquery

  • dashboard

  • alert

  • kpi

  • parameter

  • ems (Enterprise Message Source)

  • all

dataobject is the default if this parameter is omitted.

You can export a data object as follows:

bamcommand -cmd export -name "CallCenter" -file "C:\CallCenter.zip"

Note that the -type parameter was not included in this example. By default dataobject is the -type if it is not specified.

To export data object contents, use the following command format:

bamcommand -cmd export -name TestDataObject -contents 1 -file "C:/TestDataObjectData.zip"

Here is an example of how you can export data objects using the 'Match' parameter:

bamcommand -cmd export -match "M*" -file "C:/DOstartingwithM.zip"

Here's an example of how you can export a project:

bamcommand -cmd export -name MyProject -type project -file "C:\MyProject.zip"

Here is an example of how you can export a business view:

bamcommand -cmd export -name "MyProject/BarChart" -type view -file "C:\BarChart.zip"

Note that the project name and a slash (/) precede the view name.

Here is an example of how you can export a business query:

bamcommand -cmd export -name "MyProject/CallsPerHour" -type businessquery -file "C:\CallsPerHour.zip"

Note that the project name and a slash (/) precede the query name.

Here is an example of how you can export a dashboard:

bamcommand -cmd export -name "MyProject/CallCenterDash" -type dashboard -file "C:\CallCenterDash.zip"

Note that the project name and a slash (/) precede the dashboard name.

Here is an example of how you can export an alert:

bamcommand -cmd export -name "MyProject/Alert1" -type alert -file "C:\Alert1.zip"

Note that the project name and a slash (/) precede the alert name.

Here is an example of how you can export an Enterprise Manager source:

bamcommand -cmd export -type ems -name TestEMS -file "C:\TestEMS.zip"

Here is how you can export all dashboards in a project:

bamcommand -cmd export -all 1 -name MyProject -type dashboard -file "C:\AllDash.zip"

Note that the project name must be specified.

Here is how you can export all Oracle BAM objects in the system:

bamcommand -cmd export -type all -file "C:\temp\TestAll.zip"
18.1.6.4 Import

Imports information from a previously exported ZIP file or a previous version of BAM to objects in the Oracle BAM server. The objects may be created, replaced, or updated. If an object does not exist, it is created if possible.

For data objects, the input file must contain the layout information necessary to create the data object. If the file contains no content information, an empty data object is created.

Table 18-5 Import Operation Parameters

Parameter Description

-batchsize integer

Applies only if -migrate is used. Specifies the JDBC batch update size for data migration. The default is 10000.

-contents [0|1]

Controls whether content information (row, column values) is to be imported. Applies only to data objects.

A nonzero value means import the content information. Zero (0) means do not import the content information. A nonzero value is the default if this parameter is omitted.

Cannot be used with the -type all parameter because the contents parameter is not available for other artifacts.

Cannot be set to zero when used with the migrate parameter.

In addition, can only be used when:

  • All the data objects are imported using the parameter -all 1.

  • A set of data objects is imported using the regex or match parameter.

  • A single data object is imported.

-continueonerror [0|1]

Applies only if -migrate is used. Determines whether importing of data records continues if an error occurs.

If an error occurs during migration of one data object, other data objects in the same migrate operation are not affected.

A nonzero value means true (continue). Zero (0) means false (do not continue). Zero is the default if this parameter is omitted.

If this parameter is true, rejected data records are written to a BAD file, which can be corrected and then imported in a separate operation. The naming convention for the BAD file is:

dataobjectname_BAD_timestamp.xml

-datamode [error|append|overwrite|update]]

Specifies how imported data interacts with existing data. The BEAM_ID column determines matches.

  • error (default) skips matches between existing and imported data records.

  • append inserts imported records without affecting existing data.

  • overwrite deletes all existing data before importing.

  • update appends records that do not already exist and updates records that do exist. If BEAM_ID is missing, imported data is appended.

To specify how existing items are handled, use the mode parameter. To import the 11g data object schema, use the upgrade parameter.

-datatruncate [0|1]

Applies only if -migrate is used. Determines whether data values exceeding 2000 characters are truncated to 2000 characters.

A nonzero value means true (truncate). Zero (0) means false (do not truncate). One (1) is the default if this parameter is omitted.

If this parameter is false (0) and a data value exceeding 2000 characters is encountered, the -continueonerror parameter determines the action taken.

-dbusername dbusername

-dburl dburl

These parameters apply only if -migrate is used. They specify the connection to the Oracle BAM 12c database. All are required.

For convenience, you can specify these parameters, plus the dbpassword, in the BAMCommandConfig.xml file in addition to the parameters for the 12c database. See Using the BAMCommand Configuration File for more information.

-file filename

The name of the file to import from. Required. This is usually a file created using the export operation. It can also be an XML or CSV file for a data object or enterprise message source from Oracle BAM 11g.

-migrate [0|1]

Applies only to data objects. Imports Oracle BAM 11g data into Oracle BAM 12c.

A nonzero value means true (migrate). Zero (0) means false (do not migrate). Zero is the default if this parameter is omitted.

When -migrate is used, the dbusername and dburl parameters are required and the batchsize parameter is optional.

To import the 11g data object schema, use the upgrade parameter.

See Migrate Considerations for more information.

-mode [error|append|overwrite|update]]

Specifies how imported items interact with existing items having the same names:

  • error (default) disallows import if dependent objects of an artifact are already present in system. For example, if an existing project contains data objects, a project of the same name is not imported.

  • append allows import if the existing item has dependent items and appends to the existing item definition.

  • overwrite removes the existing item having the same name.

  • update allows import if the existing item has dependent items and updates the existing item definition.

To specify how existing data is handled, use the datamode parameter. To import the 11g data object schema, use the upgrade parameter.

-name "projectname/ itemname"

The name of the item to be imported. For project artifacts, the name of the project must be specified as a prefix.

-preserveowner [0|1]

Controls whether ownership information is imported.

A nonzero or omitted value means import the ownership information. A zero value means set the ownership to the user running the import. Zero (0) is assumed if this parameter is omitted.

-setcol "columnname/ overridevalue"

Applies only to data objects. Allows override of column values from the command line during import. The override value can be NULL for no value, NOW for the current datetime, or another value.

-type itemtype

The type of the item to be imported. The following are valid:

  • dataobject

  • project

  • view

  • businessquery

  • dashboard

  • alert

  • kpi

  • parameter

  • ems (Enterprise Message Source)

  • all

all is the default if this parameter is omitted.

-upgrade [0|1]

Applies only to data objects and EMS objects. Imports Oracle BAM 11g artifacts into Oracle BAM 12c.

A nonzero value means true (upgrade). Zero (0) means false (do not upgrade). Zero is the default if this parameter is omitted.

To import 11g data object data, use the migrate parameter.

See Upgrade Considerations for more information.

Here is how you can import a data object and override the schema:

bamcommand -cmd import -name TestDataObject -mode update -type dataobject -file "C:\TestDataObject.zip"

Here is how you can import an 11g data object schema.

bamcommand -cmd import -name OldDataObject -upgrade 1 -type dataobject -file "C:\OldDataObject.xml"

Here is how you can import 11g data:

bamcommand -cmd import -name OldDataObject -migrate 1 -type dataobject 
-file "C:\OldDataObject.xml" -continueonerror 1 
-mode update -dbusername SOAINFRA -dburl jdbc:oracle:thin:@localhost:1511:orcl

Note that the 11g database parameters are required, but the -continueonerror and -mode parameters are optional.

Here is how you can import a query from a project:

bamcommand -cmd import -name "MyProject/CallsPerHour" -type businessquery -file "C:\CallsPerHour.zip"

Note that the project name and a slash (/) precede the query name.

Here is how you can import all objects in the file:

bamcommand -cmd import -file "C:\temp\TestAll.zip"

Note that -type all is the default and not needed.

Here is how you can import an Enterprise Message Source:

bamcommand -cmd import -file "C:\temp\TestEMS.zip" -type ems

Note:

During an EMS import using BAMCommand, regardless of the state of EMS (from when it was previously exported), the EMS will be in the ‘STOP’ state in the target machine.
18.1.6.5 Rename

Changes the display name of an item from the Oracle BAM server. The internal name cannot be changed.

Table 18-6 Rename Operation Parameters

Parameter Description

-name "projectname/ itemname"

The internal name of the item to be renamed. For project artifacts, the name of the project must be specified as a prefix.

-newdisplayname "projectname/ itemname"

The new display name of the item to be renamed. For project artifacts, the name of the project must be specified as a prefix.

The display name is case insensitive for data objects and case sensitive for all other types. It may contain any characters except the forward slash (/), which indicates a folder path. It may have up to 128 characters.

-type itemtype

The type of the item to be renamed. The following are valid:

  • dataobject

  • project

  • view

  • businessquery

  • dashboard

  • alert

  • kpi

  • parameter

  • ems (Enterprise Message Source)

dataobject is the default if this parameter is omitted.

To rename a data object, use the following command. This command gives the display name MyDO to a data object with the internal name of TestDO. Note that the dataobject type is assumed if the -type parameter is not specified.

bamcommand -cmd rename -name TestDO -newdisplayname MyDO

To rename a View, use the following command. This command gives the display name MyView to a business view with the internal name of BarChart1.

bamcommand -cmd rename -type view -name BarChart1 -newdisplayname MyView

18.1.7 Command File Structure

This section contains the following topics:

The command file contains the root tag OracleBAMCommands.

Within the root tag is a tag for every operation to be executed. The tag name is the operation name, and the parameters for the operation are attributes.

Here is a sample command file:

<?xml version="1.0" encoding="utf-8"?>
<OracleBAMCommands continueonerror="1">
  <Export name="Samples/Media Sales" file="MediaSales.xml" contents="0" />
  <Rename name="Samples/Call Center" newdisplayname="Call Centre" />
  <Delete type="EMS" name="WebLog" />
  <Delete type="EMS" name="WebLog2" />
</OracleBAMCommands>

The output of this sample command file is shown in Log File Structure.

18.1.7.1 Operation IDs

This feature is only used when output is being sent to a log file. To make the parsing of log results easier, each operation can be given an ID. This ID is included in the Result or Error elements of any output related to that operation.

Here is a sample input:

<OracleBAMCommands continueonerror="1">
  <Delete id="1" type="dataobject" name="Data Object A"/>
  <Delete id="2" type="dataobject" name="Data Object B"/>
</OracleBAMCommands>

Here's what a sample output file would look like:

<?xml version="1.0"?>
<BAMCommandLog Login="weblogic">
  <Results Command="Delete" ID="1">Data Object &quot;/Data Object A&quot;
 deleted.</Results>
  <Error Command="Delete" ID="2">
    <![CDATA[BAM-02409: There is no Data Object named "Data Object B".
    [ErrorSource="BAMCommandEngine",ErrorID="BAMCommandEngine.DOExist"]]]>
  </Error>
</BAMCommandLog>
18.1.7.2 Continue On Error

Ordinarily, BAMCommand executes operations in a command file until a failure occurs, or until they all complete successfully. In other words, if a command file contains 20 operations, and the second operation fails for any reason, then no further operations are executed. This behavior can be changed by using the continueonerror attribute at either a global level or for each operation.

You can use the continueonerror attribute so that all operations are executed regardless of any failures. Here's how you can enable the Global continueonerror mode:

<OracleBAMCommands  continueonerror="1">
  <Delete id="1" type="dataobject" name="Data Object A"/>
  <Delete id="2" type="dataobject" name="Data Object B"/>
</OracleBAMCommands>

In some cases, continueonerror only applies to the operation that deletes Data Object A. If this operation fails, then BAMCommand outputs the error and continues. But if any other operation fails, BAMCommand stops immediately. Here is how you can enable the operation-level continueonerror mode:

<OracleBAMCommands>
  <Delete id="1" type="dataobject" name="Data Object A" continueonerror="1"/>
  <Delete id="2" type="dataobject" name="Data Object B"/>
  <Delete id="3" type="dataobject" name="Data Object C"/>
  <Delete id="4" type="dataobject" name="Data Object D"/>
</OracleBAMCommands>

18.1.8 Log File Structure

The log file contains the root tag BAMCommandLog.

Within the root tag is an entry for every error or informational message logged.

Errors are logged with the tag Error.

Informational messages are logged with the tag Results.

Both Results and Error tags optionally contain an attribute of the form Command=cmdname, if appropriate, that contains the name of the operation that generated the error or informational message.

The sample log file shown here is the output of the command file given in Command File Structure:

<?xml version="1.0" encoding="utf-8"?>
<BAMCommandLog Login="user_name">
  <Results Command="Export">Data Object "/Samples/Media Sales" exported
 successfully (0 rows).</Results>
  <Results Command="Export">1 items exported successfully.</Results>
  <Results Command="Rename">Data Object "/Samples/Call Center" renamed to
 "/Samples/Call Centre".</Results>
  <Results Command="Delete">Enterprise Message Source "WebLog" deleted.</Results>
  <Error Command="Delete"><![CDATA[Error while processing command "Delete".
 [ErrorSource="BAMCommand", ErrorID="BAMCommand.Error"] There is no Enterprise Message
 Source named "WebLog2". [ErrorSource="BAMCommand",
 ErrorID="BAMCommand.EMSExist"]]]></Error>
</BAMCommandLog>

18.1.9 Export File Structure

Here is an example of the structure of an exported ZIP file:

bam_export.zip:
  -dataobject
    -do1
      -dataobject.xml
      -data.csv
  -project
    -Project1
      -alert
        -alert1
      -view
        -view1
      -businessquery
        -query1
      -continuousquery
        -cquery1
  -project2
    -parameter
      -parameter2
    -view
      -view2
    -businessquery
      -query2
    -dashboard
      -dashboard1
  ...
  -ems
    -ems1

Here is a sample XML schema file resulting from exporting a data object:

<?xml version = '1.0' encoding = 'UTF-8'?>
<ns0:simpleDataObject xmlns:ns0="http://xmlns.oracle.com/bam/bam12">
  <name>SPOTDO</name>
  <id>/dataobject/SPOTDO</id>
  <displayName>SPOTDO</displayName>
  <createdDate>2013-03-14T00:13:49.428</createdDate>
  <modifiedDate>2013-03-14T00:13:49.428</modifiedDate>
  <flexTableConfigured>false</flexTableConfigured>
  <calculatedFields/>
  <timeHierarchies/>
  <cqType>RELATION</cqType>
  <cqArchived>true</cqArchived>
  <cqSource>jms:topic/oracle.beam.server.event.dataobject</cqSource>
  <cqStampType>SYSTEM</cqStampType>
  <slowChangingDimension>false</slowChangingDimension>
  <physicalName>BEAM_VIEW_26</physicalName>
  <eventId>BEAM_ID</eventId>
  <replayAmount>0</replayAmount>
  <hidden>false</hidden>
  <columns>
    <column>
      <name>BEAM_ID</name>
      <id>0aa861629bd445e6929c762bbd4b38ea</id>
      <displayName>BEAM_ID</displayName>
      <length>10</length>
      <nullable>true</nullable>
      <unique>false</unique>
      <precision>0</precision>
      <scale>0</scale>
      <dataType>INT</dataType>
      <columnType>ATTRIBUTE</columnType>
      <hidden>false</hidden>
    </column>
    <column>
      <name>Sales</name>
      <id>c6e271cfef464fe6a7dd250b9ad62b3d</id>
      <length>10</length>
      <nullable>true</nullable>
      <unique>false</unique>
      <precision>0</precision>
      <scale>0</scale>
      <dataType>DECIMAL</dataType>
      <columnType>MEASURE</columnType>
      <hidden>false</hidden>
    </column>
    <column>
      <name>Cost</name>
      <id>42df8b2bd35043cd82b12dd289279e81</id>
      <length>10</length>
      <nullable>true</nullable>
      <unique>false</unique>
      <precision>0</precision>
      <scale>0</scale>
      <dataType>DECIMAL</dataType>
      <columnType>MEASURE</columnType>
      <hidden>false</hidden>
    </column>
    <column>
      <name>Category</name>
      <id>22d80831e48743e897814a23e3d7d549</id>
      <length>10</length>
      <nullable>true</nullable>
      <unique>false</unique>
      <precision>0</precision>
      <scale>0</scale>
      <dataType>VARCHAR</dataType>
      <columnType>DIMENSION</columnType>
      <hidden>false</hidden>
    </column>
    <column>
      <name>Product</name>
      <id>75694c6184cc44199bcec91ee9d30736</id>
      <length>10</length>
      <nullable>true</nullable>
      <unique>false</unique>
      <precision>0</precision>
      <scale>0</scale>
      <dataType>VARCHAR</dataType>
      <columnType>DIMENSION</columnType>
      <hidden>false</hidden>
    </column>
  </columns>
  <indexes/>
  <hierarchies>
    <hierarchy>
      <name>Category</name>
      <id>523992a9e8634e1498e0987cd8adb00b</id>
      <columns/>
    </hierarchy>
    <hierarchy>
      <name>PYPDrill</name>
      <id>8dfe2fce91a740a0a4933b25386718b5</id>
      <columns>
        <columnRef>
          <dataObject>SPOTDO</dataObject>
          <column>Product</column>
        </columnRef>
      </columns>
    </hierarchy>
  </hierarchies>
</ns0:simpleDataObject>

18.1.10 Migrate Considerations

When you use the import operation with the -migrate parameter to bring Oracle BAM 11g data into Oracle BAM 12c, some information is modified.

The following considerations apply to data object migration:

  • You can import from an 11g data object XML or CSV file.

  • If an auto-incr-integer column is present in the 11g data object XML file, its values populate the BEAM_ID column in the 12c data object.

  • If a Timestamp column is present in the 11g data object XML file, its values populate the DATAOBJECT_CREATED column in the 12c data object.

  • If one of the batch inserts fails, and no further processing is done, then the data object state (data object name, batch size, batch number) is written to the dostate-recovery.xml file.

    After you take corrective action and re-run the same command, the processing starts from the point where it failed.

    After successful insertion of records, the corresponding sequence number (for the FLEX table) gets updated in the BEAM_SEQUENCE table.

  • Data values exceeding 2000 characters are truncated to 2000 characters unless the -datatruncate parameter is set to zero, in which case the -continueonerror parameter determines the action taken.

18.1.11 Upgrade Considerations

When you use the import operation with the -upgrade parameter to bring Oracle BAM 11g artifacts into Oracle BAM 12c, some information is modified.

The following considerations apply to data object upgrades:

  • The 11g data object ID is converted to a 12c data object internal name. All special characters and embedded blanks are replaced with underscores and all leading underscores are removed.

  • The 11g data object path and name are combined to form the 12c data object display name.

  • The 11g column IDs are converted to 12c column internal names. All special characters and embedded blanks are replaced with underscores and all leading underscores are removed.

  • If an auto-incr-integer column is present in the 11g data object XML file, its values populate the BEAM_ID column in the 12c data object.

  • If a Timestamp column is present in the 11g data object XML file, its values populate the DATAOBJECT_CREATED column in the 12c data object.

  • An 11g fact data object is converted into two 12c data objects:

    • A 12c simple data object consisting of the 11g non-lookup columns

    • A 12c logical data object consisting of the 11g lookup columns

    The lookup columns must be present in the 11g fact data object XML file or in the 12c schema.

  • An 11g String column is converted to a 12c Varchar column with a width of no more than 2000 characters.

The following considerations apply to external data object upgrades:

  • BAMCommand does not upgrade the external data source referenced by an 11g external data object. You must recreate the external data source before upgrading the 11g external data object, which is mapped to a 12c external data object.

  • An 11g external data object referenced by a standard BAM 11g fact data object is mapped to a 12c simple data object, not to a 12c external data object. You must use a separate operation to migrate the data.

The following considerations apply to EMS upgrades:

  • The 11g EMS Connection Factory details are not retained. The Outbound Connection JNDI is mapped to None. You must create these details manually and choose the 12c JNDI name.

  • The 11g EMS field Start when BAM Server starts is not converted, and the Auto-start field is set to false in 12c. You must start the EMS manually.

  • The 11g EMS definition XML file lacks the data object column data types. Therefore, you must specify data object and EMS definitions in the same XML file if the base data object is not present in the 12c database.

18.1.12 Regular Expressions

The export and delete operations optionally accept a regular expression with the -regex parameter.

A regular expression is a pattern of text that consists of ordinary characters (for example, letters a through z) and special characters, known as metacharacters. The pattern describes one or more strings to match when searching for items by name.

Note:

The behavior of BAMCommand -regex parameter is exactly like the java.util.regex package for matching character sequences against patterns specified by regular expressions.

Table 18-7 contains the complete list of metacharacters and their behavior in the context of regular expressions.

Table 18-7 Metacharacters for Regular Expressions

Character Description

\

Marks the next character as a special character, a literal, a backreference, or an octal escape. For example, 'n' matches the character "n". '\n' matches a newline character. The sequence '\\' matches "\" and "\(" matches "(".

^

Matches the position at the beginning of the input string. If the RegExp object's Multiline property is set, ^ also matches the position following '\n' or '\r'.

$

Matches the position at the end of the input string. If the RegExp object's Multiline property is set, $ also matches the position preceding '\n' or '\r'.

*

Matches the preceding character or subexpression zero or more times. For example, zo* matches "z" and "zoo". * is equivalent to {0,}.

+

Matches the preceding character or subexpression one or more times. For example, 'zo+' matches "zo" and "zoo", but not "z". + is equivalent to {1,}.

?

Matches the preceding character or subexpression zero or one time. For example, "do(es)?" matches the "do" in "do" or "does". ? is equivalent to {0,1}

{n}

n is a nonnegative integer. Matches exactly n times. For example, 'o{2}' does not match the 'o' in "Bob," but matches the two o's in "food".

{n,}

n is a nonnegative integer. Matches at least n times. For example, 'o{2,}' does not match the "o" in "Bob" and matches all the o's in "foooood". 'o{1,}' is equivalent to 'o+'. 'o{0,}' is equivalent to 'o*'.

{n,m}

M and n are nonnegative integers, where n <= m. Matches at least n and at most m times. For example, "o{1,3}" matches the first three o's in "fooooood". 'o{0,1}' is equivalent to 'o?'. Note that you cannot put a space between the comma and the numbers.

?

When this character immediately follows any of the other quantifiers (*, +, ?, {n}, {n,}, {n,m}), the matching pattern is non-greedy. A non-greedy pattern matches as little of the searched string as possible, whereas the default greedy pattern matches as much of the searched string as possible. For example, in the string "oooo", 'o+?' matches a single "o", while 'o+' matches all 'o's.

.

Matches any single character except "\n". To match any character including the '\n', use a pattern such as '[\s\S]'.

(pattern)

A subexpression that matches pattern and captures the match. The captured match can be retrieved from the resulting Matches collection using the $0...$9 properties. To match parentheses characters ( ), use '\(' or '\)'.

(?:pattern)

A subexpression that matches pattern but does not capture the match, that is, it is a non-capturing match that is not stored for possible later use. This is useful for combining parts of a pattern with the "or" character (|). For example, 'industr(?:y|ies) is a more economical expression than 'industry|industries'.

(?=pattern)

A subexpression that performs a positive lookahead search, which matches the string at any point where a string matching pattern begins. This is a non-capturing match, that is, the match is not captured for possible later use. For example 'Windows (?=95|98|NT|2000)' matches "Windows" in "Windows 2000" but not "Windows" in "Windows 3.1". Lookaheads do not consume characters, that is, after a match occurs, the search for the next match begins immediately following the last match, not after the characters that comprised the lookahead.

(?!pattern)

A subexpression that performs a negative lookahead search, which matches the search string at any point where a string not matching pattern begins. This is a non-capturing match, that is, the match is not captured for possible later use. For example 'Windows (?!95|98|NT|2000)' matches "Windows" in "Windows 3.1" but does not match "Windows" in "Windows 2000". Lookaheads do not consume characters, that is, after a match occurs, the search for the next match begins immediately following the last match, not after the characters that comprised the lookahead.

x|y

Matches either x or y. For example, 'z|food' matches "z" or "food". '(z|f)ood' matches "zood" or "food".

[xyz]

A character set. Matches any of the enclosed characters. For example, '[abc]' matches the 'a' in "plain".

[^xyz]

A negative character set. Matches any character not enclosed. For example, '[^abc]' matches the 'p' in "plain".

[a-z]

A range of characters. Matches any character in the specified range. For example, '[a-z]' matches any lowercase alphabetic character in the range 'a' through 'z'.

[^a-z]

A negative range characters. Matches any character not in the specified range. For example, '[^a-z]' matches any character not in the range 'a' through 'z'.

\b

Matches a word boundary, that is, the position between a word and a space. For example, 'er\b' matches the 'er' in "never" but not the 'er' in "verb".

\B

Matches a nonword boundary. 'er\B' matches the 'er' in "verb" but not the 'er' in "never".

\cx

Matches the control character indicated by x. For example, \cM matches a Control-M or carriage return character. The value of x must be in the range of A-Z or a-z. If not, c is assumed to be a literal 'c' character.

\d

Matches a digit character. Equivalent to [0-9].

\D

Matches a nondigit character. Equivalent to [^0-9].

\f

Matches a form-feed character. Equivalent to \x0c and \cL.

\n

Matches a newline character. Equivalent to \x0a and \cJ.

\r

Matches a carriage return character. Equivalent to \x0d and \cM.

\s

Matches any white space character including space, tab, form-feed, and so on. Equivalent to [ \f\n\r\t\v].

\S

Matches any non-white space character. Equivalent to [^ \f\n\r\t\v].

\t

Matches a tab character. Equivalent to \x09 and \cI.

\v

Matches a vertical tab character. Equivalent to \x0b and \cK.

\w

Matches any word character including underscore. Equivalent to '[A-Za-z0-9_]'.

\W

Matches any nonword character. Equivalent to '[^A-Za-z0-9_]'.

\xn

Matches n, where n is a hexadecimal escape value. Hexadecimal escape values must be exactly two digits long. For example, '\x41' matches "A". '\x041' is equivalent to '\x04' & "1". Allows ASCII codes to be used in regular expressions.

\num

Matches num, where num is a positive integer. A reference back to captured matches. For example, '(.)\1' matches two consecutive identical characters.

\n

Identifies either an octal escape value or a backreference. If \n is preceded by at least n captured subexpressions, n is a backreference. Otherwise, n is an octal escape value if n is an octal digit (0-7).

\nm

Identifies either an octal escape value or a backreference. If \nm is preceded by at least nm captured subexpressions, nm is a backreference. If \nm is preceded by at least n captures, n is a backreference followed by literal m. If neither of the preceding conditions exists, \nm matches octal escape value nm when n and m are octal digits (0-7).

\nml

Matches octal escape value nml when n is an octal digit (0-3) and m and l are octal digits (0-7).

\un

Matches n, where n is a Unicode character expressed as four hexadecimal digits. For example, \u00A9 matches the copyright symbol (©).

18.2 Using the Loadgen Utility

This section describes how to use the Loadgen Utility included with the Oracle BAM 12c release.

It includes the following subsections:

18.2.1 Overview of Loadgen

The Loadgen Utility, or load generator, is a simple utility provided by installing the Oracle BAM product and used to simulate a data feed into the BAM Server. It specifically acts on the Persistence Layer using the Enterprise Java Bean (EJB) interface. It is useful for testing the Event Processing Language (EPL) rules in an application without needing to connect to a real-world data feed. It can generate loads for both stream and archived relation data objects (DOs).

The load generator reads one or more XML files that contain the sample data feed information and sends each data item to the configured port. It reads items from the sample data file in order and inserts them into the stream, looping around to the beginning of the data file when it reaches the end; this ensures that a continuous stream of data is available, regardless of the number of data items in the file. One can configure the rate of sent data, from the rate at which it starts, the final rate, and how long it takes the load generator to ramp up to the final rate.

18.2.1.1 Loadgen Features

The load generator is expected to be used during Dashboard testing. This is particularly useful for functional and load testing to simulate production like load scenarios.

The utility supports the following use-case features:

  • Simulating a data feed into the system to support functional testing for the data accuracy of the system. For example, one can use it to feed data to test CQL templates, such as a pattern match with a stream DO or a dashboard with an archived relation DO.

  • Specifying a looping construct to generate ongoing loads.

  • Specifying insert, delete and update events for an archived relation DO, and insert events for a stream DO.

  • Specifying a filter condition to update only certain events.

  • Specifying an initial injection rate and the final injection rate. The period between the initial rate to the final rate is called the ramp up period. After it reaches the final rate state, it injects data at a constant rate until the time period expires.

  • Specifying multiple consumer threads to achieve a high throughput rate.

  • Specifying input data with one or more XML files. The XML files are processed in order. There must be a target DO associated with each event.

  • Specifying batch operations to group multiple events into a single operation.

  • Running Loadgen from a command line in a plain text control file as described in Running Loadgen With a Command Line in a Control File.

  • Specifying the frequency to inject using a fixed period thus accommodating bursts of loads that simulate production deployments, as fully described in Usage Examples.

18.2.2 Configuration and Execution

The bamloadgen command can be executed from the FMW_HOME\soa\bam\bin directory on the Windows platform and from FMW_HOME/soa/bam/bin on UNIX platforms.

Running Loadgen involves the following configuration and execution concerns:

  • Run Loadgen with a command line that calls bamloadgen. The command can be run from an optional executable text file we term a control file, or one can run it directly from a command prompt.

  • The Oracle BAM servers must be running and accessible.

  • The related DOs must be pre-existing in the system and accessible.

  • The system displays runtime messages for the following conditions:

    • The normal processing status, such as the current injection rate.

    • Any exceptions occurring during processing, such as if server is not available, or there is a data mismatch or invalid stream DO in XML file.

  • For an Archived Relation DO update, delete and insert operations are supported, while for a Stream DO only insert operations are supported.

  • Input XML file in XSD format: One can either specify $currentTime as a date value for the system to capture its locale time as input, or one can specify an exact date value, such as “2013-04-29T12:45:00.000-8:00". For XML examples see CRUD XML Insert_ Update_ and Delete Examples.

18.2.2.1 Command-Line Syntax

The command-line calling bamloadgen can be executed directly from a command prompt or it can be run from an executable plain text control file. The command-line syntax supports the generation and control of data flow for any of the following: the specific initial rate, the final rate, ramp-up time, duration and the number of threads. The data source can come from one or more XML files. Syntax examples are as follows for each type of run mode with each variable option value identified in brackets (<...>) which are omitted in the actual command line. See Table 18-8 for a complete descriptive list of available options.

  • Frequency mode without rate ramp-up:

    bamloadgen -XMLFile XMLFile -consumerThread_num thread_num 
    -batch_size batch_size -frequency frequency -duration duration
    
  • Ramp-up mode without frequency:

    bamloadgen -XMLFile XMLFile -consumerThread_num thread_num 
    -state_interval state_interval -ramp_up ramp_up -initial_rate 
    initial_rate -final_rate final_rate -duration duration
    

Table 18-8 Available Command-Line Options

Option Description Data Type Required

XMLFile

The XML files to read into the data object, separate multiple XML files by commas.

String

Yes

batch_size

The number of events grouped in a single operation, default value = 100.

Integer

No

consumerThread_num

The number of threads for each process operation, default value = 1.

Integer

No

queue_size

The size of queue, default value = 100.

Integer

No

frequency

The interval to inject data once in frequency mode, cannot be used together with ramp_up, state_interval, initial_rate, final_rate, default value = 1.

Integer

No

ramp_up

The number in seconds for the load generation to increase from the initial to the final rate, default value = 1.

Integer

No

state_interval

The time for the rate to ramp up from one state to another state, required with ramp_up mode, unit: seconds, default value = 1.

Integer

No

initial_rate

The initial rate of operation, unit: # of event/second, required with ramp_up mode.

Integer

No

final_rate

The final rate of operation, unit: # of event/second, required with ramp_up mode.

Integer

No

duration

Length of time in seconds load generation should continue to run, use 0 to run it indefinitely.

Integer

Yes

username

Specifies the name of the user to be used when logging into the BAM server.

String

Yes

password

Specifies the password for the user specified by -username.

String

Yes

host

Specifies the host name or IP address of the target BAM server. Default: localhost.

String

No

port

Specifies the port number of the target BAM server. Default: 7001.

Integer

No

protocol

Specifies the communication protocol to be used. Can be t3 or t3s for SSL. Default: t3.

String

No

url

Specifies the URL of the target BAM server as an alternative to using -host, -port and -protocol. Default: t3://localhost:7001.

String

No

file

Specifies a control file containing command line arguments to run bamloadgen. See Running Loadgen With a Command Line in a Control File.

String

No

retry_count

The number of retry attempts that should be made to re-establish a failed session. Default: 30.

Integer

No

retry_interval

The number of milliseconds to wait between retry attempts to re-establish a failed session. Default: 1000.

Integer

No

18.2.3 Usage Examples

This sections shows examples of various usage scenarios.

18.2.3.1 Setting the -frequency to Inject Data in Fixed Periods at a Stable Rate

This command injects data once every 2 seconds (-frequency 2), grouping 10 records per injection (-batch_size 10) for a total of 20 seconds (-duration 20). The entire process computes to these records: (20/2)*10 = 100 records inserted.

bamloadgen -XMLFile CALLCENTER_FACT_export.xml -frequency 2 -batch_size 10 -duration 20
18.2.3.2 Inject at a Rate From Initial Rate to Final Rate with a Single File
bamloadgen -XMLFile example -batch_size 100 -state_interval 30 -ramp_up 60 
-initial_rate 1000 -final_rate 3000 -duration 90

This command line reads in the data specified by example1.xml by a speed starting from 1000 records/sec and reaches a final rate of 3000 records/sec within 60 seconds. The period between different rates is 30 seconds (per -state_interval 30), so it takes 2 steps to reach the final rate (-ramp_up or -state_interval = 2). After reaching the final rate, loadgen keeps running at the final rate until it ends at the 90th second (-duration 90). Figure 18-1 depicts this.

Figure 18-1 Example Injection Rate Changes, Initial to Final With a Single File

Description of Figure 18-1 follows
Description of "Figure 18-1 Example Injection Rate Changes, Initial to Final With a Single File"
18.2.3.3 Multiple Threads for Higher Throughput

Specify -consumerThread_num 10 to have 10 threads to process the operation together.

Note:

It might not necessarily achieve a higher rate depending on the local system environment. In testing, -consumerThread_num 20 achieved the best injection rate, and changing to 30 had the same rate as with 20.

bamloadgen -XMLFile example1.xml,example2.xml -batch_size 100 
-consumerThread_num 20 -state_interval 30 -ramp_up 60 
-initial_rate 2000 -final_rate 3000 -duration 90 -username weblogic
18.2.3.4 Multiple XML Input Files
bamloadgen  -XMLFile example1.xml,example2.xml -batch_size 100 -thread_num 10 
-state_interval 30 -ramp_up 60 -initial_rate 1000 -final_rate 3000 -duration 90"

This command line reads in the data specified by example1.xml and example2.xml generating two different producer threads and injects the data to the server. Because there are two producer threads injecting data, each thread runs at ¾ of the total rate, so it goes from 500 ->1000->1500 (event/sec). After injecting the data, the back-end uses 10 consumer threads to process the data operations. Figure 18-2 depicts this.

Figure 18-2 Example Injection Rate Changes With Multiple Input Files

Description of Figure 18-2 follows
Description of "Figure 18-2 Example Injection Rate Changes With Multiple Input Files"
18.2.3.5 Batching Operations to Group Multiple Events Into a Single Operation

One can specify -batch_size 100 to process 100 data entries in one operation. So if the XML file has 500 data entries then each thread will process 100 in its operation.

bamloadgen -XMLFile example_export.xml -batch_size 100 - consumerThread_num 10 
-state_interval 30 -ramp_up 60 -initial_rate 1000 -final_rate 3000 -duration 90
18.2.3.6 Simulate Data for Functional Testing

This command line feeds data to test CQL templates, like a pattern match for a stream DO. If the stream DO includes delete or update, then an exception is thrown.

bamloadgen -XMLFile example1.xml -batch_size 20 -thread_num 10 -state_interval 30 
-ramp_up 60 -initial_rate 50 -final_rate 100 -duration 0

Note:

One can specify -duration 0 in the command line to make the data feed loop run indefinitely.

18.2.3.7 Operating on an Archive Relation DO and a Stream DO

This example specifies insert, delete and update events for an Archived Relation DO and an insert event for a Stream DO. For the update events, one can specify a filter condition for updating certain events. The following command-line runs this example:

bamloadgen -XMLFile example1.xml -batch_size 20 -thread_num 10 -state_interval 30 
-ramp_up 60 -initial_rate 50 -final_rate 100 -duration 90

The following code shows the XML file for Loadgen to update DO xyz, insert and delete DO abc. Both the update and delete data entries have a filter-columns element to process the operations for the corresponding data entry into the database. To operate on an Archive Relation and Stream DO, use the following XML.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dataObjectOperations>
    <operations>
        <update dataobject="xyz">
            <filter-columns>
                <string value="STRING_82" predicate="EQ" name="String_Column"/>
            </filter-columns>
            <update-columns>
                <string value="UPDATED" action="REPLACE" name="String_Column"/>
                <integer value="111" action="REPLACE" name="Integer_Column"/>
                <decimal value="111.10" action="REPLACE" name="Decimal_Column"/>
                <float value="111.11" action="REPLACE" name="Float_Column"/>
                <date value="2011-05-15T09:40:02.111Z" action="REPLACE"
                    name="Date_Column"/>
            </update-columns>
        </update>
        <insert dataobject="abc">
            <insert-columns>
                <date value="2011-05-15T09:40:02.111Z" name="Date_Column"/>
                <decimal value="670.05" name="Decimal_Column"/>
                <float value="52.107746" name="Float_Column"/>
                <integer value="91" name="Integer_Column"/>
                <string value="STRING_36" name="String_Column"/>
            </insert-columns>
        </insert>
        <delete dataobject="xyz">
            <filter-columns>
                <string value="STRING_61" predicate="EQ" name="String_Column"/>
            </filter-columns>
        </delete>
    </operations>
</dataObjectOperations>
18.2.3.8 Running Loadgen With a Command Line in a Control File

Run the following at a command line to run a control file named controlFileExample.txt:

./bamloadgen -file controlFileExample.txt

The control file might then simply contain the following content depending on the intention:

bamloadgen -XMLFile example_export.xml -batch_size 100 - consumerThread_num 10 
-state_interval 30 -ramp_up 60 -initial_rate 1000 -final_rate 3000 -duration 90
18.2.3.9 CRUD XML Insert, Update, and Delete Examples

See the following examples:

  • The CRUD XML for inserting data

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <dataObjectOperations>
        <operations>
            <insert dataobject="PATTERNMATCH_FACT">
                <insert-columns>
                    <date value="$currentTime" name="callCreatedTime"/>
                    <date value="$currentTime" name="callClosedTime"/>
                    <integer value="1" name="callPriority"/>
                    <string value="2" name="productId"/>
                    <integer value="100" name="callWaitTime"/>
                    <integer value="60" name="callProcessingTime"/>
                    <string value="US" name="customerLocationId"/>
                    <string value="CLOSED" name="callStatus"/>
                    <string value="OPEN" name="customerStatus"/>
                </insert-columns>
            </insert>
            <insert dataobject="PATTERNMATCH_FACT">
                <insert-columns>
                    <date value="$currentTime" name="callCreatedTime"/>
                    <date value="$currentTime" name="callClosedTime"/>
                    <integer value="1" name="callPriority"/>
                    <string value="2" name="productId"/>
                    <integer value="200" name="callWaitTime"/>
                    <integer value="120" name="callProcessingTime"/>
                    <string value="CA" name="customerLocationId"/>
                    <string value="WAIT" name="callStatus"/>
                      <string value="OPEN" name="customerStatus"/>
                </insert-columns>
            </insert>
        </operations>
    </dataObjectOperations>
    
  • Here is the CRUD XML for updating data:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dataObjectOperations>
   <operations>
      <update dataobject="xyz">
         <filter-columns>
            <string value="STRING_82" predicate="EQ" name="String_Column"/>
         </filter-columns>
         <update-columns>
            <string value="UPDATED" action="REPLACE" name="String_Column"/>
            <integer value="111" action="REPLACE" name="Integer_Column"/>
            <decimal value="111.10" action="REPLACE" name="Decimal_Column"/>
            <float value="111.11" action="REPLACE" name="Float_Column"/>
            <date value="1901-01-01T01:11:11.111-8:00" action="REPLACE"
               name="Date_Column"/>
         </update-columns>
      </update>
   </operations>
</dataObjectOperations>
  • Here is the CRUD XML for deleting data:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dataObjectOperations>
   <operations>
      <delete dataobject="xyz">
         <filter-columns>
            <string value="STRING_1" predicate="EQ" name="String_Column1"/>
         </filter-columns>
      </delete>
      <delete dataobject="xyz">
         <filter-columns>
            <string value="STRING_2" predicate="EQ" name="String_Column2"/>
         </filter-columns>
      </delete>
   </operations>
</dataObjectOperations>