-1

I have to create a new database for a company wide printing application.Since there is not much overhead, we are planning to use an existing SQL Setup for the same. Can someone suggest when can I actually move the db to the AAG group once created?

Can I do it immediately after creating the database, or can I do it once the application is installed on it? Also, for configuring the secondary database, if full initial synchronization is enabled, will it be created automatically? Please clarify

  • If you want some automation look at my answer . You can adjust the script as per your needs. – Kin Shah Sep 19 '16 at 14:00
  • There is no such thing as "full synchronization enabled". There is a wizard that you can choose to have the wizard backup and restore your databases for you called "full synchronization" but there is no property of an AG that does this for you in 2012/2014. SQL Server 2016 has database seeding and that is completely different. – Sean Gallardy Sep 19 '16 at 20:46
1

I have to create a new database for a company wide printing application.Since there is not much overhead, we are planning to use an existing SQL Setup for the same. Can someone suggest when can I actually move the db to the AAG group once created?

Yes, You can add the database in AAG immediately after creating the database. But there is condition, First you have to take the 'Full Backup' of that database(which database you want to add in AAG, and that Database Recovery model should be 'Full Recovery model' . otherwise that database will not available to add in AAG, untill unless whenever you shall not take full backup.

Also, for configuring the secondary database, if full initial synchronization is enabled, will it be created automatically?

If your have configure properly 'primary & secondary replicas' in 'availability groups' . And if you shall add your 'Primary Replica Server' database in 'Availability Databases' . It's automatically comes that database in your 'Secondary Replica Server'. After successfully adding the database both server (Primary Replica Server & Secondary Replica Server ) the status of that database would be "Synchronous commit or Asynchronous commit". Whatever you shall choose during 'Availability Mode' configuration in your Availability Groups.

Hope it will help out to you.

For Ref :- Here

|improve this answer|||||
  • Thank you. So If I would create a database in the primary node and Add it to the AAG, would a secondary database be created automatically on the secondary node? Provided I first take a full backup of the empty database and then add it to the AAG group. Please clarify regarding this – user2923332 Sep 28 '16 at 14:37
  • Yes,you can. I have clearly mention in my post. – Md Haidar Ali Khan Sep 28 '16 at 14:39
  • Thank you for the clarification. Would this also mean that I do not have to setup any kind of mirroring endpoints for the databases to be in sync? – user2923332 Sep 28 '16 at 14:52
  • Yes, if you will setup a alwayson availability group between two server replica(that is primary replica & secondary replica) with synchronisation mode then automatically it will synchronised. – Md Haidar Ali Khan Sep 28 '16 at 15:16
  • Last clarification. Does this work on SQL 2012 and 2014? Or only on 2016? Thanks! – user2923332 Sep 29 '16 at 16:20
1

From here we can choose two kind of scenario

 1. alwayson for high availability 

 2. Read replica

If it is for HA then add the database to AG after created the database.

If it is for Read replica you can add it to AG after installed and verified the application.

|improve this answer|||||
1

Can I do it immediately after creating the database

Yes.

or can I do it once the application is installed on it

If it's your in-house application and you know it will work on an empty database in an AG, then do it immediately after creating the database.

If it was an off-the-shelf application you'd normally wait until the application has deployed its schema before adding it to the group. For some reason a lot of Enterprise apps check whether a database is in mirroring mode and will refuse to install until it's removed.

Also, for configuring the secondary database, if full initial synchronization is enabled, will it be created automatically?

Yes.

|improve this answer|||||
0

Haider, the db which I created is on the primary node outside the AAG. For installing the application should I be giving the server ip or the cluster ip ? Thanks

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.