1. Agent scheduling and batching¶
1.1. Key choices¶
Triggering strategies: event‑driven, time‑based, hybrid
Batching windows and idempotency
Health checks and back‑pressure controls
1.2. Daily and monthly routines¶
There are a number of procedures commonly included in SQL Agent Jobs for daily or monthly maintenance and refreshes:
spMFDeleteHistory — purge old rows from logging tables beyond a retention window.
spMFUpdateAllncludedInAppTables — perform a scheduled update of all class tables marked IncludeInApp.
1.3. Scheduling guidance¶
Separate maintenance jobs (purge, metadata refresh) from data movement jobs (updates to/from M‑Files).
Prefer short, frequent batches with clear watermarks (e.g., MFLastModified) to reduce risk and simplify retries.
Record every run in ProcessBatch/ProcessBatchDetail for observability and notifications.
Use SQL Agent job steps with clear success/failure flow and a final “health check” query that sets the job outcome.
1.4. Example: nightly refresh sequence¶
Optional metadata sync if structure changed recently: spMFDropAndUpdateMetadata.
Refresh class tables: spMFUpdateAllncludedInAppTables.
Cleanup logs older than policy: spMFDeleteHistory.
Summarize results for on‑call via spMFProcessBatch_Mail (optional).