Using BAM Commands

In this section:

BAM commands provide you with assistance when performing BAM operations. The commands also support subcommands to specify specific actions, as listed and described in the following table.

Action

Description

archive

Given a specific date and time, this action copies all records for transactions that were completed before the given time to a specified set of tables. When successful, these transactions are removed from the active database.

copy

Given a time period or a transaction ID, this action copies all completed transactions identified to a named set of tables.

refresh

This action clears the internal support tables.

list

This action lists the contents of the database.

info

This action displays database configuration information.

BAM commands operate on BAM databases. However, once the generated tables are populated, normal database operations can be used to copy, delete, or manipulate the tables as required. BAM commands are not required in these instances.

BAM commands have one or more operands in common, which are listed and described in the following table.

Operand

Description

Example

<tid>

A single transaction ID, enclosed in quotes.

"80f98d02-2c94-46fc-9a59-72541f05f548"

<pattern>

The distinguishing name of a set of BAM tables. The command will create tables of this pattern if they do not exist in the BAM database.

july

You might use the _fmtdate() function to generate names, such as the name of a month.

<timespec>

A date and time using the YYYY/MM/DDtHH:MM format. The default time is 00:00 if not specified. Abbreviations are available, as described in this section.

2012/6/25t03:15

2012/4/15

iWay Functional Language (iFL) can be used to assist in generating a <timespec>. For example, to specify a date four days in the past, specify the _fmtdate() function as follows:

"_fmtdate('yyyy/MM/dd\\'t\\'hh:mm',_imul(_isub(_now(u),_imul(86400,4)),1000))"

This function subtracts from the current moment the number of seconds in a day, times the number of days, times the milliseconds in a second.

The enclosing double quotes tell the command processor that this is a single operand. The inner escapes pass a single escape-surrounded pattern character as a constant. To work from midnight of seven days ago, the <timespec> operand might be:

"_fmtdate('yyyy/MM/dd,_imul(_isub(_now(u),_imul(86400,7)),1000))"

Use of iFL to generate a <timespec> is useful for scheduled operations. For example, you might set up a schedule to run the command on a weekly basis, archiving information from the prior week.

As a convenience, abbreviations have been created for common specifications. Abbreviations must be spelled out in full.

Abbreviation

Purpose

1week

One week ago, midnight

1month

One month ago, midnight

The <pattern> is also evaluated for iFL. This helps create appropriately named archive databases in a recurring schedule. Users are cautioned that the pattern is used to name the generated databases, and must meet any naming restrictions imposed by the database.



x
BAM Archive Command

The BAM Archive command archives the identified transactions to a named set of tables. This reduces the size of the active tables and improves performance. The command does not copy partial transactions. That is, if a transaction was in execution prior to the -before specification but continued to execute after that time, it will not be archived. Only completed transactions are archived.

Usage:

bam archive <pattern> -before <timespec> [-timeout <seconds>]

The specified information is archived to the tables identified by the pattern.

Note: As only one date applies to the archive command, either -before or -after can be used.

Example:

Enter command:>bam archive july -before 2012/08/01
Archived 3267

All completed transactions will be archived until August 1, 2012.


Top of page

x
BAM Copy Command

The BAM Copy command duplicates the information but does not purge it from the source data tables. This is useful if you need to save specific information for other purposes. The command does not copy partial transactions. That is, if a transaction was in execution prior to the -before specification but continued to execute after that time, it will not be archived. Only completed transactions are archived.

Usage:

bam copy <pattern> [-tid <tid> | -after <timespec> [-before <timespec>]] [-timeout <seconds>]

The transaction information for the specified transaction ID, or the transactions within the time period, are copied. The default -before <timespec> is the current time. The BAM Copy command will swap the before and after <timespec> if necessary to determine the appropriate time period.

Example:

Enter command:>Bam copy saved -tid 06c811fa-ba93-4e9b-9975-97b1cb3b84c8
Saved 1

Top of page

x
BAM Info Command

The BAM Info command provides information about the specified database that is displayed. You can use the * pattern for the current database. This command is provided for troubleshooting purposes, if required. The contents and format of the returned information is not guaranteed to be consistent between releases.

Usage:

bam info [<pattern>]

Example:

Enter command:>bam info * 
DataSource    |UniqueTIDs |TotalTransRecs|StartTime              |EndTime                |Duration                  
BAM_ACTIVITY  |38         |563           |2012-01-18 15:43:26.393|2012-01-27 15:43:29.253|9d 00:00:02.860

Top of page

x
BAM List Command

The BAM List command returns information contained in the specified database. You can use the * pattern for the current database if you want to use filtering parameters. This command is provided for troubleshooting purposes, if required. The contents and format of the returned information is not guaranteed to be consistent between releases.

Usage:

bam info [<pattern> | *] [-tid <tid> | -after <timespec> [-before <timespec>]] [-timeout <seconds>] 

Example:

Enter command:>bam list * -after 12/1/1 -prov sql2k8
DataSource     |TID                                  |StartTime              |EndTime                |Duration                  |TranSteps
BAM_ACTIVITY   |06c811fa-ba93-4e9b-9975-97b1cb3b84c8 |2012-01-20
15:43:06.19 |2012-01-27 15:43:06.453|7d 00:00:00.263           |14        
BAM_ACTIVITY   |072cbbea-9791-4a17-a775-75a73de907f8 |2012-01-23
15:43:07.627|2012-01-27 15:43:07.69 |4d 00:00:00.630           |14        
BAM_ACTIVITY   |153c8188-b5f1-4860-9698-3f72881ae6c5 |2012-01-26
15:43:07.47 |2012-01-27 15:43:07.533|1d 00:00:00.630           |14

Note: This example shows three BAM_ACTIVITY lines, each of which is its own line in the actual system.


Top of page

x
BAM Refresh Command

The BAM Refresh command clears internal reporting tables but does not modify the database itself. Therefore no pattern or other operands are required and will be ignored. This command also clears stale computations and may improve performance.


iWay Software