Pages

Monday, May 30, 2011

Mirroring setup in SQL Server 2005

Mirroring set up is a very task in SQL Server 2005. We need atleast 2 instances to work around with mirroring. One database will be online which is Primary server, the other database in the other instance will be in Restoring mode.

Steps to create mirroring...

1. Take the Fresh copy of backup which is to be involved in mirroring, and restore it in the secondary instance/server with norecovery option. This will make the secondary database to be in restoring mode.

In this example we are going to work with database "ROOM". Mirroring is going to setup from server "MYCOMPUTER" to server "MYCOMPUTER\Server2".

Configuring mirroring:

- Right click on the database of the primary server (server: MyComputer) and select mirror from tasks.


- Mirror setup window wil appear..click on configure security button and proceed to create the endpoint. We need to select the secondary database also while configuring endpoints.


-If it is developer edition or having service pack issues,Mirroring endpoints configuration will not be done successful. It will throw below mentioned error.


As mentioned in the error log we have to start our databases using trace flag 1400.

HOW to start database using Trace flag -T1400:

Go to SQL Server Configuration manager and select the properties of the sqlserver instance.


once configuration is done, we have to restart the instances whose trace flag is changed

Now the server is ready for Mirroring..

Repeat the steps mentioned above and configure the Endpoints.

Once configuration is done successfully, click on start mirroring button. mirroring will start succesfully.