数据库mdf和ldf文件_如何将SQL数据库文件(MDF和LDF)移动到另一个位置

本文介绍了如何在磁盘空间不足时,将SQL数据库的MDF和LDF文件移动到其他驱动器,同时保持数据库在同一个SQL Server实例上运行。操作包括停止相关服务、关闭数据库连接、确定正确文件、创建新位置的文件夹以及调整SQL Server访问权限。
摘要由CSDN通过智能技术生成

数据库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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值