Solved

Schedule a Reindex Job

Posted on 2006-11-22
7
531 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
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

Get Database Help Now w/ Support & Database Audit

Keeping your database environment tuned, optimized and high-performance is key to achieving business goals. If your database goes down, so does your business. Percona experts have a long history of helping enterprises ensure their databases are running smoothly.

Question has a verified solution.

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

Read about achieving the basic levels of HRIS security in the workplace.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…
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…

728 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