数据库mdf和ldf文件
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. By default, SQL Server stores database files in its installation folder, specifically in the Data folder:
您多久一次发现由于某种原因您在特定驱动器上没有足够的空间来承载数据库? 对于数据库开发或生产环境之外的其他任务,这应该不成问题,因为可以最终重新创建数据库,从备份中还原数据库并将其设置为托管在其他位置。 默认情况下,SQL Server将数据库文件存储在其安装文件夹中,尤其是在Data文件夹中:
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. Let’s see how to move database files to another location. We’ll use a sample Adven