Rant Image

The Risk

Please help me understand something regarding the transaction log Hello

Submitted by Wesker » Thu 03-Dec-2020, 23:13

Subject Area: Testing

Keywords: SQL, databases, transaction, log

1 member rating

I'm quite new in the world of SQL. I do not use the databases myself, rather I only have a pure operations role. Unfortunately I feel like the SQL knowledge in my team is lacking and I'm not getting a good grip on a specific issue.

A couple of times now i've had servers were the transaction log grows very large, fills up the disk and it won't shrink after a log backup.

What is the best course of action in these scenarios? I've googled a bit, but I just get confused because everyone seems to have different opinions

The scenario I had today:

DB around 200 GB, Logfile around 310 GB.

Got an event saying

"Database log file is full. Back up the transaction log for the database to free up some log space - The transaction log for database ''DATABASE'' is full”"

Doing a log backup did nothing running "SELECT name, log_reuse_wait_desc FROM sys.databases;"

Showed LOG_BACKUP as waiting.

"DBCC OPENTRAN"

showed no active open transactions

"DBCC Loginfo"

Showed status 0 on everything except 2 entries which had "2".

I performed two more log backups and now everything had status 0, but the size remained unchanged.

Available free size was reported as 98%

The disk was completely full, so in this case I had no choice but to shrink it but what am I supposed to do in these scenarios?


1 Comment 

Member Comments

RE: Please help me understand something regarding the transaction log Hello

SQL transaction log

By Wesker » Sun 13-Dec-2020, 20:58, My rating: ✭ ✭ ✭ ✭ ✭

Well, as such, the SQL transaction log is a crucial part of the SQL Server database. Should any system failure occurs, having daily taken T-log backups is crucial so database data can be safely recovered.

Email to a friend

Email this Risk Statement to a friend

%0ASee:%0A http://www.chambers.com.au/forum/view_post.php?frm=3%26pstid=7857" alt="Email to a friend" />