Solved

Schedule a Reindex Job

Posted on 2006-11-22
7
532 Views
Last Modified: 2012-06-21
How do I schedule a job to run to run a script at a certain time of the day to reindex a table.

I have the script to reindex it but I want it to run every 24 hours.
0
Comment
Question by:MSAIT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 2

Author Comment

by:MSAIT
ID: 17995202
SQL 2000
0
 
LVL 9

Accepted Solution

by:
udayshankar earned 150 total points
ID: 17995371
in sql server 2000 go to management -- jobs

right click new job. give it a name.
in steps tab add a new step and choose TSQL task and add your script there.

on the schedule tab schedule it.

hope this helps..
0
 
LVL 9

Expert Comment

by:udayshankar
ID: 17995389
or a better way to do this if you want to re-index the entire DB so the maintenance plans unders management.. new plan.. and walk through the wizard and choose to re-index. it will automatically put a job for you that runs as per the schedule you have provided.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Assisted Solution

by:MrNetic
MrNetic earned 50 total points
ID: 17995644
MSAIT ,
The best way is to create a job in MSSQLSERVER, as udayshankar wrote, but don't forget, that depending the
operation ( DBCC DBREINDEX or DBCC INDEXDEFGRAG + Update Statistics ), it causes locks, and while you are running this procedure, your application might malfuction while running the Job.

Best Regards,

Paulo Condeça
0
 
LVL 6

Assisted Solution

by:btutt
btutt earned 50 total points
ID: 17996365
DBCC INDEXDEFGRAG  will not cause  olong term locks because it is considered to be an online operation.
0
 
LVL 5

Expert Comment

by:MrNetic
ID: 17996391
Btutt,

You are right, i just wanted to say that the dbcc dbreindex is a offline operation, and write that the indexdefrag is an online but.

Don't forget to use a low usage time to run the job.

Best Regards,

Paulo Condeça
0
 
LVL 2

Author Comment

by:MSAIT
ID: 18001224
Great thanks guys I think Ill manage.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question