1. How to add data files to different drive of mirrored databases?
The steps below will explain the route we took to move database files with zero downtime without disturbing the database Mirroring.
For Mirror Instance:
1. Suspend mirroring on Principal Server (optional).
2. Issue Alter database statement on the mirrored server to point to the new location.
3. Stop mirrored SQL Server services.
4. Move database files of the mirrored database to the new location and make sure that permissions on the files are preserved.
5. Start mirrored SQL Server services.
6. Resume mirroring on Principal server databases and Verify mirroring is successfully resumed.
For Principal Instance:
1. Fail over databases to Mirror Server so that Mirror server can now act as Principal server.
2. Suspend mirroring on new Principal server (optional).
3. Issue Alter database statement on the new Mirror server to point databases to the new location.
4. Stop new mirrored SQL Server services.
5. Move database files of the new mirrored database to the new location and make sure permissions on the files are preserved.
6. Start new mirrored SQL Server services.
7. Resume mirroring on Principal server databases and verify mirroring is successfully resumed.
For Mirror Instance:
1. Suspend mirroring on Principal Server (optional).
2. Issue Alter database statement on the mirrored server to point to the new location.
3. Stop mirrored SQL Server services.
4. Move database files of the mirrored database to the new location and make sure that permissions on the files are preserved.
5. Start mirrored SQL Server services.
6. Resume mirroring on Principal server databases and Verify mirroring is successfully resumed.
For Principal Instance:
1. Fail over databases to Mirror Server so that Mirror server can now act as Principal server.
2. Suspend mirroring on new Principal server (optional).
3. Issue Alter database statement on the new Mirror server to point databases to the new location.
4. Stop new mirrored SQL Server services.
5. Move database files of the new mirrored database to the new location and make sure permissions on the files are preserved.
6. Start new mirrored SQL Server services.
7. Resume mirroring on Principal server databases and verify mirroring is successfully resumed.
2. Can we configure SQL DB mirroring using local system account on both principal and mirrored server?
No, WE can't configure or run DB mirroring using local system account. Local system account is limited to local system. It won't have an access to different server. you can use domain account or named account to run database services for db mirroring.
3. How to add Data files in mirorred database?
An overview of the entire procedure can be summed up in the following four points:
- Remove the existing mirroring partner
- Create a new file or file group on the primary server
- Take transaction log file backup and restore the same on the mirror server with the help of
WITH MOVE option
- Once done, database mirroring has to be re-established
4. How to remove witness server from mirrored database?
Using below T-SQL you can remove witness server
ALTER DATABASE DBNAME SET WITNESS OFF;
5. Types of DB mirroring :-
- Synchronous mirroring(automatic fail-over) -- High Safety
High Availability ( require witness server )
High protection (doesn't require witness server)
- Asynchronous Mirroring
High performance ( requires manual fail-over)
6. Is is possible to mirrored database as read only purpose?
Yes, it is possible only using SNAPSHOT
7. How Database snapshot works?
High level tasks of snapshot involves
· When you create a snapshot a sparse file is created for each data file
· When data is modified in the source database for the first time, the old value of the modified data is copied to the sparse file
· If the same data is the subsequently changed again, those changes will be ignored and not copied to the snapshot
· When you query the snapshot, it first checks if the data is available in the snapshot. If it’s there it reads if from the snapshot. If it’s not there, I reads through to the source database and gets the data from there instead, because that means the data has not yet changed since the time the snapshot was taken
No comments:
Post a Comment