Typically this maintenance process is scheduled to take place during quiet times. So cron it in unix or use the windows task scheduler for Win platforms. Alternatively Sybase has the job scheduler that can also be used. My preference is the OS scheduling. Hope this helps.