Question

Does anyone know of a way to accomplish setting a filegroup to AUTOGROW_ALL_FILES without setting the database to single user mode? I frequently add new filegroups/files to a 24/7 production database where killing active sessions and rolling back transactions (via SET SINGLE_USER WITH ROLLBACK IMMEDIATE) is definitely not preferred. IMO this operation should be able to be accomplished with other active sessions on the database.

Was it helpful?

Solution

It seems there is no way around it. This is per an offline conversation with Paul Randal from SQL Skills. So that would mean I would need to either have no other open sessions on the db, or set it to single user mode prior to running the set statement. Thanks for the assistance Paul.

OTHER TIPS

Per Microsoft's documentation, there is no requirment to set a database to single_user mode when running ALTER DATABASE MODIFY FILEGROUP <FILEGROUP> AUTOGROW_ALL_FILES.

If you are finding yourself setting single user mode I would recommend taking a look at the locks that are blocking that change for you.

An alternative would be to grow the data files themselves rather than the filegroup and considering usage of trace flag 1117.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top