0

Good afternoon,

Accidentally a database has been lost, the only thing that is conserved is a file of transactional logs (.trn), and we want to obtain as much information as possible.

It is trying to load with the command:

RESTORE LOG "DatabaseName" FROM DISK = N'D: \ bakupFile.trn 'WITH RECOVERY;

But the name of the database is not remembered, so the command always fails.

Does anyone know how to proceed?

Thank you.

jarlh
  • 42,561
  • 8
  • 45
  • 63
user1814720
  • 93
  • 1
  • 8
  • The full backup of the DB was also lost? If the DB was in simple mode or psuedo-simple mode, then the logs would have constantly been recycled. You need a DB backup as the starting point to restore from, and to of at least been in bulk logged mode / fully logged mode. – Andrew Apr 08 '19 at 11:51
  • 2
    You can't restore a database from transaction logs alone. You first must restore from a full database backup. – Dan Guzman Apr 08 '19 at 11:51
  • And if you can't even remember the name of the database, how important could it be? – Aaron Bertrand Apr 08 '19 at 12:02
  • 1
    Although this won't be useful without the database backup, you can get the database name from the transaction log backup with `RESTORE HEADERONLY FROM DISK='D:\bakupFile.trn';` – Dan Guzman Apr 08 '19 at 12:05
  • @dan-guzman You mean it is not possible to recover anything without the bak? – user1814720 Apr 08 '19 at 12:18
  • @user1814720, if the database data files still exist you might have some options to salvage data. You need a full backup otherwise. – Dan Guzman Apr 08 '19 at 12:33
  • @dan-guzman I have some fragments of a .bak (without password), but I can not find documentation about the file format to see if I can recover anything. I'm also trying to recover doing carving, but I only know how the file starts (MSSQLBAK) but I do not know how it ends. – user1814720 Apr 08 '19 at 12:38
  • @user1814720 Read the .TRN log file to findout database name. This is the only way... You have to recognize it with any column of any table or whatever, [see this answer](https://stackoverflow.com/questions/4507509/how-to-view-transaction-logs-in-sql-server-2008) – ARr0w Apr 09 '19 at 07:20

0 Answers0