Overview
Automating routine tasks in the database server are possible but the methodology deployed depends on your choice of database vendor. Tasks such as backups, database integrity checks, and re-indexing can be set-up to recur or take place on chosen days on the month as required. Automated tasks will free the Database Administrator (DBA) from having to remember to perform these and ensures that the tasks are always run on time, out of office hours where appropriate and in the absence of the DBA. Any failures can be reported by an e-mail sent or another form of alert system deployed.
The DBA can then focus on more important issues such as Service Level Agreements (SLA), deployment, performance and user problems.
Scheduling
Tasks can be set-up in the form of 'jobs' on SQL Server and shell scripts on other database servers such as MySQL and PostgreSQL running on Linux. For SQL Server, the SQL Server Agent looks after any 'jobs' and runs then at the times designated. On unix/linux platforms, the scripts can be initiated by the users CRONTAB which is the built-in operating system scheduler.
The End Result
Jobs can be configured to rerun on failure and execute additional tasks using conditional behaviour to achieve a successful completion. Scripts could be written to take into account runtime problems and call other functions or another part of the script to ensure completion. Automating tasks is open to customization and can usually suit any business requirement and should be adopted to acheive an efficient environment.