Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Rebuild Index job

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-03-24 : 22:27:51
We want to run the Rebuild index feature on a table that is very large and to do this on a scheduled basis via SQL Server agent job.

What steps are needed to do this, what sort of coding or language skills are used for something like that, do you feel I can find a simple sample code or it more involved?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-24 : 22:33:28
Here's my custom script: http://weblogs.sqlteam.com/tarad/archive/2009/11/03/DefragmentingRebuilding-Indexes-in-SQL-Server-2005-and-2008Again.aspx

How big is the table? What edition and version of SQL are you using? My code will handle all sizes, editions, and 2005/2008 versions, I ask these questions because of the ONLINE option available with ALTER INDEX that may be of help if you have the right setup.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-03-27 : 16:39:23
the table is about 740,000 rows. we are using 2008 r2. thank you very much for the code!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-27 : 18:46:30
What edition of 2008 R2?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-03-27 : 19:13:30
I will have to get back to you on that, I don't know at this moment how to determine the answer to this question.

quote:
Originally posted by tkizer

What edition of 2008 R2?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-27 : 19:39:16
Run SELECT @@VERSION.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-03-28 : 11:03:03
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (Intel X86) Apr 2 2010 15:53:02 Copyright (c) Microsoft Corporation Data Center Edition on Windows NT 5.2 <X86> (Build 3790: Service Pack 2)
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-03-28 : 11:49:00
Data Centre Edition ?!?!?!

Wow, first company I've seen willing to pay for that.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-03-28 : 12:15:48
really why is this so unusual? This is my first SQL Server position. I know nothing really.


quote:
Originally posted by GilaMonster

Data Centre Edition ?!?!?!

Wow, first company I've seen willing to pay for that.

--
Gail Shaw
SQL Server MVP

Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-03-28 : 13:29:26
quote:
Originally posted by AdamWest

really why is this so unusual? This is my first SQL Server position. I know nothing really.


$55,000 dollars per CPU licence, as opposed to Enterprise at only $29,000 (list price). Few companies I know of are willing to pay that for what little extra data centre gives.

Please don't take offence, but a company that's willing to pay that for SQL should be willing to pay experienced DBAs to manage it. So why are those DBAs not doing the index maintenance (normally part of their job)

--
Gail Shaw
SQL Server MVP
Go to Top of Page

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-03-28 : 14:00:22
there is no dba really. i am only ft person, and we have 3 consultants, really only 1 devoted to this server. other 2 help out on network and dba issues.
which is good for me as I can learn more hopefully.

quote:
Originally posted by GilaMonster

quote:
Originally posted by AdamWest

really why is this so unusual? This is my first SQL Server position. I know nothing really.


$55,000 dollars per CPU licence, as opposed to Enterprise at only $29,000 (list price). Few companies I know of are willing to pay that for what little extra data centre gives.

Please don't take offence, but a company that's willing to pay that for SQL should be willing to pay experienced DBAs to manage it. So why are those DBAs not doing the index maintenance (normally part of their job)

--
Gail Shaw
SQL Server MVP

Go to Top of Page

michael.appleton
Posting Yak Master

160 Posts

Posted - 2011-04-07 : 09:37:44
So they're supposedly willing to pay that much and only have one person on full time? Probably pirated software! :-P
Go to Top of Page
   

- Advertisement -