How to Truncate the Transaction Log of a SQL Server 2008\Express Database

Similar documents
How to Copy A SQL Database SQL Server Express (Making a History Company)

PCSchool SQL Backup Tech Tip. SQL Backup Tech Tip. Created in version /9

BSDI Advanced Fitness & Wellness Software

AuditWizard v8. SQL Maintenance

How to Backup and FTP your SQL database using E2.

Symantec Enterprise Vault Technical Note. Administering the Monitoring database. Windows

Moving the Web Security Log Database

Backing Up CNG SAFE Version 6.0

Restoring Sage Data Sage 200

Migrating documents from Business Objects Reporter to Web Intelligence XI R2

KEYWORDS InteractX, database, SQL Server, SQL Server Express, backup, maintenance.

Microsoft SQL Server Scheduling

Notes Transfer instructions INTRODUCTION More information

GO!NotifyLink. Database Maintenance. GO!NotifyLink Database Maintenance 1

HELP DOCUMENTATION E-SSOM BACKUP AND RESTORE GUIDE

Moving the TRITON Reporting Databases

This article Includes:

SQL Server 2005 Advanced settings

Backing up your WebCT Course

Protecting SQL Server Databases Software Pursuits, Inc.

Support Document: Microsoft SQL Server - LiveVault 7.6X

Microsoft SQLServer Restore / Redirected Restore Procedure

Installing LearningBay Enterprise Part 2

1 of 10 1/31/2014 4:08 PM

Basic SQL Server operations

How to backup with R1soft

A. I do not have my own personal certificate I am a new client or want to download a new certificate

How to protect, restore and recover SQL 2005 and SQL 2008 Databases

How to Back Up and Restore an ACT! Database Answer ID 19211

PC Angel. Recovery. Page 1

How to manage the Adaptive Call Recorder (v.9-50)

Microsoft SQL Server 2005 How to Create and Restore Database (GRANTH3) Manually

SQL Database Administration. Overview

Moving a Romexis Database to an Existing SQL Instance

Lab: Data Backup and Recovery in Windows XP

Tool Tip. SyAM Management Utilities and Non-Admin Domain Users

Technical Bulletin. SQL Express Backup Utility

Installation Guide. (June 2014)

1. Open the License Manager either via the Start Menu or from C:\Keri\DoorsNET directory.

Backup & Restore. Backing Up and Restoring STX Databases For Non-OLS Subscribers

If you have questions or need assistance, contact PCS Technical Services using the contact information on page 10.

How to setup Backup Anywhere on your local PC

Technical Script AIST3410 Database Management systems p 1

How to Install CS OrthoTrac on a New Server and Copy the Data from the Old Server to the New Version 12 and higher

Moving BidMagic to a new system (Backup / Restore Utility)

InformationNOW SQL 2008 Database Backup and Restoration

Table of Contents. CHAPTER 1 About This Guide CHAPTER 2 Introduction CHAPTER 3 Database Backup and Restoration... 15

BSDI Advanced Fitness & Wellness Software

Lab - Data Backup and Recovery in Windows XP

Keystone Enterprise Backup

Microsoft SQL Server 2005 How to Create and Restore Database (GRANTH3) Manually

SELF SERVICE RESET PASSWORD MANAGEMENT BACKUP GUIDE

MONAHRQ Installation Permissions Guide. Version 2.0.4

Changing Your Cameleon Server IP

Implementing Microsoft SQL Server 2008 Exercise Guide. Database by Design

Working with Office Applications and ProjectWise

Automated backup. of the LumaSoft Gas database

Backup Exec Private Cloud Services. Planning and Deployment Guide

SQL Tuning and Maintenance for the Altiris Deployment Server express database.

Built-In Backup. For best results: Set up Backup after hours. Carefully apply the recommended settings

QUANTIFY INSTALLATION GUIDE

How To Upgrade Your Microsoft SQL Server for Accounting CS Version

USING FILERELICATIONPRO TO REPLICATE SQL SERVER

Database Backup and Restore Instructions. Version 6.5. Instructions

User Manual. Crystal Report Integration

Using Windows Task Scheduler instead of the Backup Express Scheduler

Upgrading a computer to Windows 10 with PetLinx

Table of Contents SQL Server Option

FaxCore 2007 Application-Database Backup & Restore Guide :: Microsoft SQL 2005 Edition

Accessing your Staff (N and O drive) files from off campus

How to Set Up a Shared SQL Express Database with ManagePro 7 Standard version

How To Create A Replica In A Database On A Microsoft Powerbook (Ahem) On A Linux Server (A.K.A.A)

Fax and SMS Quickguide

Database Operations (Backup/Restore/Move/Manage) Technical Support Engineering Rosslare Security NA For more information please see

Microsoft SQL Server Staging

Active Directory Integration for Greentree

HELP DOCUMENTATION E-SSOM BACKUP AND RESTORE GUIDE

THANK YOU FOR INSTALLING CARBONITE SERVER BACKUP!

How to Create a Delegated Administrator User Role / To create a Delegated Administrator user role Page 1

