Toad World® Forums

Replay SQL Trace- Primary Key voilation error


Hi all,

I have just started using Benchmark Factory to ckeck the SQL queries performance with multiple users.
I have collected the SQL trace using SQL profiler and trying to replay trace for 100 users using Benchmark Factory.
When I am replaying the same trace, it is showing below error message for 2 statements**“Agent (wl034347) Error: DB-LIBRARY Error (5,10007,-1) - General SQL Server error: Check messages from the SQL Server. Transaction (Process ID 118) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.”**

I looked into the table and there is a primary key in the table and unique RowId which cannot be inserted again. BF is trying to insert the same rows again as in got from SQL Trace table. This is the 300th statement and there are total 500 statements in the scenario.

Please help me to resolve the issue

Manoj Pathak


When BMF imports the trace information it also includes all values, therefore if you plan on replay the captured workload you will need to backup the database into the same state/data, as it was just before the capture. Then the database can be restored just before the replay to ensure the data is the same as it was before capture. This will prevent any integrity constraint issues.