July 24, 2010 at 7:44 am
hi,
i have created a cursor.the main purpose of it is to run
dbcc shrinkfile(logfile name)in all databases.but before that we have to use (use database_name) command.i m getting an error msg incorrect syntax near @dname(i.e the parameter into which value comes from the cursor).
how to do it. i am stuck.please help
July 24, 2010 at 8:06 am
I hope you realize using shrink(db/file) in general is a bad practice !
If you don't have a real need to do the shrink operation, just don't do it. Your db needs some free space to operate efficient and file extention is one of the most costly operations there are.
Without the actual cursor code, we cannot help out for this case !
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
July 24, 2010 at 8:38 am
Why do you want to shrink the logs of all databases? Are you trying to hinder performance on all databases?
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
July 24, 2010 at 2:43 pm
hi,but here it is the procedure.in order to make space we either delete older backups or shrink log files.
first we use sqlperf(logspace)
and analysing the result we shrink appropriate log file.and how can i preach them that its a bad practise.they are experienced guys and i m the new guy.
July 25, 2010 at 1:46 am
- are you performing frequent LOG backups ? If not, please do ! It helps your DRP and keeps your log files under control.
Check out the great article Gail wrote on transaction logs http://www.sqlservercentral.com/articles/64582/
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
July 25, 2010 at 2:34 am
And this http://sqlinthewild.co.za/index.php/2007/09/08/shrinking-databases/ (plus both the articles it links to) and http://www.brentozar.com/archive/2009/08/stop-shrinking-your-database-files-seriously-now/ (and all the articles it links to) and finally http://sqlblog.com/blogs/aaron_bertrand/archive/2009/07/27/oh-the-horror-please-stop-telling-people-they-should-shrink-their-log-files.aspx
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
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply