Wrox Programmer Forums
|
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 29th, 2004, 05:22 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default Shrink Great Problem

Is There Any Way to shrink Log file or backup the log content so i could have the mdf and ldf file with a small size

i tried the statement
DBCC SHRINKFILE ( 'diwan_LOG',10,TRUNCATEONLY)
but no way.... the same size, i restrict the Log file size to 100Mega

the strange in that when backup the database it becomes from 120 Mega to 6 Mega(both mdf and ldf files).

Any One Can help



Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old June 29th, 2004, 09:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

YOu can truncate a log file with:

backup log diwan_LOG with truncate_only

as an alternative, although this may not be what you are looking for?

Brian
 
Old June 29th, 2004, 09:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

After shrinkfile you will have to do a SQL service restart or if you do not want to restart SQL service, then you can dettach and re-attach the db, to get the new shrunk size in effect. Till then you would be seeing the same size for the MDF/LDF file, whichever you shrink

You may want to take a look at this thread, which I originated with something similar to this, and also posted what I did to get that resolved and free up some HDD space.

Shrink Log without SQL service restart.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old June 30th, 2004, 11:29 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

Actually I Need To Delete The Log File Or Remove Its Contents

i have one way but is there a way else
my way is two generate a script file and make a new db and then import data....

Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Shrink Detail section on a report TimLB Access 2 January 23rd, 2007 08:45 AM
Query to shrink a Database ankur_icfai SQL Server 2000 2 October 16th, 2006 11:50 PM
Shrink Log without SQL service restart. happygv SQL Server 2000 9 May 12th, 2004 09:24 AM
Log Shrink acko SQL Server 2000 1 March 25th, 2004 10:57 AM
Shrink Trans Log Walden SQL Server 2000 2 November 3rd, 2003 09:29 AM





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