• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 537
  • Last Modified:

Schedule a Reindex Job

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
MSAIT
Asked:
MSAIT
  • 2
  • 2
  • 2
  • +1
3 Solutions
 
MSAITAuthor Commented:
SQL 2000
0
 
udayshankarCommented:
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
 
udayshankarCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
MrNeticCommented:
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
 
btuttCommented:
DBCC INDEXDEFGRAG  will not cause  olong term locks because it is considered to be an online operation.
0
 
MrNeticCommented:
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
 
MSAITAuthor Commented:
Great thanks guys I think Ill manage.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now