beautypg.com

How to determine the size of the transaction log – Grass Valley Aurora Browse v.6.0b Installation User Manual

Page 112

background image

112

Aurora Browse Installation and Configuration Guide

September 22, 2006

Chapter 4 Recovery Planning

determine the size of the transaction log” on page 112

.

• When necessary, manually back up the database and the transaction log, then

shrink the transaction log file to release disk resources to the operating system, as
explained in

“Manually controlling transaction log growth” on page 113

.

• Set up a database maintenance plan. This automatically backs up the transaction

log and the database. Refer to

“Setting up a database maintenance plan” on

page 113

.

Repairing a database that is unusable due to transaction log size

If the database is rendered inoperable due to the transaction log becoming too large,
it is highly likely that the transaction log has never been backed up, a database
maintenance plan has not been enabled on the system, or the SQL Server agent is not
running to implement your maintenance plan. The following steps should resolve the
problem:

1. Open SQL Query Analyzer

2. Make sure the database in question is selected in the top tool bar. (For this example

the MediaFrame database will be used.)

3. First try to backup the transaction log without truncating it by running the

following command:

BACKUP LOG MediaFrame TO Disk = 'filePath\fileName.trn'

Where filePath and fileName is user specified, (e.g. D:\Emergency
Backups\MediaFrame_tran_12052003.trn) if the file does not already exist, you
will need to create it. If the transaction log is full it is likely that this command will
fail but it is important to try it to maintain database integrity.

4. Regardless if the previous command passes or fails, execute the following

command to clear the transaction log:

BACKUP LOG MediaFrame WITH TRUNCATE_ONLY

5. To free unused resources to the operating system execute the following command:

DBCC SHRINKFILE(MediaFrame_log, 2)

How to determine the size of the transaction log

When SQL is installed the space that it is allotted on the operating system is divided
into two parts: 50% is given to store transaction logs and 50% is reserved for data. To
identify the amount of space the transaction logs is taking up, open SQL Query
Analyzer and execute the following command.

DBCC sqlperf(logspace)

This command will return the amount of space each database’s transaction log is
taking up and the percentage of space the transaction log is using. The column that
lists the percent of space the transaction log is taking up is misleading. Aurora Browse
databases set the transaction log growth limit to 500MB. If one of the databases
transaction logs is larger than 350MB, then follow the steps in the next procedure

“Manually controlling transaction log growth”

.

This manual is related to the following products: