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


SQL 2005 Rebuild\Reorganize Indexes with Reports


SQL 2005 Rebuild\Reorganize Indexes with Reports

Author
Message
Farhan Sabzaali
Farhan Sabzaali
SSC-Enthusiastic
SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)

Group: General Forum Members
Points: 173 Visits: 152
Comments posted to this topic are about the item SQL 2005 Rebuild\Reorganize Indexes with Reports

Farhan F. Sabzaali
PMP, MCP, MCDBA, MCSA, MCSE
Rome-828069
Rome-828069
SSC-Enthusiastic
SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)

Group: General Forum Members
Points: 161 Visits: 88
Maybe I am missing a step but this proc doesn't compile.

Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 57
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 146
....

edited out numerous errors.
Farhan Sabzaali
Farhan Sabzaali
SSC-Enthusiastic
SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)

Group: General Forum Members
Points: 173 Visits: 152
It seems the script that got published has space unicode characters in it - I am attaching a zip file with compiled query - let me know if that works for you.

Thanks,

Farhan Sabzaali

Farhan F. Sabzaali
PMP, MCP, MCDBA, MCSA, MCSE
Attachments
ReorgScript-031609.zip (105 views, 9.00 KB)
Rome-828069
Rome-828069
SSC-Enthusiastic
SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)SSC-Enthusiastic (161 reputation)

Group: General Forum Members
Points: 161 Visits: 88
That worked great. Very nice job.
icata
icata
Right there with Babe
Right there with Babe (750 reputation)Right there with Babe (750 reputation)Right there with Babe (750 reputation)Right there with Babe (750 reputation)Right there with Babe (750 reputation)Right there with Babe (750 reputation)Right there with Babe (750 reputation)Right there with Babe (750 reputation)

Group: General Forum Members
Points: 750 Visits: 295
Nice, very comprehensive, lot of work.



Steve Jones
Steve Jones
SSC Guru
SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)SSC Guru (148K reputation)

Group: Administrators
Points: 148316 Visits: 19444
I have updated the script with code from Farhan as well.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Paul-243651
Paul-243651
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 6
The comments in the sp say its for SQL 2005 only, but will it run on sql 2008?
Farhan Sabzaali
Farhan Sabzaali
SSC-Enthusiastic
SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)

Group: General Forum Members
Points: 173 Visits: 152
To be honest, I have not tried as I don't have access to one - if you can test it on dev or test environment, it would help.

Farhan F. Sabzaali
PMP, MCP, MCDBA, MCSA, MCSE
jeff a
jeff a
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 9
This has been working well for me for several weeks, then we recently updated a vendor product and I'm getting an error. Looks like they updated their code to frequently create temporary tables and delete them. It appears the rebuild procedure doesn't handle tables that have been deleted after the procedure was started:

Msg 1088, Level 16, State 9, Line 1
Cannot find the object "NetPerfMon.dbo.NetFlowDetail_579_1382041" because it does not exist or you do not have permissions.

Any suggestions appreciated.
Farhan Sabzaali
Farhan Sabzaali
SSC-Enthusiastic
SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)SSC-Enthusiastic (173 reputation)

Group: General Forum Members
Points: 173 Visits: 152
Ideally, you should run these type of jobs when database is in maintenance window - if possible, try to schedule it when the application is not using the DB. If that is not possible, try running it with Online option = 0 - that should only look for existing tables. If that does not work, I may have to review code in detail to help you.

Farhan F. Sabzaali
PMP, MCP, MCDBA, MCSA, MCSE
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