Answered by:
Moving Indexes to new drive

Question
-
Hi All,
I want to move all indexes into new separate drive for this I need to create new .ndf file in particular drive.
Mirroring has configured for the DB but the principal and mirror servers do not have same drives.
In principal I want to move indexes to new I:/ drive and the I:/ derive is not present in mirror server Please suggest.- Edited by ImranKazi Wednesday, September 2, 2015 2:54 AM
Wednesday, September 2, 2015 2:53 AM
Answers
-
The way we used to do this when we still had mirroring around was:
1) Add the file (Mirror goes to suspended)
2) Make a Log Backup on Primary
3) Break mirror (disclaimer: I am not sure if you really need to do that or if the next steps runs without it as well... It has been too long...)
4) Restore the one Log Backup on the Mirror WITH MOVE clause (and NORECOVERY)
5) Reestablish the mirror
The whole process takes about 5 minutes to do and generates very little traffic overhead.- Edited by PrinceLucifer Wednesday, September 2, 2015 4:48 PM
- Proposed as answer by Uri DimantMVP Thursday, September 3, 2015 7:12 AM
- Marked as answer by Lydia ZhangMicrosoft contingent staff Wednesday, September 9, 2015 7:18 AM
Wednesday, September 2, 2015 4:47 PM -
Moving the index itself does not impact the mirror, as long as you don't create new files.
- Marked as answer by Lydia ZhangMicrosoft contingent staff Wednesday, September 9, 2015 7:18 AM
Thursday, September 3, 2015 3:57 AM
All replies
-
As you probably know moving a CI all the data will be moved to the new drive
Read this thread
http://stackoverflow.com/questions/4237238/moving-all-non-clustered-indexes-to-another-filegroup-in-sql-server
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
Wednesday, September 2, 2015 3:45 AM -
As you probably know moving a CI all the data will be moved to the new drive
Read this thread
http://stackoverflow.com/questions/4237238/moving-all-non-clustered-indexes-to-another-filegroup-in-sql-server
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
one small update I am moving only non-cluster index
what about mirroring does it work- Edited by ImranKazi Wednesday, September 2, 2015 5:20 AM
Wednesday, September 2, 2015 5:18 AM -
You can deploy database mirroring with different drive structure, but if you add a file to the Principal, the DDL commands get applied across the Mirror, then your database probably goes into a suspended mode status
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
Wednesday, September 2, 2015 6:57 AM -
You can deploy database mirroring with different drive structure, but if you add a file to the Principal, the DDL commands get applied across the Mirror, then your database probably goes into a suspended mode status
It means I need to remove mirroring and after creating new FG and .ndf file I will have to recreate mirroring
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
Right?Wednesday, September 2, 2015 10:53 AM -
Yes, ideally yes.
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
Wednesday, September 2, 2015 11:06 AM -
The way we used to do this when we still had mirroring around was:
1) Add the file (Mirror goes to suspended)
2) Make a Log Backup on Primary
3) Break mirror (disclaimer: I am not sure if you really need to do that or if the next steps runs without it as well... It has been too long...)
4) Restore the one Log Backup on the Mirror WITH MOVE clause (and NORECOVERY)
5) Reestablish the mirror
The whole process takes about 5 minutes to do and generates very little traffic overhead.- Edited by PrinceLucifer Wednesday, September 2, 2015 4:48 PM
- Proposed as answer by Uri DimantMVP Thursday, September 3, 2015 7:12 AM
- Marked as answer by Lydia ZhangMicrosoft contingent staff Wednesday, September 9, 2015 7:18 AM
Wednesday, September 2, 2015 4:47 PM -
You can deploy database mirroring with different drive structure, but if you add a file to the Principal, the DDL commands get applied across the Mirror, then your database probably goes into a suspended mode status
Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/
It means I need to remove mirroring and after creating new FG and .ndf file I will have to recreate mirroring
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting: Large scale of database and data cleansing
Remote DBA Services: Improves MS SQL Database Performance
SQL Server Integration Services: Business Intelligence
Right?Yes, ideally yes.
OK, If I have removed mirroring and moved only 10 non-idx and then recreate mirroring with moving new files after recreating mirroring I moved some more indexes then what will happen does mirroring work or there will be any issue .
Thursday, September 3, 2015 3:45 AM -
Moving the index itself does not impact the mirror, as long as you don't create new files.
- Marked as answer by Lydia ZhangMicrosoft contingent staff Wednesday, September 9, 2015 7:18 AM
Thursday, September 3, 2015 3:57 AM