Automation Flow and Code DetailsĪssume we have the below two servers that are involved in our mirroring scenario (solution):
This solution could save up to 8 man hours on every new db creation, by eliminating the change management process and manual effort in creating the mirroring setup and more over some databases would be created by an application without the DBA knowledge. This automation process has completely eliminated the change management process and achieves greater RPO and RTO time as the DR instance will be having the primary DB copy in no time after its creation on the primary server and thus provides High Availability (HA) to an application in the event of primary system failure. This automation solution became vital as it's not clear when the new database is going to be created on the main primary SQL instance and customer requirement is to have the DR copy immediately (within a few seconds) on the secondary database server without any manual DBA effort and change request. Every time a new database is created on the SQL instance, either at Principal in few seconds, the database configured with the mirroring and will be in sync with the principal database.
Once the database is created on the Primary Server, the entire process of creating the database mirroring should take place without any manual intervention by the DBA. In one of the client requirements, I had to design a solution that can bring the database into mirror state on DR site (or Secondary SQL Server) in no time, by establishing the mirroring session from Primary Server to Secondary Server, without any manual effort when a new database is created on the principal Instance.