DMV to identify databases referenced

  • One option, if you're almost certain the DB is not used...

    Turn autoclose on. That means SQL won't open the DB until someone connects to it, and will close the DB once last connection leaves, and the Starting up database X messages are in the error log.

    You could also poll sys.dm_tran_locks and look for shared database locks, that tells you that someone is connected to the DB.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing post 16 (of 15 total)

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