Re: Tracing Used Tables

Tech-Archive recommends: Fix windows errors by optimizing your registry



Why not set up a SQL trace to capture all the TSQL and RPC compltetd events
in the database, and then analyze the trace files to get the info you are
looking for?
This will still give you a lot of data on a business database, but should be
much less than LockAcquired. And hopefully on a soon-to-be-retired database,
the activities level has taped off.

Linchi

"Shiju Samuel" wrote:

Erland Sommarskog wrote:

Shiju Samuel (Shiju.Samuel@xxxxxxxxx) writes:
I need to trace all the tables which are used in the database. I
found the objects:object:Opened is not getting any trace hit. Now
I am tracing with Locks->LockAquired with all the possible filter
on server side trace is there any other way to do this ? This is
generating a lot of trace data even for ever key locks aquired.

Tracing LockAcquired on a production server is definitely not to
recommend. That will cause an enormous extra load on the box.

Overall, this is no simple task, and even less so on SQL 2000. If your
application does not use stored procedures, but uses ad hoc SQL, you
collect data from master.syscacheobjects.sql and then parse that. If
your application is based to stored procedures, collect which
procedures that are run, and then build a shadow copy of the database
where you load all proceduers after table tables, so that sp_depends
becomes decently correct. (But tables which appears in queries with
temp tables and not elsewhere in the procedures will not be listed in
sysdepends.)

And once you have this data, you may still have tables that are only
used for end-of-the-year reporting and the like, and thus are not used
this time of year...

Thanks Erland - Looks to be an Herculean task considering 22 databases
which I need to retire on the server.

-- Thanks - Shiju


.



Relevant Pages

  • Re: User and Login auditing
    ... I agree 100% with Sue on not touching the system tables. ... > and hope that your employer doesn't mind you putting the SQL ... > Server box in this position. ... You could put triggers on your trace table. ...
    (microsoft.public.sqlserver.security)
  • Re: Problem with SQL Server [Solution]
    ... Apparently my sql server was not set to mixed mode authentication. ... > with the Trace Properties. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: URGENT deadlock question
    ... I have a deadlock template that I use with the following ... > SQL: Statement Completed ... > "Trace flags remain enabled in the server until disabled by executing ...
    (microsoft.public.sqlserver.server)
  • Re: SQL 7 Traces
    ... Profiler 2K can generate the xp calls for a defined trace in 7 format. ... Tibor Karaszi, SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL 7 Traces
    ... With SQL 7, you can simply use the SQL Profiler to trace the server. ... Profiler is a GUI tool that hooks into server events inside SQL Server. ...
    (microsoft.public.sqlserver.programming)