github spaghettidba/WorkloadTools v1.2.0
File in, file out

latest releases: v1.7.1, v1.7.0, v.1.6.5...
5 years ago

A highly requested feature has come to life: now you can save your workload to a file and replay it later to a target SQL Server instance.

The file format is not the same as in traces or extended events, but it is... a database instead. I decided to use SQLite as the intermediate format for WorkloadTools. The reason is that traces can only be written and read from a 32 bit process (sic) because the DLLs are 32 bit only. XEL files are not available in older versions, so I had to choose a different format.

In order to record to a file, you need to use the WorkloadFileWriterConsumer, as in this example:

{
    "Controller": {

        "Listener":
        {
            "__type": "ExtendedEventsWorkloadListener",
            "ConnectionInfo":
            {
                "ServerName": "(local)\\SQL2014"
            },
            "DatabaseFilter": "AdventureWorks"
        },

        "Consumers":
        [
            {
                "__type": "WorkloadFileWriterConsumer",
                "OutputFile": "c:\\temp\\workload.sqlite"
            }
        ]
    }
}

Then you can use the workload you captured with a FileWorkloadListener:

{
    "Controller": {

        "Listener":
        {
            "__type": "FileWorkloadListener",
            "Source": "c:\\temp\\workload.sqlite",
            "SynchronizationMode": "true"
        },

        "Consumers":
        [
            {
                "__type": "ReplayConsumer",
                "ConnectionInfo": 
                {
                    "ServerName": "(local)\\SQL2016",
                    "DatabaseName": "AdventureWorks"
                }
            }
        ]
    }
}

In case you're wondering, yes, I know that you want to work with your existing trace and xel files. I'm working on a tool to convert your files in the sqlite format and I'll add it to WorkloadTools shortly

Don't miss a new WorkloadTools release

NewReleases is sending notifications on new releases.