FreeTDS Configuration and Use

FreeTDS is an application that is installed with Unified Assurance and allows components and rules files to connect to databases besides MySQL. This can then be used with the Generic Database Aggregator, Generic Database Connector or other applications that connect to a database to retrieve data. This GUIDE includes the steps needed to utilize FreeTDS as well as the known configurations that will work with Unified Assurance and an external database.

Notes

Dependencies

Configure FreeTDS

  1. Update the freetds.conf file. One of the Known Configurations below may be used, or the specific settings needed for a particular database.

  2. Update the Unified Assurance Component or the Rules files to use the new configuration settings.

    • Usage example within a Unified Assurance Component for the Generic Database Aggregator or Generic Database Connector

      • DSN - dbi:Sybase:server=(DATA_SOURCE_NAME)

      • Password - (DATABASE_PASSWORD)

      • Username - (DATABASE_USERNAME)

    • Example usage within a Unified Assurance Rules File:

    my $UserName  = '(DATABASE_USERNAME)'; 
    my $Password  = '(DATABASE_PASSWORD)'; 
    my $DBH       = DBI->connect('dbi:Sybase:server=(DATA_SOURCE_NAME)', $UserName, $Password, {PrintError=>1}) or die "unable to connect to server " . $DBI::errstr; 
    my $Query     = '(SQL_QUERY)'; 
    my $STH       = $DBH->prepare($Query) or die "prepare failed for query $Query\n"; 
    $STH->execute() or die "unable to execute query $Query :: error $DBI::errstr"; 
    while (my $row = $STH->fetchrow_hashref()) { 
        (CODE TO PROCESS THE RESULTS GOES HERE) 
    }
    

Known Configurations

Microsoft SQL Server 2000

Here are the freetds.conf configuration settings for a Microsoft SQL 2000 server.

[MyServer2k]
    host        = (DATABASE_SERVER)
    port        = 1433
    tds version = 8.0

Microsoft SQL 2005

Here are the freetds.conf configuration settings for a Microsoft SQL 2005 server.

Note: instance may not be needed in all situations, dependent upon your individual database configuration.

[(DATA_SOURCE_NAME)]
    host        = (DATABASE_SERVER)
    instance    = (INSTANCE_NAME)
    port        = (PORT)
    tds version = 7.0

Example Usage

Here are the freetds.conf settings to connect to a SolarWinds database, which runs on a Microsoft SQL 2005 Server:

[solarwinds]
    host        = solarwinds.(YOUR_DOMAIN).com
    instance    = SOLARWINDS_ORION
    port        = 1433
    tds version = 7.0

Here are the Unified Assurance component settings to connect to the SolarWinds database using the settings in the freetds.conf file:

Microsoft SQL Server 6.x Configuration

Here are the freetds.conf configuration settings for a Microsoft SQL 6.x server.

[MyServer65]
    host        = (DATABASE_SERVER)
    port        = 1433
    tds version = 4.2

Microsoft SQL Server 7.x

Here are the freetds.conf configuration settings for a Microsoft SQL 7.x server.

[MyServer70]
    host        = (DATABASE_SERVER)
    port        = 1433
    tds version = 7.0

Nimbus

Here are the freetds.conf configuration settings for a Nimbus server.

[NimBUS]
    host        = (DATABASE_SERVER)
    port        = 1433
    tds version = 8.0