ONBASE OUTLOOK CLIENT GUIDE for 2010 and 2013

Installation Guide - Client. Rev 1.5.0

PCLaw Scheduled Backup

Upgrading Litium Studio. From version C to 4.3

DigiVault Online Backup Manager. Microsoft SQL Server Backup/Restore Guide

SonicWALL CDP 5.0 Microsoft Exchange InfoStore Backup and Restore

Online Backup Client Release Notes

Migrating MSDE to Microsoft SQL 2008 R2 Express

How to Add a Server/Disksafe/Volume

Setting up your new Live Server Account

Video Administration Backup and Restore Procedures

3 Setting up Databases on a Microsoft SQL 7.0 Server

About database backups

Preparing a SQL Server for EmpowerID installation

InformationNOW SQL 2005 Database Backup and Restoration

Online Statements. About this guide. Important information

Chapter 6. Using the SQL Server

Creating a Complete Backup of Shelby v5 Data

MSSQL quick start guide

BACKING UP A DATABASE

ecopy ShareScan 5.0 SQL installs guide

Transcription:

How to Truncate the Transaction Log of a SQL Server 2008\Express Database Although E2 is not responsible for the integrity of your database or for creating your backup routines, we are providing this Help Paper as an aid to help resolve a problem that is the result of not backing up or maintaining the transaction logs correctly. SQL Server implements transactions using a write-ahead log. Any changes requested to the database will first be written to the log. SQL Server ensures that the log will be written onto the disc before the actual data is written. This enables SQL Server to ensure integrity of the data, even if the system fails. If both the log and the data were written before the failure, the entire data is on the drive and integrity is ensured. If only the log was written (the data was either not written or not written completely), then the actions can be read from the log and repeated to restore integrity. If the log wasn't written, then also the integrity is maintained, even though the database is in a state as if the transaction never occurred. If it was only partially written, then the actions associated with the unfinished transaction are discarded. Since the log was only partially written, the data is guaranteed to have not been written, again ensuring data integrity. Removing the unfinished log entries effectively undoes the transaction. Once the data is written, the transaction in the log is marked as committed. The transaction log file will grow dynamically as more changes are made in the database. The log file starts at a specific size. When the free space in the log file is filled with transactions, SQL Server will automatically reserves additional free disk space from the hard drive to add to the file. Your E2 SQL Database was created using the Full Recovery Model setting. This means that if your backup routine is created correctly you can actually return your database to a specific point in time, in an emergency, by restoring backed up transaction logs. The downside is that when you do a full backup of the database, the transaction log is not automatically truncated and will continue to grow and use disk space. You can prevent this from happening by periodically truncating the transaction log or by implementing transaction log backups. If your database is set to the Simple Recovery Model, the transaction log is truncated as a part of each Full backup that you perform. The instructions provided here can be modified to manually truncate your transaction logs. First, make sure all users are out of E2 including Data Collection, PC Data Collection, E2 Trigger Server, E2 QB Server, and Quick View. The instructions below were written using the SQL Server Management Studio in the examples and may not match exactly what you will see if you use a different tool, however the basic instructions should be similar enough. 1. Log into a computer that has the SQL Server Management Studio or other 3 rd party SQL Server management tool installed. 2. If prompted, enter the appropriate login information and connect to the server.

3. Locate the Databases folder in the Object Explorer and expand it. 4. Right click on your database and select Properties from the menu.

5. In the Select a page pane, click Options. 6. At the top of the window, locate the Recovery Model field. Change this value from Full to Simple. 7. Click OK. 8. You will now need to perform a Full Backup of the problem database. This should truncate the log file for you. (Truncating the log file removes committed transactions from the log leaving only uncommitted transactions.) You could stop here and start using E2 again. However, the disk drive of your server may still be full. Complete the rest of the steps to return the free space now in the transaction log back to the disk.

9. Once you have completed the Full Backup, click the New Query button. 10. In the query tab where your cursor is flashing, type the following (replacing the XXXXX with the name of your database): DBCC SHRINKFILE (XXXXX_LOG, 2) 11. Click the Execute button. 12. You should see something similar in the results to the example below when the command has completed. 13. You have a choice to make now. You can either leave the database in the Simple Recovery Model or change it back to the Full Recovery Model. If you leave it as Simple, you will only be able to perform full backups of the database, but the transaction log will be automatically truncated after the backup and should not need to grow as large as it just was. If you change it back to Full, then you have more options for backups, but will need to manage the transaction log to keep it from becoming too large. If you decide to leave it as Simple, then skip to step 16. If you want to change it back to Full, then proceed to step 14. 14. Right click on your database in the Object Explorer.

15. Select Properties from the menu. 16. Click the Options page. 17. Change the Recovery Model from Simple back to Full. 18. At this point, it would be a good idea to make a backup of your database, since you are now unable to restore transaction logs for point-in-time data recovery. 19. Close the management tool. You are now ready to begin using E2 again. **Important - It is highly recommended that you review your Disaster Recovery plan. Please work with the person responsible for your network and computers to determine your backup and database maintenance strategy.