# FuturisticREPO Database

**DBAOps Futuristic Enterprise™** – Central repository database.

## Source of Truth

- **CMS** (SQL Server Central Management Server) – Server inventory is synced from CMS.

## Deployment

1. Create the folder: `M:\ProdDB\FuturisticREPO\`
2. Run scripts in order:
   - `001_CreateDatabase.sql`
   - `002_CreateSchemas.sql`
   - `003_CreateTables.sql`
   - `004_SeedData.sql`
   - `005_DiscoveryProcedures.sql`

## Sync from CMS

Use PowerShell to sync CMS registry into `config.ServerInventory`:

```powershell
$cms = "YOUR_CMS_SERVER"
$servers = Get-DbaRegisteredServer -SqlInstance $cms
# Merge into config.ServerInventory (implement merge logic)
```

## Run Discovery

```powershell
.\Invoke-FuturisticDiscovery.ps1 -CentralServer $env:COMPUTERNAME -RepositoryDB "FuturisticREPO"
```

## 14 Hidden SQL Server Risks

| # | Risk | TypeCode |
|---|------|----------|
| 1 | Databases Not Encrypted | TDE |
| 2 | Backup Strategies Never Tested | BACKUP_STRATEGY |
| 3 | Orphaned Database Users | ORPHANED_USERS |
| 4 | Replication Latency | REPLICATION |
| 5 | TempDB Configuration | TEMPDB |
| 6 | Dangerous Defaults (SA, xp_cmdshell) | SA_ACCOUNT, XP_CMDSHELL |
| 7 | Disk Space Risks | DISK_SPACE |
| 8 | Overprivileged Service Accounts | SERVICE_ACCOUNTS |
| 9 | SQL Agent Jobs Without Owners | JOB_OWNERS |
| 10 | Unencrypted Client Connections | CONNECTION_ENCRYPTION |
| 11 | Hidden Linked Servers | LINKED_SERVERS |
| 12 | Unknown Dependencies | JOB_DEPENDENCIES |
| 13 | Patch Level Drift | PATCH_DRIFT |
| 14 | Missing Integrity Checks | INTEGRITY_CHECKS |
