--At First take ypur database backup and restore it as DatabaseName_Test and also change Datafiles As database _test.mdf and DatabaseName_test_log.ldf
--try to follow as below script
USE master
GO
BACKUP DATABASE [DatabaseName]
TO DISK = N'D:\SQLSERVER_Installation\setup\MSSQL12.SQLSERVER2014\MSSQL\Backup\DatabaseName.bak'
WITH COPY_ONLY, NOFORMAT, NOINIT,
NAME = N'DatabaseName-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
GO
USE [master]
RESTORE DATABASE [DatabaseName_Test] FROM
DISK = N'D:\SQLSERVER_Installation\setup\MSSQL12.SQLSERVER2014\MSSQL\Backup\DatabaseName.bak'
WITH FILE = 2,
MOVE N'DatabaseName' TO N'D:\SQLSERVER_Installation\setup\MSSQL12.SQLSERVER2014\MSSQL\DATA\DatabaseName_test.mdf',
MOVE N'DatabaseName_log' TO N'D:\SQLSERVER_Installation\setup\MSSQL12.SQLSERVER2014\MSSQL\DATA\DatabaseName_test_log.ldf', NOUNLOAD, STATS = 5
GO
沒有*命令*就無法提供幫助。無論如何,備份/恢復沒有任何問題。所有數據庫都是「實時」的。您是否嘗試恢復原始數據庫?你指定了一個新名字嗎? –
@PanagiotisKanavos我做的是:右鍵單擊數據庫列表,恢復數據庫,選擇原始設備,選擇.bak,選擇命運,重命名數據庫,更改日誌路徑和文件路徑,然後轉到。 –