Manually controlling transaction log growth, Setting up a database maintenance plan, Setting up a database maintenance plan” on – Grass Valley NewsBrowse Desktop Browsing System Installation v.2.7 User Manual
Page 125

December 16, 2004
NewsBrowse Installation and Configuration Guide
125
Manually controlling transaction log growth
Manually controlling transaction log growth
Use this procedure when the transaction log is approaching its size limit. First back
up the database and the transaction log to keep a record of its current state. Then flush
and shrink the transaction log file to reduce its size. To do this open SQL Enterprise
Manager and manually backup the database and transaction log of the database in
question. The steps to do this are as follows:
1. From the Enterprise Manager right mouse click the database in question; select
All
Tasks\ Backup Database…
2. Make sure that the
Database Complete
radio button is selected.
3. In the
Destination
section under
Backup to:
, check the file path and make sure the
file has a .bak extension. If it does not have a .bak extension or the path is not where
you would like the backup file to reside, click the
Remove
button to remove the file
and the associated path. Click the
Add…
button and browse to the directory to
which you would like to store the file. Make sure you give it a file name with the
.bak file extension. (For example: D:\DB\MediaFrame.bak) Click the
OK
button
and verify that the path entered is listed in the Backup to: list.
4. In the
Overwrite
section make sure that
overwrite existing media
radio button is
selected.
5. Click the
OK
button to backup the database.
6. To backup the transaction log the steps are very similar. Open the Enterprise
Manager right mouse click the database in question, select
All Tasks\ Backup
Database…
7. Make sure that the
Transaction log
radio button is selected.
8. In the
Destination
section under
Backup to:
, check the file path and make sure the
file has a .trn extension. If it does not have a .trn extension or the path is not where
you would like the backup file to reside, click the
Remove
button to remove the file
and the associated path. Click the
Add…
button and browse to the directory to
which you would like to store the file. Make sure you give it a file name with the
.trn file extension. (For example: D:\DB\MediaFrame.trn) Click the
OK
button and
verify that the path entered is listed in the Backup to: list.
9. In the
Overwrite
section make sure that
overwrite existing media
radio button is
selected.
10.Click the
OK
button to backup the Transaction log.
11.Open SQL Query Analyzer.
12.Make sure the database in question is selected in the top tool bar.
13.Execute the following code:
BACKUP LOG MediaFrame WITH TRUNCATE_ONLY
DBCC SHRINKFILE(MediaFrame_log, 2)
Setting up a database maintenance plan
The best way to control the growth of transaction logs is to simply back them up, once
a day at the very least. SQL 2000 makes it very easy to set up a database maintenance
schedule. Before you begin implementing a database maintenance plan using the SQL