Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I've got a Python script which accesses two SQLServer 2008 databases. If I run it and take a trace to capture all events that occur as a result of the script, and then put that trace through the Database Tuning Advisor it has the error message "invalid object name" about many of the tables in one of the databases.

I have selected both databases on the first tab of the tuning advisor. It seems that the trace doesn't capture which database the SQL has been run on, and I can't find a place to say that it should.

How can I analyse a trace from this script without these errors?

share|improve this question
3  
You need to include DatabaseName and/or DatabaseID as a trace column. See here for details –  Martin Smith Feb 27 '12 at 12:15
    
I found where to specify database name in the DTA user interface. (Show all columns, tick name and id) Do you want to make it an answer and get the credit? –  paulmorriss Feb 27 '12 at 12:33

1 Answer 1

With Martin Smith's help I found the answer.

On the dialog where you specify which events to include click Show All Columns. Tick the Database name and Id columns. Then redo the trace. It should import into the Tuning Advisor OK.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.