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
SSCoach
SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)SSCoach (19K reputation)

Group: General Forum Members
Points: 19794 Visits: 17242
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
SSC Veteran
SSC Veteran (209 reputation)SSC Veteran (209 reputation)SSC Veteran (209 reputation)SSC Veteran (209 reputation)SSC Veteran (209 reputation)SSC Veteran (209 reputation)SSC Veteran (209 reputation)SSC Veteran (209 reputation)

Group: General Forum Members
Points: 209 Visits: 349
Thank you all .

Regards,
Ravi@sql
arunyadav007
arunyadav007
Valued Member
Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)

Group: General Forum Members
Points: 68 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
SSC-Addicted
SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)

Group: General Forum Members
Points: 475 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
SSC-Addicted
SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)SSC-Addicted (475 reputation)

Group: General Forum Members
Points: 475 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 (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86655 Visits: 45254
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