I Recently upgraded from sql server 2008 to 2019 and have noticed SQL would start to freeze up and crash a few times a day. I narrowed it down to a shrink logs job I added to sql Agent. I have been using this shrink log job for years in sql server 2008 and never experienced this issue. This is The Job that runs every 30 minutes:
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE MyDB
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (Places_log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE MyDB
SET RECOVERY FULL;
GO
Is there a better way I can do this? Honestly I do not need the Log files at all but ive been told there was no safe way to disable log files completely and the only way to remove them is to automate shrinking them as they come in.