Usage Scenario: 1. The database grows larger, the storage disk space is not enough;
2. In certain circumstances, the database needs to be moved to another disk (hehe ... My situation is that the previous disk will be returned to others)
Step: 1. New query
SELECT name, Physical_name
From Sys.master_files
WHERE database_id = db_id (' YourDatabaseName ');
GO
View the results to see the database Master file and the name of the log and the address name of the physical store
2. New Query
Use master
ALTER DATABASE AZPLATFORM01
Modify file (NAME = ' YourDatabaseName ', Filename = ' F:\DATA\yourDataBaseName.mdf ');
GO
ALTER DATABASE AZPLATFORM01
Modify file (NAME = ' Yourdatabasename_log ', Filename = ' F:\DATA\yourDataBaseName.ldf ');
GO
3. The database that will be moved offline
4. Manually copy the files to the destination path (F:\DATA\)
5. The database that will be moved is online
6. New Query
SELECT name, Physical_name
From Sys.master_files
WHERE database_id = db_id (' YourDatabaseName ');
GO
Verify through OK.
Experience is shallow, pat, welcome to Exchange