Hi, I generated bak file using this query from DATABASE Test , BACKUP DATABASE Test TO DISK = 'Test.bak' WITH INIT For restoring I gave another DATABASE restoreDB RESTORE DATABASE [restoreDB] FROM DISK = 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupTest.bak' WITH REPLACE, MOVE 'restoreDB_Data' TO 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLData estoreDB.mdf', MOVE 'restoreDB_Log' TO 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLData estoreDB.ldf' then I got this error. Logical file 'restoreDB_Data' is not part of database 'restoreDB'. Use RESTORE FILELISTONLY to list the logical file names. RESTORE DATABASE is terminating abnormally. The main aim is to copy entire DATABASE Test to DATABASE restoreDB. Thanks in advance.
It must be the problem of logical Data and log file name Run the following command and copy the logical name and replace the strikthrough portion belowRESTORE FILELISTONLY FROM DISK='Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupTest.bak' RESTORE DATABASE [restoreDB] FROM DISK = 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupTest.bak' WITH REPLACE, MOVE 'LogicalDatafileName' TO 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLData estoreDB.mdf', MOVE 'LogicalLogfilename' TO 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLData estoreDB.ldf' The logical name must be the name in backup set not the target db Madhu
Dear Madhu, Thanks for ur help. From your query I tried like this RESTORE FILELISTONLY FROM DISK='Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupTest.bak' RESTORE DATABASE [restoreDB] FROM DISK = 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLBackupTest.bak' WITH REPLACE, MOVE 'Test' TO 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLData estoreDB.mdf', MOVE 'Test_Log' TO 'Crogram FilesMicrosoft SQL ServerMSSQL.1MSSQLData estoreDB.ldf' Then I got this error. There is insufficient free space on disk volume 'C:' to create the database. The database requires 22681174016 additional free bytes, while only 19623108608 bytes are available. Problems were identified while planning for the RESTORE statement. Previous messages provide details. RESTORE DATABASE is terminating abnormally. ie it needs 32768 GB of space. Help me to solve.
Easy, erase some files to get more space for database.Or, if you have other physical or logical disk, move mdf to that one.
[quote user="baburk"] ie it needs 32768 GB of space [/quote] It needs '21.1234893798828' GB not 32768.... as 22681174016 Byte = 22149584 KB 22149584 KB = 21630.453125 MB 21630.453125 MB = 21.1234893798828 GB See if your C drive has enough space available. Hope this helps
Just to add up you might find the backup file size may not be that big as compared to the data files, but when it needs to restore the actual MDF & LDF files sizes must be created back there. So in this csae see if you have additional space within your system to test the backup.