all groups > sql server new users > august 2007 >
You're in the

sql server new users

group:

SQL query for shrink severeal dbs and log files


SQL query for shrink severeal dbs and log files Henrik
8/23/2007 12:00:00 AM
sql server new users:
Hi,

Im new at SQL and have a question.

I need help with a query command that can shrink log files for several DBs
when running this query.

Greatfull for help.

Regards
Henrik

Re: SQL query for shrink severeal dbs and log files Tom Moreau
8/23/2007 12:00:00 AM
Check out DBCC SHRINKFILE in the BOL. However, your log files have grown to
that size for a reason. If they needed the space before, they probably will
need it in the future, at which point you won't be able to modify data until
the log file autogrows.

--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


[quoted text, click to view]
Hi,

Im new at SQL and have a question.

I need help with a query command that can shrink log files for several DBs
when running this query.

Greatfull for help.

Regards
Henrik

Re: SQL query for shrink severeal dbs and log files Henrik
8/23/2007 12:00:00 AM
hi tom,

Thanks for the BOL pointer.

Im currently logging the growth per week for my DBs so I can see the
individual need for them. Loggfiles included.

My priority was to shrink them because of diskspace problems.
After that I need this info for a long term maint plan.

Thanks

Regards
Henrik

[quoted text, click to view]

Re: SQL query for shrink severeal dbs and log files Tom Moreau
8/23/2007 12:00:00 AM
Keep in mind that with constantly shrinking and re-growing your log files,
you will get fragmentation at the disk level, in addition to the other
problems I mentioned. Check out the following:

http://www.karaszi.com/SQLServer/info_dont_shrink.asp



--
Tom

----------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau


[quoted text, click to view]
hi tom,

Thanks for the BOL pointer.

Im currently logging the growth per week for my DBs so I can see the
individual need for them. Loggfiles included.

My priority was to shrink them because of diskspace problems.
After that I need this info for a long term maint plan.

Thanks

Regards
Henrik

[quoted text, click to view]

AddThis Social Bookmark Button