Siebel Performance Tuning Guide > Analyzing Siebel ARM Data > Analyzing Siebel ARM Files using the Siebel ARM Query Tool >

Using Macros with the Siebel ARM Query Tool

The Siebel ARM Query Tool supports the use of macros. A macro allows you to save and reuse complex queries to a file which you can subsequently use as input for the Siebel ARM Query Tool.

To create a macro, you need to:

  • Write the syntax of your query in a .CFG file (for example, macro.cfg)

    Each part of the query should appear on a separate line in the .CFG file

  • Define a name for the macro which you insert before the first line of your query in the .CFG file

For example, the following query that retrieves data on the average login time for users can be input as one entry from the command line:

> sarmquery -input d:\sarmdata -select source=web -select subarea=swse_login -select tree=all -select depth=1 -aggregate user -output avginclresp=stdout.txt

However, in the .CFG file the above query is assigned the macro name [Login] and appears as follows:


-input d:\sarmdata

-select source=app

-select subarea=objmgr_sess_relogin

-select tree=all

-select depth=1

-aggregate user

-output avginclresp=stdout.txt

For the Siebel ARM Query Tool to use a macro, you need to specify two parameters:

  • The location of the .CFG file that contains the macro

    NOTE:  A .CFG file can contain multiple macros.

  • The name of the macro to execute

The following example requests that the Siebel ARM Query Tool execute the Login macro which is saved in the macro.cfg file.

> sarmquery -config file=macro.cfg -config macro=Login

The Siebel ARM Query Tool reads the input arguments for the macro as if you had specified the individual parts of the macro on the command line. This means that you can specify additional arguments that may not be in your macro. The following example executes the Login macro and in addition specifies a time slice:

> sarmquery -config file=macro.cfg -config macro=Login -select starttime="2004-06-10 10:00:00" -sel endtime="2004-06-11 09:59:59"

For a complete description of the macro language syntax and other options, execute the following command from the command line:

> sarmquery -macrosyntax

Siebel Performance Tuning Guide Copyright © 2006, Oracle. All rights reserved.