BACKUP LOG cannot be performed because there is no

2020-05-13 04:16发布

I tried to restore a database but this message showed. How do I restore this database?

Restore of database 'farhangi_db' failed.
(Microsoft.SqlServer.Management.RelationalEngineTasks)
------------------------------ ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: BACKUP LOG cannot be performed because
there is no current database backup. (Microsoft.SqlServer.SmoExtended)

标签: sql-server
14条回答
唯我独甜
2楼-- · 2020-05-13 04:46
  1. Make sure there is a new database.
  2. Make sure you have access to your database (user, password etc).
  3. Make sure there is a backup file with no error in it.

Hope this can help you.

查看更多
Explosion°爆炸
3楼-- · 2020-05-13 04:51

In my case I am restoring a SQL Server 2008 R2 Database to SQL Server 2016 After selecting the file in the General tab, you should go to the Options tab and do 2 things:

  1. You must activate Overwrite existing database
  2. You must deactivate end of record copy
查看更多
爷的心禁止访问
4楼-- · 2020-05-13 04:53

I just deleted the existing DB that i wanted to override with the backup and restored it from backup and it worked without the error.

查看更多
我只想做你的唯一
5楼-- · 2020-05-13 04:55

In our case it was due to the Recovery Model on the primary database having been changed after we did the backup in preparation for setting up log shipping.

Ensuring the Recovery Model was set to Full Recovery before doing the backup and setting up log shipping resolved it for us.

查看更多
小情绪 Triste *
6楼-- · 2020-05-13 04:57

Another cause of this issue is when the Take tail-log backup before restore "Options" setting is enabled.

On the "Options" tab, Disable/uncheck Take tail-log backup before restore before restoring to a database that doesn't yet exist.

查看更多
再贱就再见
7楼-- · 2020-05-13 04:58

I am not sure whether the database backup file, you trying to restore, is coming from the same environment as you trying to restore it onto.

Remember that destination path of .mdf and .ldf files lives with the backup file itself.

If this is not a case, that means the backup file is coming from a different environment from your current hosting one, make sure that .mdf and .ldf file path is the same (exists) as on your machine, relocate these otherwise. (Mostly a case of restoring db in Docker image)

The way how to do it: In Databases -> Restore database -> [Files] option -> (Check "Relocate all files to folder" - mostly default path is populated on your hosting environment already)

查看更多
登录 后发表回答