SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


how to shrink logfile ?


how to shrink logfile ?

Author
Message
Perry Whittle
Perry Whittle
SSC Guru
SSC Guru (136K reputation)SSC Guru (136K reputation)SSC Guru (136K reputation)SSC Guru (136K reputation)SSC Guru (136K reputation)SSC Guru (136K reputation)SSC Guru (136K reputation)SSC Guru (136K reputation)

Group: General Forum Members
Points: 136601 Visits: 18209
ravi@sql (12/3/2012)
ya maxsize is given for autogrowth

What are the size details for the log currently?
Do you have any long running transactions?

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
ravi@sql
ravi@sql
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1111 Visits: 406
Thank you all .

Regards,
Ravi@sql
arunyadav007
arunyadav007
SSC-Addicted
SSC-Addicted (464 reputation)SSC-Addicted (464 reputation)SSC-Addicted (464 reputation)SSC-Addicted (464 reputation)SSC-Addicted (464 reputation)SSC-Addicted (464 reputation)SSC-Addicted (464 reputation)SSC-Addicted (464 reputation)

Group: General Forum Members
Points: 464 Visits: 299
ravi@sql (12/3/2012)
ok cant i point my log file path any other drive ? if yes how can i do that ? pls share the query ?

Thanks
Ravi@sql


If you want to move the existing t-log file to different location then, follow the below steps:
1. Run ALTER DATABASE command and change location of ldf file
2. Take database offline
3. Move the physical file from old location to new location.
3. Bring database online

You can also try to add second log file to your database


USE [master]
GO
ALTER DATABASE [DB_NAME] ADD LOG FILE ( NAME = N'second_log_file', FILENAME = N'D:\LOG_FILES\second_log_file.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)
GO
sanket kokane
sanket kokane
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1907 Visits: 1022
arunyadav007 (12/3/2012)


USE MASTER
GO
DBCC FREESESSIONCACHE WITH NO_INFOMSGS
GO
DBCC FREESYSTEMCACHE 'ALL'
GO


and how does it will help to manage the log space ?

you are just adding trouble to existing issues

-----------------------------------------------------------------------------
संकेत कोकणे
sanket kokane
sanket kokane
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1907 Visits: 1022
@OP ,please do check Gail's post for managing log file

http://www.sqlservercentral.com/articles/Administration/64582/

-----------------------------------------------------------------------------
संकेत कोकणे
GilaMonster
GilaMonster
SSC Guru
SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)SSC Guru (548K reputation)

Group: General Forum Members
Points: 548999 Visits: 47741
arunyadav007 (12/3/2012)
If not, you can try this

USE MASTER
GO
DBCC FREESESSIONCACHE WITH NO_INFOMSGS
GO
DBCC FREESYSTEMCACHE 'ALL'
GO
USE (YOURDBNAME)
GO
DBCC SHRINKFILE (N'LOGFILENAME', 0, TRUNCATEONLY)
GO
DBCC SHRINKFILE (N'LOGFILENAME' , 1024)
GO



Well, I suppose that you can try that, but since none of those will help in the slightest with a full transaction log and may in fact make the scenario worse, I personally would recommend that you don't try any of those commands.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search