Filegroup online backup and restore

  • Hello,

    in a sql srv 2008 I have to backup and restore (every 2-3 days) 2 or 3 filegroups (containing each 1 file). Recovery model is Simple in my DB.

    These filegroups can be marked as ReadOnly (no write access on them).

    SQL Server online backup & restore method allows to perform backup and restore filegroup in a DB in online status and in simple recovery model, BUT filegroup HAVE TO be altered to Read_Only status.

    So there is a problem.. As far as I know, the TSQL

    [font="Courier New"]ALTER DATABASE [DBNAME] MODIFY FILEGROUP MYFG READ_ONLY[/font]

    give this error message in a multi-user DB state:

    [font="Courier New"]Msg 5070, Level 16, State 2, Line 1

    Database state cannot be changed while other users are using the database 'DBNAME'[/font]

    In a single user state.. no problem...

    So, what can I do?? I must keep online my DB and I have to set as readonly some filegroups..

    Help! Thanks!!

    Simone

  • You should have been posted this issue in sql 2008 section to get faster(any) response.

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Yes, but I think this is an issue in the backup behaviour of 2005\2008 (they're very similar) so I posted here..

  • put the database in SINGLEUSER mode and then do the alteration

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Ok, it will work, I am sure, but if there will be a lot of "w3wp user" (web servers) connected.... boom, connection down during my "single user alter db command"... 🙁

  • These kind of task generally done in off peak hours with the proper intimation to users

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Is there any possibility to modify single filegroup to readonly in multi user mode ?

Viewing 7 posts - 1 through 6 (of 6 total)

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