I am using the SQL script on Select SQL Server database size in order to monitor how much my database file usage increased. I am particularly inspecting the "data_used_size" and "log_used_size" fields. But I notice that while the data file usage consistently increases after a set of activities, log file usage sometimes increases and sometimes decreases, thus always staying at a certain level. Why is this?
            Asked
            
        
        
            Active
            
        
            Viewed 72 times
        
    1
            
            
        - 
                    In short: stuff get written and stuff gets cleaned up. There are many guides to this. For starters what is the recovery model? – Nick.Mc Feb 12 '18 at 02:09
- 
                    @Nick.McDermaid Full recovery. – John L. Feb 12 '18 at 02:10
- 
                    I suggest you read the article posted in the answers below and ask a specific question if you have one – Nick.Mc Feb 12 '18 at 02:12
1 Answers
4
            This is documented in MSDN article about Transaction Log
- If the DB is using simple recovery model, after a checkpoint
- If full recovery model or bulk-logged recovery model is used, then after a log backup.
 
    
    
        Martheen
        
- 5,198
- 4
- 32
- 55
- 
                    But I am using the full recovery model and not doing any backups in the meanwhile. – John L. Feb 12 '18 at 02:12
- 
                    Is there a size restriction set in DB properties? Maybe there's a scheduled job to auto backup/ – Martheen Feb 12 '18 at 02:20
- 
                    Sorry, I was mistaken when I said it is in full recovery mode. I checked it again and it is in simple recovery mode. I will accept your answer. – John L. Feb 12 '18 at 02:37
 
    