Skip to main content
replaced http://dba.stackexchange.com/ with https://dba.stackexchange.com/
Source Link

Possible Duplicate:
Shrinking log fileShrinking log file

Some of the sql log files (idf) are hugh like 5gb. Found a article (http://extended64.com/blogs/rhoffman/archive/2009/06/11/shrink-sql-server-2008-database-log-file-script.aspx) but not sure why he repeated dbcc shrinkfile 6 times.

Can someone please confirm and suggest a clean script to do this? Thanks

Use DatabaseName 
 GO
Alter Database DatabaseName Set Recovery Simple
GO
    Alter Database DatabaseName Set Recovery Full
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
  GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO

Possible Duplicate:
Shrinking log file

Some of the sql log files (idf) are hugh like 5gb. Found a article (http://extended64.com/blogs/rhoffman/archive/2009/06/11/shrink-sql-server-2008-database-log-file-script.aspx) but not sure why he repeated dbcc shrinkfile 6 times.

Can someone please confirm and suggest a clean script to do this? Thanks

Use DatabaseName 
 GO
Alter Database DatabaseName Set Recovery Simple
GO
    Alter Database DatabaseName Set Recovery Full
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
  GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO

Possible Duplicate:
Shrinking log file

Some of the sql log files (idf) are hugh like 5gb. Found a article (http://extended64.com/blogs/rhoffman/archive/2009/06/11/shrink-sql-server-2008-database-log-file-script.aspx) but not sure why he repeated dbcc shrinkfile 6 times.

Can someone please confirm and suggest a clean script to do this? Thanks

Use DatabaseName 
 GO
Alter Database DatabaseName Set Recovery Simple
GO
    Alter Database DatabaseName Set Recovery Full
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
  GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
insert duplicate link
Source Link

Possible Duplicate:
Shrinking log file

Some of the sql log files (idf) are hugh like 5gb. Found a article (http://extended64.com/blogs/rhoffman/archive/2009/06/11/shrink-sql-server-2008-database-log-file-script.aspx) but not sure why he repeated dbcc shrinkfile 6 times.

Can someone please confirm and suggest a clean script to do this? Thanks

Use DatabaseName 
 GO
Alter Database DatabaseName Set Recovery Simple
GO
    Alter Database DatabaseName Set Recovery Full
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
  GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO

Some of the sql log files (idf) are hugh like 5gb. Found a article (http://extended64.com/blogs/rhoffman/archive/2009/06/11/shrink-sql-server-2008-database-log-file-script.aspx) but not sure why he repeated dbcc shrinkfile 6 times.

Can someone please confirm and suggest a clean script to do this? Thanks

Use DatabaseName 
 GO
Alter Database DatabaseName Set Recovery Simple
GO
    Alter Database DatabaseName Set Recovery Full
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
  GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO

Possible Duplicate:
Shrinking log file

Some of the sql log files (idf) are hugh like 5gb. Found a article (http://extended64.com/blogs/rhoffman/archive/2009/06/11/shrink-sql-server-2008-database-log-file-script.aspx) but not sure why he repeated dbcc shrinkfile 6 times.

Can someone please confirm and suggest a clean script to do this? Thanks

Use DatabaseName 
 GO
Alter Database DatabaseName Set Recovery Simple
GO
    Alter Database DatabaseName Set Recovery Full
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
    GO
    DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
  GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
   DBCC SHRINKFILE ('LogFileName', 1)
   GO
Post Closed as "exact duplicate" by Martin Smith, gbn, Nick Chammas, Mark Storey-Smith, jcolebrand
Post Migrated Here from stackoverflow.com (revisions)
Source Link
Amber Berg
Amber Berg
Loading