nav2009-db-maintenance — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited nav2009-db-maintenance (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Targets the SQL Server database behind a Dynamics NAV 2009 install. The bundled scriptscripts/Invoke-NavDbMaintenance.ps1plans maintenance and (only with `-Execute`) runs it, emitting JSON throughout. Default mode is a DRY RUN — the script prints the exact T-SQL it would execute and changes nothing without-Execute. It only rebuilds/reorganizes and updates statistics on existing indexes; it NEVER creates or drops indexes (NAV owns them). It never calls an LLM.
>
Before running maintenance, diagnose the state first with nav2009-sql-performance (fragmentation, stale stats, SIFT sizes). Then plan an action here and confirm the T-SQL before executing.
SCRIPT = this skill's scripts/Invoke-NavDbMaintenance.ps1. Requires PowerShell 7+ (pwsh) and network access to the SQL Server.
pwsh). Pass -SqlCredential for SQLauth — it is a PSCredential; let PowerShell prompt (-SqlCredential (Get-Credential)). Never put a password on the command line.
db_backupoperator (or db_owner)db_owner or ALTER permission on the indexesdb_owner or sysadmindb_owner or UPDATE STATISTICS permission-Encrypt if the instance supports it.
Always run with pwsh. Without -Execute the script is a dry run — it returns planned T-SQL in each section's plan array and sets executed: false.
| Want | Pass |
|---|---|
| Full maintenance plan (dry run) | -ServerInstance SQLSRV01 -Database NAV_PROD |
| Just back up | -Actions backup |
| Just index maintenance | -Actions index_maintenance |
| Just integrity check | -Actions checkdb |
| Just update statistics | -Actions statistics |
| Change fragmentation thresholds | -ReorganizeThreshold 15 -RebuildThreshold 25 |
| ONLINE rebuild (Enterprise only) | -Online |
| Actually execute | add -Execute |
| SQL auth | -SqlCredential (Get-Credential) |
| Save report | -OutFile C:\ops\maint-report.json |
# Dry run — see the full maintenance plan before committing
pwsh -File SCRIPT -ServerInstance SQLSRV01 -Database 'NAV_PROD'
# Execute a backup only (use a maintenance window for index rebuild / CHECKDB)
pwsh -File SCRIPT -ServerInstance SQLSRV01 -Database 'NAV_PROD' `
-Actions backup -BackupPath 'D:\Backups\NAV_PROD.bak' -Executestdout. Prefer -OutFile for large runs so your context stays small; then read only the sections you need.
Top level: status (ok / partial / error), generated_at (UTC ISO-8601), executed (bool), and sections keyed by action name. Each section:
{
"backup": { "status": "planned|ok|error|skipped", "plan": ["T-SQL..."], "data": {} },
"checkdb": { "status": "planned|ok|error|skipped", "plan": ["T-SQL..."], "data": {} },
"index_maintenance": { "status": "planned|ok|error|skipped", "plan": ["ALTER INDEX..."], "data": {} },
"statistics": { "status": "planned|ok|error|skipped", "plan": ["EXEC sp_updatestats"], "data": {} }
}In dry run (-Execute absent): each runnable section has status: planned and a plan array of the exact T-SQL statements — no database state is changed. With `-Execute`: statements run, status becomes ok or error, and data reports the outcome (backup file size, CHECKDB result, indexes rebuilt/reorganized, stats updated).
-Execute, show the user the planned T-SQLfrom each section, and get explicit confirmation before re-running with -Execute — especially for CHECKDB and index rebuild on a production DB during business hours.
Suggest running outside peak NAV posting hours. CHECKDB on a large DB can run for hours.
index name, fragmentation before), backup file path and size, CHECKDB pass/fail with any messages.
is a NAV key or SIFT design issue — point the user to nav2009-development (to adjust key design) and nav2009-sql-performance (to see which SIFT views or indexes are candidates for MaintainSIFTIndex/MaintainSQLIndex off).
restart — re-triage with nav2009-sql-performance** afterward to see the new baseline.
auth mismatch. Check with Test-NetConnection <server> -Port 1433.
path; the login needs db_backupoperator or db_owner.
ALTER INDEX ... REBUILD WITH (ONLINE=ON) needs Enterpriseedition; on Standard/Web/Express the section will error with "ONLINE is not supported". Remove -Online and schedule an offline rebuild in a maintenance window.
db_owner or sysadmin. The other actions still run(each section is independent).
not the client machine. Ensure the SQL Server service account has write access to the UNC/local path specified.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.