Log file is corrupted (there is no backups, how u will get database?
Log file is corrupted (there is no backups, how u will get database?
A:
SELECT name, state, state_desc FROM sys.databases WHERE name='ABCD'
Output for state_desc was RECOVERY_PENDING.
I instructed him to set database to the emergency mode.
ALTER DATABASE ABCD SET EMERGENCY
Then, set the database to single use mode and started the rollback.
ALTER DATABASE ABCD SET SINGLE_USER WITH ROLLBACK IMMEDIATE
Then rebuilt the log by ,
DBCC CHECKDB('ABCD',REPAIR_ALLOW_DATA_LOSS)
Then executed the initial statement and verified that database is ONLINE.
Below execution is to make that every use can log into the database.
ALTER DATABASE ABCD SET MULTI_USER
With this, users were able to login to the database without any issues.