[英]How do I import a .bak file into Microsoft SQL Server 2012?
谷歌搜索了一段时间没有答案....任何人都可以帮忙吗?
For SQL Server 2008, I would imagine the procedure is similar...? 对于SQL Server 2008,我会想象程序类似......?
Not sure why they removed the option to just right click on the database and restore like you could in SQL Server Management Studio 2008 and earlier, but as mentioned above you can restore from a .BAK
file with: 不确定为什么他们删除了右键单击数据库并在SQL Server Management Studio 2008及更早版本中进行恢复的选项,但如上所述,您可以从.BAK
文件恢复:
RESTORE DATABASE YourDB FROM DISK = 'D:BackUpYourBaackUpFile.bak' WITH REPLACE
But you will want WITH REPLACE
instead of WITH RESTORE
if your moving it from one server to another. 但是如果你将它从一个服务器移动到另一个服务器,你将需要WITH REPLACE
而不是WITH RESTORE
。
.bak
is a backup file generated in SQL Server. .bak
是SQL Server中生成的备份文件。
Backup files importing means restoring a database, you can restore on a database created in SQL Server 2012 but the backup file should be from SQL Server 2005, 2008, 2008 R2, 2012 database. 备份文件导入意味着还原数据库,您可以在SQL Server 2012中创建的数据库上进行还原,但备份文件应该来自SQL Server 2005,2008,2008 R2,2012数据库。
You restore database by using following command... 您可以使用以下命令恢复数据库...
RESTORE DATABASE YourDB FROM DISK = 'D:BackUpYourBaackUpFile.bak' WITH Recovery
You want to learn about how to restore .bak
file follow the below link: 您想了解如何恢复.bak
文件,请点击以下链接:
http://msdn.microsoft.com/en-us/library/ms186858(v=sql.90).aspx http://msdn.microsoft.com/en-us/library/ms186858(v=sql.90).aspx
You can use the following script if you don't wish to use Wizard; 如果您不想使用向导,可以使用以下脚本;
RESTORE DATABASE myDB
FROM DISK = N'C:\BackupDB.bak'
WITH REPLACE,RECOVERY,
MOVE N'HRNET' TO N'C:\MSSQL\Data\myDB.mdf',
MOVE N'HRNET_LOG' TO N'C:\MSSQL\Data\myDB.ldf'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.