As per the title, how much is it safe to use
BACKUP LOG db_name WITH TRUNCATE_ONLY in last STEP of any SQL-job execution? Randomly found on google that this Code line can be very harmful in use. But how?
I am using my code as below in one of my SQL-job's last STEP.
BACKUP LOG my_database with Truncate_Only DBCC SHRINKFILE (N'my_database_Data') DBCC SHRINKFILE (N'my_database_Log')
Let me simplify the question with below aspects:
- What actually doing this code in the SQL-Job? Does it really help?
- Is there anything related performance of the DB-Server?
- If I remove first line of code (
BACKUP LOG), how it can get effect?
- Currently I am not able see SQL-Job history of same SQL-Job, is this the reason that it clears all logs?
This could be opinion based question but still let's discuss if you can share some Ideas on it.