SQL Server Developer Center > SQL Server Forums > SQL Server Database Engine > Filegroup Backup/Restore in sql server 2008
Ask a questionAsk a question
 

AnswerFilegroup Backup/Restore in sql server 2008

  • Wednesday, November 04, 2009 5:58 AMRaj_79 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi All,
              One of my db size is more than 200 GB so i am planning to create few filegroups for this database. I am facing one issue when i am restoring single filegroup on existing database. It gives message that filegroup has been restored successfully but when i run any query to fetch data from that filegroup, it gives error that filegroup is not not online.

              I am taking only filegroup backup not taking any log backup.

              If anyone have any document related to filegroup backup/restore then pls share it.

    Thanks in advance.

    Raj


    **Vote it if it is helpful. **Mark as answer if it solves your problem. Raj_79
    • Edited byRaj_79 Wednesday, November 04, 2009 5:59 AMchange
    •  

Answers

All Replies

  • Wednesday, November 04, 2009 6:16 AMLekss Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Raj,

    The transaction log backups are required here.

    Anyway this KB article should help you to sort your problem
    http://support.microsoft.com/kb/281122
    http://msdn.microsoft.com/en-us/library/ms187090.aspx
    Thanks, Leks
    • Marked As Answer byRaj_79 Wednesday, November 04, 2009 12:40 PM
    •  
  • Wednesday, November 04, 2009 6:48 AMRaj_79 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks Lekss,

    Is there any other way, I don't need log backup here but i want recover my database by restoring full filegroup backup.

    Raj
    **Vote it if it is helpful. **Mark as answer if it solves your problem. Raj_79
  • Wednesday, November 04, 2009 7:21 AMLekss Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Raj,

    After the filegroup backup was taken , were there any changes to the database (especially in the filegroup for which the backup was taken) ?
    If that is the case , you need to apply the log backups for this filegroup to get the filegroup online.

    Thanks, Leks
  • Wednesday, November 04, 2009 7:26 AMRaj_79 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I have not made any changes after filegroup backup, so i am restoring only last filegroup backup which i have taken but it gives same error as filegroup in not online.

    Raj


    **Vote it if it is helpful. **Mark as answer if it solves your problem. Raj_79
  • Wednesday, November 04, 2009 7:58 AMTiborKMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You need to sync that data by restoring tlog backups up to current point in time. No way around it (unless the filegroup was marked as read-only all the time since the backup was taken).
    Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi
    • Marked As Answer byRaj_79 Wednesday, November 04, 2009 12:40 PM
    •  
  • Wednesday, November 04, 2009 9:33 AMRaj_79 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I found the following statement in http://support.microsoft.com/kb/281122 artcile. Is it not applicable in sql server 2008?


     It is not necessary to apply a transaction log backup if SQL Server can determine that the files or filegroups have not been modified after the file or filegroup backup was created


    Raj
    **Vote it if it is helpful. **Mark as answer if it solves your problem. Raj_79
  • Wednesday, November 04, 2009 9:38 AMLekss Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    It should applicable for SQL server 2008 as well , but are you sure that there were no transaction ? Open you trace files (if you have some for the time period under consideration)and see if that is true.
    If you haven't had any transaction , then the restore operation shouldn't fail.

    Thanks, Leks
  • Wednesday, November 04, 2009 11:44 AMTiborKMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I find that statement (in the KB article) very vague. Here is a statement from BOL 2008:

    "If the filegroup that is being restored is read/write, an unbroken chain of log backups must be applied after the last data or differential backup is restored. This brings the filegroup forward to the log records in the current active log records in the log file. The recovery point is typically near the end of log, but not necessarily.

    If the filegroup that is being restored is read-only, usually applying log backups is unnecessary and is skipped. If the backup was taken after the file became read-only, that is the last backup to restore. Roll forward stops at the target point."

    Above is from http://msdn.microsoft.com/en-us/library/ms190710.aspx.
    You also might want to check out http://msdn.microsoft.com/en-us/library/ms190388.aspx.


    Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi
  • Wednesday, November 04, 2009 12:45 PMRaj_79 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Tibork,
                    I am agree with u, t-log restore is required here after filegroup.

    Raj
    **Vote it if it is helpful. **Mark as answer if it solves your problem. Raj_79
    • Edited byRaj_79 Wednesday, November 04, 2009 12:46 PMchange
    •