Add multiple databases to availability group

  • Hello together,

    We have about 50 databases that are not in full recovery mode and not in always on included.

    Do you know what the fastest way is to add these databases into an Availability group and also Change to full recovery mode without SQL Mgmt Studio Wizard.

    Maybe someone has a script suggestion for me? (combine both)

    for example Alter Database [mustermann] SET RECOVERY FULL WITH NO_WAIT  + ALTER AVAILABILITY GROUP mustermann ADD DATABASE mustermann;

    best of all, which are not already running in full recovery mode and in the always on group

     

    Thank you very much in Advance! I'm grateful for every tip.

     

     

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • You have posted your own script suggestion.  Does it work?  If not, what is the problem - does it give an error message, does it not do what you intend it to do?

    John

  • try undocumented SP, for each individual DB query

    EXEC sp_MSforeachdb @command

    Note: Set full recovery plus full DB backup to secondary servers also necessary.

    Regards
    Durai Nagarajan

  • Desperados900 wrote:

    Hello together,

    We have about 50 databases that are not in full recovery mode and not in always on included.

    Do you know what the fastest way is to add these databases into an Availability group and also Change to full recovery mode without SQL Mgmt Studio Wizard.

    Maybe someone has a script suggestion for me? (combine both)

    for example Alter Database [mustermann] SET RECOVERY FULL WITH NO_WAIT  + ALTER AVAILABILITY GROUP mustermann ADD DATABASE mustermann;

    best of all, which are not already running in full recovery mode and in the always on group

    Thank you very much in Advance! I'm grateful for every tip.

     

    You can write dynamic in fly code to do this quickly. Better go with automatic seeding, if all the serves are in same DC and small size.

    Muthukkumaran Kaliyamoorthy
    https://www.sqlserverblogforum.com/

Viewing 5 posts - 1 through 4 (of 4 total)

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