Welcome to Sign in | Help
in Search

Restore one filegroup (out of 2) at some point in the past

Last post 08-28-2009, 10:17 AM by cardasim. 15 replies.
Page 1 of 2 (16 items)   1 2 Next >
Sort Posts: Previous Next
  •  07-31-2009, 7:13 PM 7448

    Restore one filegroup (out of 2) at some point in the past

    Salut, as avea nevoie de ajutor pentru urmatorul scenariu.

    Am o baza de date cu 2 filegroup-uri, CONFIG  (in care se tin tabele de configurare/dictionare/setari etc) si PRIMARY (care contine tabele operationale), fiecare cu cate un singur fisier fizic (.ndf si .mdf).
    As vrea sa fac urmatoarele:
    1. creez baza date, sistemul intra in productie; in acest moment tabelele din CONFIG contin date predefinite
    2. backup CONFIG
    3. cu trecerea timpului PRIMARY ajunge la dimensiuni de ordinul GB, ceea ce inseamna timp indelungat de BACKUP-RESTORE
    4. modific date din CONFIG (de exemplu mai adaug randuri in tabele dictionar)
    5. imi dau seama ca am gresit
    6. vreau sa fac restore DOAR la filegroup-ul CONFIG si dupa restore sa pierd modificarile mentionate la pasul 3; in PRIMARY nu se schimba nimic, deci nu am probleme de constrangeri referiantiale

    Practic imi doresc un restore la un moment anterior, dar numai pentru un filegroup, nu pentru intreaga baza de date.

    Se poate face asa ceva? Daca nu, ce strategie ar trebui sa aplic pentru a reveni la starea initiala a datelor din CONFIG fara a face un full restore (care ar dura prea mult)?

    Multumesc.

    Florin Cardasim
  •  08-02-2009, 11:08 AM 7449 in reply to 7448

    Re: Restore one filegroup (out of 2) at some point in the past

    sql 2005 are posibilitatea de peace meal restore care face asa ceva restaureaza numai anumite fisiere.
    Secolul XXI ori va fi religios ori nu va fi deloc
  •  08-02-2009, 9:39 PM 7450 in reply to 7449

    Re: Restore one filegroup (out of 2) at some point in the past

    Da, dar din pacate piecemeal nu cred ca ajuta la ce vreau eu, si anume restore la un filegroup la un moment ANTERIOR in timp fata de celelalte filegroup-uri.

    Florin Cardasim
  •  08-03-2009, 10:39 AM 7451 in reply to 7450

    Re: Restore one filegroup (out of 2) at some point in the past

    Incearca sa lucrezi cu filegroup-ul "Config" pus pe "read-only". Cand ai nevoie sa schimbi ceva in "Config", il pui din nou pe "readwrite". Vezi
    http://www.informit.com/guides/content.aspx?g=sqlserver&seqNum=268
    si
    http://msdn.microsoft.com/en-us/library/ms188631(SQL.90).aspx
  •  08-03-2009, 10:11 PM 7453 in reply to 7451

    Re: Restore one filegroup (out of 2) at some point in the past

    Diana, multumesc pentru sugestie, insa din pacate nu am reusit.

    Intre timp am mai primit niste informatii, ce vreau eu nu se poate.
    Detalii aici:
    http://social.msdn.microsoft.com/Forums/en-US/sqldisasterrecovery/thread/21ebad42-d765-43de-9bd6-4d45a218b6c6

    Concluzia: pentru ce vreau eu am doua solutii
    1. cod care sa faca export - import
    2. baze de date separate pentru CONFIG si ROUTINE (operational)
    Sunt nevoit sa aleg solutia 1. Dar ar fi fost cool sa pot reolva problema cu filegroups. Poate in versiunile urmatoare Smile

    Florin Cardasim
  •  08-04-2009, 4:23 PM 7461 in reply to 7453

    Re: Restore one filegroup (out of 2) at some point in the past

    inteleg ca database snapshots nu ajuta in cazul tau, nu?

    toate cele bune,
    calin

  •  08-05-2009, 2:06 PM 7465 in reply to 7461

    Re: Restore one filegroup (out of 2) at some point in the past

    Nu, din pacate snapshot-ul e doar la nivelul intregii baze de date, nu la nivel de filegroup.
    De asta s-au mai plans si altii, de exemplu aici: http://www.eggheadcafe.com/forumarchives/SQLServerserver/Feb2006/post26066897.asp

    Florin Cardasim
  •  08-05-2009, 3:41 PM 7466 in reply to 7465

    Re: Restore one filegroup (out of 2) at some point in the past

    Multumesc, Florin.
    Cat traim invatam si tot nu ajunge...:)
  •  08-07-2009, 9:02 AM 7470 in reply to 7466

    Re: Restore one filegroup (out of 2) at some point in the past

    Cred ca solutia cea mai simpla e sa faci restore point in time daca ai recovery model pe full.

    Restaurezi intreaga baza de date dar macar iti realizei obiectivul


    Secolul XXI ori va fi religios ori nu va fi deloc
  •  08-07-2009, 12:21 PM 7471 in reply to 7466

    Re: Restore one filegroup (out of 2) at some point in the past

    @Diana: bine zis, am acelasi sentiment periodic... Smile

    Florin Cardasim
  •  08-07-2009, 12:26 PM 7472 in reply to 7470

    Re: Restore one filegroup (out of 2) at some point in the past

    @Crestinul Tocmai asta e: eu nu am nevoie de recovery ci de o modalitate de a "reutiliza" un filegroup plin cu date. Cine stie poate in versiunile viitoare ... raportez pe Microsoft Connect si vedem ce se intampla. Pentru moment case closed Smile
    Florin Cardasim
  •  08-07-2009, 12:33 PM 7473 in reply to 7472

    Re: Restore one filegroup (out of 2) at some point in the past

    Da-mi de veste, vreau sa votez "pentru"...:)
  •  08-07-2009, 2:41 PM 7474 in reply to 7473

    Re: Restore one filegroup (out of 2) at some point in the past

    Parere mea e ca te complici.Poti face din aplicatia urmarirea modifcarii obiecteleor.Linq si Entity Framework de exemplu au capabilitatea de object tracking daca folosesti aceste tehnologii ca dataacces layer.
    Secolul XXI ori va fi religios ori nu va fi deloc
  •  08-14-2009, 10:51 AM 7501 in reply to 7474

    Re: Restore one filegroup (out of 2) at some point in the past

    Am postat pe MS Connect. ID 482717, "Restore filegroup to a certain point back in time".

    Am primit intre timp si doua raspunsuri de la MS, fac copy&paste aici:

    1. De la echipa Sql Server
    "That functionality is not possible in SQL Server.

    In order to have a database that is consistent, all portions of it must be at the same transactional point in time.

    The internal consistency of the database is maintained using Log Sequence Numbers, and there is no way to have multiple LSNs active in a single database.

    It seems that both scenarios could be readily facilitated by creating a simple script to truncate the tables which contain customer specific data, and put the database into a state which is ready to deploy at another customer.  Or better yet, develop a set of pre-configured databases which have never had any customer data in them.

    In Scenario B, there is a real risk in taking a backup from one customer and putting the data on another customer’s machine.  Even when rows are deleted, the data is not zeroed out on the pages, so there is a chance that the second customer could obtain information from the first. 

    SQL Storage Engine PM team :  SQL Server Storage Engine Team blog"

    2. De la support prin programul METRO

    "Unfortunately in the 2 scenarios you described it’s not applicable by restoring filegroup backups. I’d like to explain a little as below:

    Scenario A

    SQL Server will not let you into a database where different data is from different points in time.

    You must use file and filegroup backup and restore operations in conjunction with transaction log backups. After you restore the files, you must restore the transaction log backups that were created since the file backups were created to bring the database to a consistent state.

    File/filegroup backups can be used to restore the database to an earlier point in time. To do this, you must restore a complete set of file backups, and then restore transaction log backups in sequence to reach a target point that is after the end of the most recent restored file backup.

    In fact the main reason for performing selective restores of files or filegroups is to make it possible to spot-recover damage to a database that is too big to restore wholesale. For more details about restoring filegroup backups please reference http://msdn.microsoft.com/en-us/library/ms190710.aspx.

    Scenario B

    File and filegroup backups must be restored to the matching database.

    File and filegroup backups can only be restored to the database to which they belong. You cannot create a new, blank database with the same structure and filenames and then attempt to restore the single file or filegroup backup; you must restore it into the existing database or perform a full database restore in another location.

    Suggested solution

    For scenario A  you can restore the PRIMARY filegroup into a new temp database-to the desired earlier point in time, and then copy the relevant data from this temp database into the production database.

    Or you could simply put the Configuration data in a separate database, then replace the objects in the main database with synonyms, or replicate the configuration data into the main database."


    Florin Cardasim
    Filed under: , ,
  •  08-18-2009, 11:48 AM 7519 in reply to 7448

    Re: Restore one filegroup (out of 2) at some point in the past

    Salut,

    Un articol foarte informativ despre acest subiect il gasesti acici
Page 1 of 2 (16 items)   1 2 Next >
View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems