Is there any way to know how long took completed shrink process?

  • Is there any way to know how long took completed shrink process?

    Are there any logs or something like that?

    Thanks in advance,

  • How did you run the shrink process?

    insert log select getdate()

    dbcc shrinkfile

    insert log select getdate()

    will do it.

    Please don't cross post or duplicate post.

  • From the GUI

    Shrink Database

    Without reorganizations of files

    Thanks,

  • First, don't run stuff from the GUI. There is a "Script" button on all dialogs. Click that, get the code into SSMS in a query window, save it for log purposes, examine it to understand what it's doing, then run it.

    You should have an instance log that keeps track of everything you did. It can be a folder on an instance, a public folder in Exchange, something, just track it.

    Second, try this. Run this:

    select path from sys.traces where is_default = 1

    Take the resulting path and stick it in here, editing for your database name:

    select te.name as [event],e.textdata, e.applicationname, convert (varchar(20), object_name(e.objectid)) as object, e.spid, e.duration/1000 as [duration (ms)], e.starttime, e.endtime, e.databasename, e.filename, e.loginname, e.hostname, e.clientprocessid

    from fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log\log_120.trc', default) e

    inner join sys.trace_events te on e.eventclass=te.trace_event_id

    where databasename = 'ShrinkDemo'

    order by e.starttime

    Look for a shrink database in the textdata column.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply