Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2005, 08:43 AM
Registered User
 
Join Date: Apr 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default backup transaction log file

hi,
i want to delete all the records from all the tables in the database. hence i started with the EM in SQL SERVER and started to type the queries from the query window in EM. after deleting some of the records from the table i got an error msg stating "The transaction log file is full. Please backup the transaction log file to free up some space". i do not want to increase the size of the transaction log file. but i need to understand how to accomplish the task mentioned in the error msg. how to backup the transaction log file. is there any query to do or a wizard or an option in menu under EM to do.
is there any other better way to do this job.
thanks.


 
Old June 9th, 2005, 05:03 PM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Sunil_thomas Send a message via MSN to Sunil_thomas Send a message via Yahoo to Sunil_thomas
Default

use Truncate table instead of delete

Truncate is non logged operation and your transaction log will not be full

Backing up transaction log do the following

1.select * from sysfiles -this will give you the log file name
2.Backup database use truncate only option
3.Issue a DBCC shring file

Hope this will help


 
Old June 10th, 2005, 05:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:i do not want to increase the size of the transaction log file
Why is that you are against it? Then you got to do something that can afford to use the space of the tran log, and that doesn't let the tranlog grow in size, which you cannot control.

Transaction log is a rough work space used by the sql server. You never know which transaction fired by you would use what amount of space in the transaction log. So in that case, you should always have set the transaction log grow automatically and periodically clean up or back up the transaction log based on the necessity. This is how you manage your db server. When you say you dont want to increase its size, you should do something that doesn't eat up much space on the tran log.

Doing a "dump tran" on db "with no_log" will clean up the space for you, if you prefer not to back up the log.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old September 26th, 2006, 11:09 AM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use the commandline OSQL utility

OSQL -E -n -Q "sp_dboption <database name>, 'trunc. log on chkpt.', 'true'"

Then

OSQL -E -n -Q "BACKUP DATABASE <database name> TO DISK = 'c:\<database name>.bak'"

Then

osql -E -n -Q "use <database name>;dbcc shrinkdatabase (<database name>, TRUNCATEONLY) "

This in order is to place the database in Simple mode, create a backup (which commits all transactions to the database) then shrinks the database and leaves the log in a truncated mode (very small)

OSQL -E -n -Q "sp_dboption <database name>, 'trunc. log on chkpt.', 'false'"

Puts the database into Full backup mode.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Transaction log carumuga SQL Server 2005 0 August 7th, 2008 05:38 AM
Transaction Log Error [email protected] SQL Server 2000 1 June 4th, 2008 09:26 PM
use of transaction log madhukp SQL Server 2000 1 July 16th, 2004 06:20 PM
log and transaction issue ak SQL Server 2000 0 September 29th, 2003 06:32 AM
Transaction Log ColdFusionRO SQL Server 2000 3 July 16th, 2003 01:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.