Solved

Schedule a Reindex Job

Posted on 2006-11-22
7
529 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
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

733 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