M
M
Maksim2019-03-12 10:18:17
SQL Server
Maksim, 2019-03-12 10:18:17

MS SQL 2017 deleted LDF file how to restore the database?

Good afternoon,
an LDF file was deleted from one of the databases, is it possible to restore the database?
tried this scenario: blog.vb76.com/vosstanovlenie-bazy-ms-sql-after-uda...
But trying to query via MSSMS:
Object reference not set to an instance of an object

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
abmanimenja, 2019-03-12
@abmanimenja

Remove LDF from config, add new empty LDF to config.
If the checkpoint was recently, then you are lucky.
If for a long time - that the data just in LDF mainly also were.
dbcc check do not forget
PS:
Even before that, you can try to restore the file, for example, through R-Studio.
If nothing was written to this disc, of course.

K
Konstantin Tsvetkov, 2019-03-12
@tsklab

Search ms sql connect mdf file without ldf . That is, you detach the database (although the connected LDF cannot be deleted) and attach it without a log:

CREATE DATABASE [База Данных] ON ( FILENAME = 'База Данных.mdf' ) FOR ATTACH_REBUILD_LOG 
GO

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question