PROD ScadaBridge DB: DBA must create the 104 nonclustered indexes before the central starts #59

Closed
opened 2026-11-20 14:49:13 -05:00 by dohertj2 · 3 comments
Owner

PROD ScadaBridge config DB wondersqlpd.zmr.zimmer.com / ScadaBridge (WONDER-SQL-VP03) was pre-built by a DBA with tables, PKs, FKs and partitioning but no nonclustered indexes (0 of 104). The app login wwpdsbrw has no DDL.

Done 2026-11-20 19:48Z as wwpdsbrw (DML only): 65 __EFMigrationsHistory rows (= QA, last 20261115221558_RemoveAuditLogHashChain), zbauth/zbsecrets schema_version v1, LdapGroupMappings seed ids 1–5 and the five _PROD rows (ids 6–10). Record: docs/deploy/2026-11-19-prod-stage/2026-11-20-prod-sql-check.md.

Owed by the DBA: run docs/deploy/2026-11-19-prod-stage/sql/prod-complete-dba-schema.sql (idempotent; only the 104 CREATE INDEX statements do anything now) with db_owner/db_ddladmin.

Do not start ScadaBridge Central (plan Phase 5) before this. The EF migration check now passes, but the missing unique indexes mean no uniqueness enforcement, and the zbauth/zbsecrets startup migrators will attempt CREATE INDEX and be denied.

Verify after: nonclustered index count = 104 and the QA-vs-PROD schema diff shows 0 index differences.

PROD ScadaBridge config DB `wondersqlpd.zmr.zimmer.com` / `ScadaBridge` (WONDER-SQL-VP03) was pre-built by a DBA with tables, PKs, FKs and partitioning but **no nonclustered indexes (0 of 104)**. The app login `wwpdsbrw` has no DDL. **Done 2026-11-20 19:48Z as `wwpdsbrw` (DML only):** 65 `__EFMigrationsHistory` rows (= QA, last `20261115221558_RemoveAuditLogHashChain`), `zbauth`/`zbsecrets` `schema_version` v1, `LdapGroupMappings` seed ids 1–5 and the five `_PROD` rows (ids 6–10). Record: `docs/deploy/2026-11-19-prod-stage/2026-11-20-prod-sql-check.md`. **Owed by the DBA:** run `docs/deploy/2026-11-19-prod-stage/sql/prod-complete-dba-schema.sql` (idempotent; only the 104 `CREATE INDEX` statements do anything now) with db_owner/db_ddladmin. **Do not start ScadaBridge Central (plan Phase 5) before this.** The EF migration check now passes, but the missing unique indexes mean no uniqueness enforcement, and the zbauth/zbsecrets startup migrators will attempt `CREATE INDEX` and be denied. Verify after: nonclustered index count = 104 and the QA-vs-PROD schema diff shows 0 index differences.
dohertj2 added the type:deploy-gatepriority:p1blocked labels 2026-11-20 14:49:13 -05:00
Author
Owner

Updated: prod-complete-dba-schema.sql now holds only what the DBA must do (sha256 3e05e167…, commit 9c77b6c): the 104 guarded CREATE INDEX (one transaction, refuses unless EF history is at 2e0ce81e), then a read-only check of the 24 default/computed/check definitions against QA. Expected final row: 104 indexes, 0 mismatches, 65 migrations, 10 mappings. The data half is already applied (65 EF history rows, schema_version v1 x2, LdapGroupMappings 1-10); nothing else can be done with wwpdsbrw.

Updated: `prod-complete-dba-schema.sql` now holds only what the DBA must do (sha256 `3e05e167…`, commit 9c77b6c): the 104 guarded `CREATE INDEX` (one transaction, refuses unless EF history is at 2e0ce81e), then a read-only check of the 24 default/computed/check definitions against QA. Expected final row: 104 indexes, 0 mismatches, 65 migrations, 10 mappings. The data half is already applied (65 EF history rows, schema_version v1 x2, LdapGroupMappings 1-10); nothing else can be done with `wwpdsbrw`.
Author
Owner

Update 2026-11-20 (first PROD run): ScadaBridge 2e0ce81e is installed on vp03/vp04 and stopped, start type Manual until this closes (records ScadaBridge facf24b2). The central-store seeds also failed on this gate: the SQL Secrets CLI runs the zbsecrets migrator (Cannot find the object \"zbsecrets.secret\" because it does not exist or you do not have permissions = CREATE INDEX denied). After the DBA script: (1) re-stage nam-ldap-central.txt from Keychain btdb-manager/ldap into E:\psrem-stage\_values\seed\ on vp03 (site-psk.txt is still there); (2) seed-secret-prod.ps1 -Target ScadaBridge-Central for nam-ldap-svc-password and -SecretName SB-GRPC-PSK-site-par; (3) sc config ScadaBridge-Central start= auto, start vp03, ready, start vp04; §3A.5; (4) Site entity site-par, mxgw API key, MxGateway data connection. Sites site-par are already running (par-vp03 active, par-vp04 standby).

Update 2026-11-20 (first PROD run): ScadaBridge 2e0ce81e is installed on vp03/vp04 and **stopped, start type Manual** until this closes (records ScadaBridge `facf24b2`). The central-store seeds also failed on this gate: the SQL Secrets CLI runs the zbsecrets migrator (`Cannot find the object \"zbsecrets.secret\" because it does not exist or you do not have permissions` = CREATE INDEX denied). **After the DBA script:** (1) re-stage `nam-ldap-central.txt` from Keychain `btdb-manager/ldap` into `E:\psrem-stage\_values\seed\` on vp03 (`site-psk.txt` is still there); (2) `seed-secret-prod.ps1 -Target ScadaBridge-Central` for nam-ldap-svc-password and `-SecretName SB-GRPC-PSK-site-par`; (3) `sc config ScadaBridge-Central start= auto`, start vp03, ready, start vp04; §3A.5; (4) Site entity site-par, mxgw API key, MxGateway data connection. Sites site-par are already running (par-vp03 active, par-vp04 standby).
Author
Owner

Verified 2026-11-20 21:23Z: 104 nonclustered indexes present (tables changed 15:56Z), 368 index partitions. Schema diff vs QA: every index name, key columns, includes and uniqueness match (30 unique, 8 filtered on both); filter texts are hidden from wwpdsbrw so only has_filter could be compared; PK/check names differ only by auto-generated suffix. Then: central store seeded on vp03 (nam-ldap-svc-password, sb-grpc-psk-site-par, readback-match=True), ScadaBridge-Central set back to Automatic, vp03 started 21:24:15Z (ready 200 in 14 s, Akka leader), vp04 ready 200 in 9 s, 2-member pair, vp03 active. Cluster configuration continues (Site site-par, mxgw key, MxGateway connection).

Verified 2026-11-20 21:23Z: 104 nonclustered indexes present (tables changed 15:56Z), 368 index partitions. Schema diff vs QA: every index name, key columns, includes and uniqueness match (30 unique, 8 filtered on both); filter texts are hidden from wwpdsbrw so only has_filter could be compared; PK/check names differ only by auto-generated suffix. Then: central store seeded on vp03 (nam-ldap-svc-password, sb-grpc-psk-site-par, readback-match=True), ScadaBridge-Central set back to Automatic, vp03 started 21:24:15Z (ready 200 in 14 s, Akka leader), vp04 ready 200 in 9 s, 2-member pair, vp03 active. Cluster configuration continues (Site site-par, mxgw key, MxGateway connection).
Sign in to join this conversation.