Tuesday 12 July 2011

How to move database physical_files from one drive to another drive (location

Please follow the below steps :

1)  Alter database abc (file=logical file name for data file ,
filename='new location or path');
Alter database abc (file=logical file name for log file ,
filename='new location or path');
for example
Alter database abc (file=abc,
filename='d:\abc.mdf');
Alter database abc (file=abclog,
filename='e:\abc_log.ldf');

2) Stop the sql server services.

3) Move the physical files (.MDF and LDF) from old location to new location .

4).Restart the Sql Server Services .

5) Veryify new location by using below command 

select * from sys.master_files ;

No comments:

Post a Comment