Tuesday, May 01, 2007 2:10 PM
Komal
Ole-DB Module
The Ole-DB module is a probe action module. It is defined in System.Library Management Pack (MP) as System.OleDbProbe. This module takes in the following as various configuration elements:
- ConnectionString
- This is a mandatory string element used for establishing a connection.
- Example Value: Provider=SQLOLEDB;Database=master;Server=.;IntegratedSecurity=SSPI
- Query
- This is an optional string element which when provided is used to query against the provider (info purveyed above).
- Example Value: SELECT COUNT(*) FROM SYSCOLUMNS
- GetValue
- This is an optional boolean element indicating whether the result set from query should be outputted or not.
- Example Value: true
- IncludeOriginalItem
- This is an optional boolean element. Since this module is a probe-action module, it basically needs a trigger in most cases. However, in some scenarios, the input item data needs to be preserved and this element indicates that. A value of true would cause the input item's xml to be outputted.
- Example Value: true
- OneRowPerItem
- If multiple rows are returned by the query string, then setting this optional boolean element would cause multiple items to be outputted each having only one row.
- Example Value: true
- DatabaseNameRegLocation
- This is an optional string element. There might be cases where the database name is not available to you and needs to be read from a registry location (based off HKLM). In short, the DatabaseName is not provided in ConnectionString and the registry location information can be provided here.
- Example Value: SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup\DatabaseName
- DatabaseServerNameRegLocation
- This is an optional string element. And just like DatabaseNameRegLocation, this element allows listing a registry location under HKLM from where Server information can be read from and not from ConnectionString.
- Example Value: SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup\DatabaseServerName
The output from this module is OleDb data defined in the System.Library MP as System.OleDbData and has the following elements in it:
|
XML Tag |
Meaning |
|
HRResult |
indicating if everything went fine |
|
Result |
Detailed result in string representation,
"Success"
"Fetch Failed"
"Execution of query failed"
"Session could not be opened"
"Data Source could not be initialized"
|
|
ResultLength |
Length of Result string above |
|
InitializationTime |
time that took for initialization with given ConnectionString (in ms) |
|
OpenTime |
time that took for opening a session (in ms) |
|
ExecutionTime |
time that took for executing query, if provided, else it is 0 (in ms) |
|
FetchTime |
time that took for fetching the resultSet, if it was fetched, else it is 0 (in ms) |
|
RowLength |
# of rows in resultSet |
|
Columns |
There are as many column tags as there is # of rows (RowLength). |
|
Column |
There are as many Column tags inside each Columns tag, as there is # of columns. |
|
OriginalDataLength |
GetItemXml() is called on original data and the length of returned string is captured here |
|
OriginalData |
GetItemXml() is called on original data and the result is captured here |
Attached is a demo MP demonstrating how Ole-Db module can be used to generate alerts associated with management server when it takes too long to execute a query.