Before the first step, make sure to locate the appropriate MDF and LDF files for a database you want to work with. Also, any existing connections to a database must be closed. In case a database is being used by any Windows services or other resources, these must be stopped in order to allow altering SQL database files. We’ll use a sample AdventureWorks database in this case. Let’s see how to move database files to another location. However, what if a SQL database is a production one or it is being constantly used by the specific application? This means that when it comes to the point of a low disk space, there should be a way to move database files (MDF and LDF) to another drive (with sufficient disk space) while the actual database will still be hosted by the same SQL Server instance. By default, SQL Server stores database files in its installation folder, specifically in the Data folder: How often you got to the point that for any reason you don’t have enough space on the specific drive to host a database? In case of database development or other tasks outside the production environment, this should not be a problem as a database can be eventually re-created, restored from a backup and set to be hosted on another location.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |