Inserting perfmon blg data into SQL Server DB

  • I cannot figure out how to insert my blg data into SQL Server.

    So far I have tried this:

    relog log_file_name.blg -cf counterlist.txt -f sql -o sql:???????

    now I don't know what to do - I have a dsn name called sql_dsn and an existing database linked to sql_dsn by default. there are no tables in the database.

    Any suggestions?

  • That looks close. Doing it that way will create three tables in your database: counterdetails, counterdata, displaytoid.

    relog log_file_name.blg -cf counterlist.txt -f sql -o sql:sql_dsn!logfileidentifier

    Another option that might want to consider is to RELOG to a CSV file, then import the CSV file into your database using another method,such as BCP. That would give you a single table to work with.

  • OK, I know this sounds stupid, but what is a logfileidentifier?

  • That's a good question.

    It can be any string you want. For example, you could use the name of the perfomance monitor log or anything that would be meaningful to you.

    After loading the perf data in SQL, open Perfmon and change the soruce to Database, select your System DSN and you'll see that's the name displayed in "Log set".

  • So, it's just the name of the file it logs something to while loading the SQL tables?

    The blg files are created on a Server 2000 machine - that's why I didn't log directly to SQL.

    I'm hoping I can run perfmon on my XP Pro machine to access the SQL data.

  • No, it doesn't have to be the name of the .blg file, that was just an example of something you could use.

    If you're looking to do some reports on the perf data consider using Excel. It works better for creating charts; display times on x-axis, more chart types available, etc. It gives you more options to analyze the data then you could do in the Perfmon MMC.

    Remember, you can use relog to combine multiple BLG files to one output file. So for example, you could combine

    a weeks worth of perfmon log files, output them to a TSV, then open in Excel (or bcp that to SQL).

    ex:

    relog day1.blg day2.blg day3.blg day4.blg day5.blg -f TSV -o oneweek.tsv

  • Hi again, do you happen to know how to pass a user id and password to relog? SQL Server won't give me access. Thanks

  • What is it that SQL server won't give you access too?

    Are you trying to relog directly to SQL? If so, did you use Windows NT authentication or SQL Authentication when setting up the DSN?

  • Now that you mention it...I changed the ODBC connection to use SQL login and gave it permissions, etc. and it works fine now! Thanks so much for the suggestions.

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply