Gert .Net
[GertDotNet]
20050922
Autoclose and Autoshrink
When you notice that Enterprise Manager is getting slow (very slow) when opening the list of databases on a server, you should probably turn of AUTOCLOSE and AUTOSHRINK.
Here is a script that helps you in doing just that.
declare dbCursor cursor for select name from sysdatabases
open dbCursor
declare @name as varchar(50)
fetch next from dbCursor into @name
while @@fetch_status = 0
begin
print @name
exec sp_dboption @name, 'autoclose', 'false'
exec sp_dboption @name, 'autoshrink', 'false'
fetch next from dbCursor into @name
end
close dbCursor
deallocate dbCursor
This is faster because all databases will be left mounted. If AutoClose is true, a lot of databases will have to be mounted in order to construct the list.
Comments:
Een reactie plaatsen
Links to this post:
