I have a database which was in "Read_only" mode and "Simple" recovery model. After changing DB mode to Read_write and recovery model to Full. I ran full backup which was completed successfully but when I try to take log backup, my process failed with following error.
The statement BACKUP LOG is not allowed while the recovery model is SIMPLE. Use BACKUP DATABASE or change the recovery model using ALTER DATABASE. BACKUP LOG is terminating abnormally.
SO.I would like to ask you , is there a possibility that log backup failed because database was in Read_only from so long and no DML queries were executed on DB ?
Answer by Dnirmania ·
Thanks @JohnM for your response but i think, I Figured out the cause of this issue. In my PS script, I was first changing the Recovery model of DB and then Changing it to read_write.Sounds weird right? Somehow, PS cmdlet changing the recovery of DB without updating its mode and metadata. I used DBAtools cmdlet to do that. Now I have updated my PS script and Its working as expected.