How to prepare files, logs and the environment for a database diagnosis

In database-related incidents, the most valuable assets are not only the .mdf, .ldf, .db files or working copies themselves, but also the context: the application name, system version, the last known-good moment and the exact error messages shown by the console or program. This helps distinguish a database failure from a wider problem with the environment, the drive or the virtual machine.

If you still have backups, SQL Server logs, the application folder or an export from the last working day, do not overwrite the original files with them. The safest approach is to preserve the current state first and only then decide on the next diagnostic step. In accounting, payroll and business cases, the biggest risk is often not the database itself, but a chain of rushed repair attempts.

  • Write down the program name and database version: Płatnik, Optima, Subiekt, SQL Server, Access or another business system.
  • Keep the exact error messages, the date of the last successful launch and information about any attempted repair, restore or migration after the incident.
  • Do not reinstall the application and do not replace database files without keeping a binary copy of the originals.

Which files and details actually speed up the diagnosis

In practice, diagnosis is much faster when the database comes together with basic context: the folder structure, server logs, usernames, the last correct write time and information about whether the failure happened after a power outage, drive error, system update or ransomware incident. Without that context, we first need to rebuild the incident timeline and only then diagnose the logical or physical damage.

In accounting and ERP systems, seemingly small details also matter: whether the database was stored on a server or a single workstation, whether it ran from a network share, whether somebody copied files while the application was still live, and whether a manual index or consistency repair was already attempted. Those details can determine whether it is safer to work on a logical copy, a full media image or directly on the database structure.

What not to do after a database error

  • Do not run several repair tools one after another just to see whether something starts working.
  • Do not restore older backups over the same production files without preserving the original state.
  • Do not compress, move or reattach a damaged database between computers without keeping a binary copy first.
  • Do not assume the issue is purely software-related if there were drive errors, power loss, freezes or RAID/NAS problems beforehand.

If the issue affects a production environment, secure what exists right now: current files, the application folder, logs and the storage itself if needed. Only then decide whether this is primarily a case for drive data recovery, RAID or server recovery or strict database repair. In many companies, a database failure is only a symptom of a larger storage problem.

When contacting a laboratory makes the most sense

If the application stopped opening the database after a power outage, the system reports read errors, the server disappears from the network or the files suddenly have abnormal sizes, it is safer not to run more operations on the original environment. This is especially true for Płatnik, Optima, Subiekt and SQL-based environments, where the damage may affect both the logical structure and the storage underneath it.

If you want to organise the broader business context first, also see our materials about data recovery for businesses, drive failure with accounting / HR data and GDPR and the first 24 hours after a server or NAS failure.

How should you prepare files and information so database repair does not take longer?

With database cases, not only the file itself matters, but also the incident context. It helps to note the program name, system version, the exact error message, when the problem first appeared and whether updates, a server restart or a backup job were running at the same time. For systems such as Płatnik, Optima, SQL Server or Subiekt, those details help assess whether the failure is logical, file-based or related to the storage layer.

If backups, logs or earlier versions of the database are available, secure them and avoid overwriting the originals. The same applies to exports, archives and local working copies. The fewer chaotic attempts are made on the live environment, the higher the chance that database recovery and structural rebuild will be faster and safer.

When is the database issue logical, and when can it mean underlying media failure?

Not every database error means physical drive damage, but some scenarios clearly require that possibility to be considered. If application errors are accompanied by delayed write warnings, copy failures, system freezes or disappearing files, the root cause may go beyond the database engine itself. Continuing to work on the same storage in that state can increase the damage and reduce the chances of a clean recovery.

In practice, it is worth comparing the case with scenarios described in Drive failure with accounting / HR data and GDPR, the first 24 hours after a server or NAS failure and VMware / Hyper-V / SAN data recovery. This makes it easier to decide whether the incident can be solved as a logical database repair or whether it already requires full media diagnostics in the laboratory.

Related articles