Shrink Database

  • How can I know if someone is shrinking my database? This is a too many hands in the pot senario, there is no job I can reference, and I want to know if someone else ran a shrink. Main details so far is it's a 250GB DB with less than 10GB of free space. This server normally sits around 50. I'm hoping more for a time it was done so I can more assume who did it. I'm hoping for a location in msdb that stores this... or a place in the log files it would show?

    .

  • Not that I know of.

    Auto grows and auto shrinks are recorded in the default trace, but manual operations are not.

    If you suspect someone is doing this regularly you could set up a trace yourself. No other suggestions I'm afraid.

  • This is inaccurate (at least for 2005/2008). SQL Server's default trace file records this information. As a test, run something similar to USE [MyDB]

    GO

    DBCC SHRINKFILE (N'MyDB_log' , 2048)

    GO

    Then open the default trace file (typically located in your \\Drive\Program Files\Microsoft SQL Server\MSSQL10.MSSQL\MSSQL\Log folder). Int his file you will find the NT username and the TextData corresponding to the command issued.

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • Sadly I think our "custom trace" omits these results. I'll have to add it back for future use.

    .

  • My mistake. I was looking at the Database category (where the auto grow/shrink events are).

    The manual shrinks come under the Security Audit category (8), along with all the other DBCC commands.

  • Bill (fluffydeadangel) (2/14/2013)


    Sadly I think our "custom trace" omits these results. I'll have to add it back for future use.

    The default SQL Server trace runs in the background and is unrelated to any other custom traces you may have running.

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • It would be if our org didn't disable the standard trace to setup a custom one.

    .

  • Bill (fluffydeadangel) (2/14/2013)


    It would be if our org didn't disable the standard trace to setup a custom one.

    That's horrifying. At worst a "custom" default trace should be a superset containing all events in the default trace.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Yeah... This is my new project.

    .

  • take a look at this thread; it can help you find the ascii code of the unseen character(s)

    ;

    from there, you can decide whether you want to replace it or whatever:

    there's several ideas in the thread for cleaning up fields.

    http://www.sqlservercentral.com/Forums/Topic1408071-391-1.aspx

    EDIT: This got posted to the wrong thread, somehow.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 10 posts - 1 through 9 (of 9 total)

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