← ClaudeAtlas

nav2009-db-maintenancelisted

SQL Server maintenance for a Microsoft Dynamics NAV 2009 database — back up, integrity-check (DBCC CHECKDB), rebuild or reorganize fragmented indexes, and update statistics. The bundled script plans each action and returns the exact T-SQL it would execute, defaulting to a safe dry run that changes nothing; pass -Execute to actually run it. Critically, the script only REBUILDS/REORGANIZES NAV-owned indexes and NEVER creates or drops them — NAV 2009 owns the physical schema through table Keys and SIFT indexed views, and out-of-band DDL is silently lost on key/company changes. Use when the user says "back up the NAV database", "rebuild fragmented indexes on NAV_PROD", "run a maintenance pass on the NAV SQL database", "update statistics on NAV". Do NOT use for diagnosing WHY something is slow — that is nav2009-sql-performance; this skill executes the fixes. Requires PowerShell 7+ and SQL maintenance permissions (see compatibility).
whobat/AI-Agent-skills · ★ 0 · API & Backend · score 76
Install: claude install-skill whobat/AI-Agent-skills
# NAV 2009 DB Maintenance > Targets the **SQL Server database behind a Dynamics NAV 2009 install**. The bundled script > `scripts/Invoke-NavDbMaintenance.ps1` **plans 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. ## Permissions & auth - Default is **Windows integrated auth** (the user running `pwsh`). Pass `-SqlCredential` for SQL auth — it is a `PSCredential`; let PowerShell prompt (`-SqlCredential (Get-Credential)`). Never put a password on the command line. - Required permissions by action: - **backup** — `db_backupoperator` (or `db_owner`) - **index_maintenance** — `db_owner` or `ALTER` permission on the indexes - **checkdb** — `db_owner` or `sysadmin` - **statistics** — `db_owner` or `UPDATE STATISTICS` permission - Connections are unencrypted by default (NAV 2009-era instances rarely have TLS certs); add `-Encrypt` i