When disaster strikes in the Exchange server, you must have a contingency plan in place to recover from it quickly and most importantly, without any data loss. In such a situation, apart from relying on the Exchange native tools, it is suggested to keep in hand a third-party Exchange recovery application, such as Stellar Repair for Exchange.
Why would you keep an application in hand?
The native applications in Exchange, such as Exchange Extensible Storage Engine Utility (Eseutil) take a considerable amount of time, need more resources, and take up a lot of administrative effort. In addition, there is no guarantee that your databases will get back to a healthy state. Also, for these tools to work, your Exchange Server must be online.
Most of the time, one cannot solve problems when an Exchange Server is attacked by Ransomware. In such a situation, the Exchange Server will not work properly because most of the operating system files, including Exchange Server, will be encrypted and your server would be reduced to almost nothing.
Having a Database Availability Group (DAG) would not help if the other nodes have been attacked as well. The database would not be easily affected, but without a functioning Exchange Server, you cannot do much.