Let's see how to perform database initialization ing with screenshots:
SelectPrincipal Database. Right click on the Database Name and selectPropertiesAnd then click on"Processing ing"The following window will appear:
- Click on"Configure Security... "Button.
- From the following window clickNextTo get started.
- Here we have the option that if we want to use a witness server or not, selectYesAnd clickNext.
- Again select if there is a need to use a witness server and clickNext.
- Now first of all set upPrincipal Server.
- Select the instance, click on the checkbox if we want to encrypt the data and define the listener port, which database refreshing ing will use to communicate with the other instances in the mirror. also select the endpoint name. clickNext.
Note:We can use the default number/name or specify our own for both: Port, endpoint.
- Secondly, set up the mirror server similarly as we have done for principal server: select the instance; select encrypt the data; Define the listener port and select the endpoint name and connect to it. after connecting successfully clickNext.
Note:We can use the default number/name or specify our own for both: Port, endpoint.
- Thirdly, it's time to set up the witness server as we have decided to use a witness previusly. so for this also select the instance; click to encrypt the data; Define the listener port and lastly select the endpoint name. again connect to it and clickNext.
Note:For witness server also we can use the default number/name or specify our own for both: Port, endpoint.
- Here we can set up special security credentials if we want to do (not compulsory ). because all of the instances for this demo are on the same server using the same accounts, they have been left blank. so directly clickNext.
- Last but not the least click on"Finish ".
- When we click on finish the following window configure the endpoints and shows its status means that it will show whether the process was successful setup or not.
Note:We can also see the reports if we want to see.
- Click onClose buttonAnd we will the following window on our desktop. To begin login ing select"Start processing ing"And the processing process will begin in. And if we want to make the changes than click on "do not start refreshing ing"
- Finally our login ing will starts as shown below. And we can see in status box that the data has beenSynchronized between the principal and the mirror.
Note:We have some more options on this window which are as under:
Pause:This will stop transactions from being sent to our mirror.
Remove processing ing:This will remove the processing configuration.
Failover:This will allow us to manually fail over to our mirrored copy. Once we fail over the current principal becomes the mirror and the current mirror becomes the principal.
Now we can see the status on our MSSQL window, the database is showing like this:
Problem 1:
Error MSG 1416, level 16, State 31, line 3. database is not configured for database flushing:
Solution 1:
Restore the full backup from principal server using with norecovery option and also one transactional log backup from principal server using with norecovery option and then start processing ing.
Problem 2:
Error MSG 1418, level 16, state 1, line 1. The server network address cannot be reached or does not exist. Check the network address name and reissue the command.
Solution 2:
- Restore a fairly recent full backup to the planned mirror server, with norecovery
- Then restore a transaction log, also with norecovery
- Configure endpoints correctly.
- Check if the ports that selected are valid or not.
- Is there a firewall (hardware or software )?
Problem 3:
Error MSG. (Microsoft SQL Server, error 1475): "database login ing cannot be enabled because the database may have bulk logged changes that have not been backed up. the last log backup on the principal must be restored on the mirror"
Problem 4:
Error MSG: (Microsoft SQL Server, error 1478): The Mirror database has insufficient transaction log data to preserve the log backup chain of the principal database. this may happen if a log backup from the principal database has not been restored on the mirror database.
Problem 5:
Error MSG: (Microsoft SQL Server, error 1412): the remote copy of database has not been rolled forwarded to a point in time that is encompassed in the local copy of the transactional log.
Solution 3, 4, 5:
We got the above mentioned error when we start the synchronization for database locking. To start the synchronization successfully follow these steps:
- Principal instance-take a full backup and a log backup as well
- Copy the full/log backups from principal instance to mirror instance
- Mirror instance-restore with norecovery option the full backup
- Mirror instance-apply the log backup
- Principal instance-start Synchronization