System Center

Updated: December 21, 2016

Applies To: Operations Manager 2007 R2

The System.OleDbProbe probe action module type is used to perform asynchronous queries against a database that supports OLE DB. This module returns the results as System.OleDbData data type.

Use this module to receive OLE DB data within a workflow such as a rule or monitor.

<ProbeActionModuleType ID="System.OleDbProbe" Accessibility="Public" PassThrough="false" Batching="false">  
    <xsd:element name="ConnectionString" type="xsd:string"/>  
    <xsd:element name="Query" type="xsd:string" minOccurs="0" maxOccurs="1"/>  
    <xsd:element name="GetValue" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>  
    <xsd:element name="IncludeOriginalItem" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>  
    <xsd:element name="OneRowPerItem" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>  
    <xsd:element name="DatabaseNameRegLocation" type="xsd:string" minOccurs="0" maxOccurs="1"/>  
    <xsd:element name="DatabaseServerNameRegLocation" type="xsd:string" minOccurs="0" maxOccurs="1"/>  
    <xsd:element name="QueryTimeout" type="xsd:integer" minOccurs="0" maxOccurs="1"/>  
    <xsd:element name="GetFetchTime" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>  
  <ModuleImplementation Isolation="Any">  

The System.OleDbProbe module supports the configuration parameters described in the following table.

ConnectionStringStringRequired parameter. Defines the connection string to the OLE DB database. On systems running Windows 2003 or later, the module encrypts the ConnectionString value.
QueryStringRequired parameter. Defines the query to run against the OLE DB database.
GetValueBooleanOptional parameter. Determines whether or not the module will return the results of the query.
IncludeOriginalItemBooleanOptional parameter. Determines whether or not the item that triggered the module should be included in the result set.
OneRowPerItemBooleanOptional parameter. Determines whether or not the module should return a single data item per row of data. When set to false, all rows are returned as part of a single data item.
DatabaseNameRegLocationStringOptional parameter. Represents a registry key where the name of the database can be found. The registry key must be found under the HKLM registry hive. For example, a valid value could be something like SOFTWARE\Company\Product\1.0\DatabaseName.
DatabaseServerNameRegLocationStringOptional parameter. Represents a registry key where the name of the database server can be found. The registry key must be found under the HKLM registry hive. For example, a valid value could be something like SOFTWARE\Company\Product\1.0\ServerName.
QueryTimeoutIntegerR2 specific. Optional parameter. Represents the query time-out.
GetFetchTimeBooleanR2 specific. Optional parameter. Defines whether or not to return the duration of fetching the result set.

This module does not support blob data access. Any column that contains blob data will return as an empty value.

If you set GetValue to true to return the data from the query, certain datatypes such as decimal and datetime may not return expected data. A workaround is to use the CONVERT function in the Query to convert the data to another type such as varchar.

The System.OleDbProbe module is a native module.

To access the specified OLE DB database, the System.OleDbProbe module implements an OLE DB template. For information about these templates, see OLE DB Templates.

The errors described in the following table can occur from within the System.OleDbProbe module.

11851The module failed to initialize.
11852Logging failure of result data.
11853The module failed to get the result data.
11854The module failed to authenticate to the data source.
11855Query execution failed due to a time-out.
11856The module failed to encrypt the connection string.
11857The module failed to decrypt the connection string.



The following sample XML illustrates how to implement the System.OleDbProbe module in a rule. In this sample, the rule targets a fictional application that stores information about itself in a SQL database. The rule generates an alert for each row whose Status column equals “Error”. Before we can use the OLE DB probe in a rule, we have to define a custom DataSourceModuleType because rules do not directly contain probe action modules.

//First, the custom class definition. Discovery of this class is not included.  
<ClassType ID="Microsoft.Samples.MyApplication" Accessibility="Internal" Abstract="false" Base="Windows!Microsoft.Windows.LocalApplication" Hosted="true" Singleton="false" Extension="false" />  

//Now we define the data source module type. The module will run the probe action every 3600 seconds.  
<DataSourceModuleType ID="Microsoft.Samples.OleDbGetErrorDS" Accessibility="Internal" Batching="false">  
  <Configuration />  
  <ModuleImplementation Isolation="Any">  
        <DataSource ID="Scheduler" TypeID="System!System.Scheduler">  
              <SyncTime />  
            <ExcludeDates />  
        <ProbeAction ID="OleDb" TypeID="System!System.OleDbProbe">  
          <ConnectionString>Provider=SQLOLEDB;Data Source=(local);Integrated Security=SSPy=SSPI"</ConnectionString>  
          <Query>SELECT * WHERE Status='Error'</Query>  
        <Node ID="OleDb">  
          <Node ID="Scheduler" />  

//Now the actual rule.  
<Rule ID="Microsoft.Samples.OleDbRuleGenerateAlertOnError" Enabled="true" Target="Microsoft.Samples.MyApplication" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">  
    <DataSource ID="DS" TypeID="Microsoft.Samples.OleDbGetErrorDS" />  
    <WriteAction ID="Alert" TypeID="Health!System.Health.GenerateAlert">  

The System.OleDbData data output of the Microsoft.Samples.OleDbGetErrorDS module in the above rule would look something like the following:

<DataItem type="System.OleDbData" time="2010-03-10T10:19:00.4146189-08:00" sourceHealthServiceId="88015514-C091-36AE-D102-A0A6AD267C7C">  
   <Column VariantType="3">1</Column>   

For information on the meaning of the elements of the System.OleDbData data type, see System.OleDbData.

Module TypeProbeActionModuleType
Input TypeSystem.BaseData
Output TypeSystem.OleDbData
LibrarySystem. Library