| Author |
Topic |
|
vb_bv
Starting Member
24 Posts |
Posted - 2001-11-26 : 20:52:00
|
| Hi all, actually I've raised a question at last week, the question is about "how to trace all the sql command that I executed in the past", And yesterday, I found a script of information. it tells me from SQL2000 there is a tools called "SQL Profiler".SQL Profiler allows capturing of virtually all events that take place within SQL Server, including End user activity (all SQL commands, Logout/Login, enabling of application roles). Does anybody knows how to achieve that? many thanks to all. |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2001-11-26 : 20:56:34
|
| In a response to your previous post someone mentioned Profiler. What this tool can do is capture SQL Server activity as it occurs. It can't go back and see what was done prior to starting profiler. Basically you start the tool and tell it which server you wish to profile. It will start a trace file and record all the SQL that is sent to the server.We have the follwing articles on Profiler: http://www.sqlteam.com/SearchResults.asp?SearchTerms=profiler===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
vb_bv
Starting Member
24 Posts |
Posted - 2001-11-27 : 01:54:30
|
| it's hard to understand this feature "SQL Profile" I think!I'vr tried to create a new trace template from this Profiler,and chosen "Events" -> "Performance" -> "Execution Plan" & "Data Columns" -> "Text Data" to monitor.And I found my database keep going to run these stuff below:Execution Tree---Constant ScanExecution Tree---Table Insert(OBJECT:([tempdb].[dbo].[#temp]) ,SET:([#temp].[performance_condition]=RaiseIfNull ('dummy')))Execution Tree---Table Insert(OBJECT...([sysalerts].[enabled]=1))I really have no idea what this, does anybody can help, many thanks!!! |
 |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2001-11-27 : 08:43:59
|
| Those are execution plans for queries. That's what you told it you wanted to see. I'd just accept all the defaults except for which database you wish to monitor. That should get you a pretty good trace. Don't try to change the templates or data columns unless you understand what you're doing.===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
vb_bv
Starting Member
24 Posts |
Posted - 2001-11-27 : 20:53:39
|
| everything is getting clear, thanks.But I still have one more question, how do I check a DatabaseID, Cos' I would like to set a "Filter" option about "DatabaseID equal XXX".Since I don't know my database ID, so I tried a stupid way, first executed a sql stmt, then capture which database is reacted by this, andthen recordthe ID.Anyone have a better idea?And thanks to Graz anyway. |
 |
|
|
ToddV
Posting Yak Master
218 Posts |
Posted - 2001-11-28 : 08:51:10
|
| The Function DB_ID() |
 |
|
|
vb_bv
Starting Member
24 Posts |
Posted - 2001-11-28 : 22:12:27
|
| Sorry, Toddv. can't really get you, do you mean there is a store prod called DB_ID, if yes, could you please tell me where is it, or do you mean I have to run a sql stmt like: select * from DB_ID?Best Regards |
 |
|
|
graz
Chief SQLTeam Crack Dealer
4149 Posts |
Posted - 2001-11-28 : 23:48:13
|
This query will give dbid's. In SQL Server 2000 you should also be able to filter by name.select dbid, namefrom master..sysdatabases ===============================================Creating tomorrow's legacy systems today.One crisis at a time. |
 |
|
|
vb_bv
Starting Member
24 Posts |
Posted - 2001-11-29 : 02:04:09
|
| Thanks a lot, Graz & Toddv, this is a good site. |
 |
|
|
|