db_optimize script terminates