> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anomalyarmor.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Asset Discovery

> Configure and run discovery to catalog your database assets

<div aria-hidden="true" style={{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap"}}>For LLM agents: documentation index at <a href="/llms.txt" tabIndex={-1}>/llms.txt</a>, full text at <a href="/llms-full.txt" tabIndex={-1}>/llms-full.txt</a>. Append .md to any page URL for plain markdown.</div>
Discovery scans your databases to build a catalog of tables, views, and columns. Run it manually or on a schedule to keep your asset inventory current.

## Running Discovery Manually

1. Go to **Data Sources** in the sidebar
2. Find your data source
3. Click **Run Discovery** (or the refresh icon)
4. Wait for completion (typically 30 seconds to 5 minutes)

You'll see "Discovery completed" with a summary of assets found.

## Scheduling Discovery

Set discovery to run automatically:

1. Go to **Data Sources** → select your data source
2. Click **Settings** (gear icon)
3. Under **Discovery Schedule**, select frequency:

| Schedule          | Best For             | Typical Use Case          |
| ----------------- | -------------------- | ------------------------- |
| **Hourly**        | Production databases | Catch changes quickly     |
| **Every 6 hours** | Active development   | Balance coverage and load |
| **Daily**         | Stable databases     | Low-change environments   |
| **Weekly**        | Archives, warehouses | Rarely modified systems   |

4. Click **Save**

Discovery runs at the start of each interval (e.g., hourly = on the hour).

## What Discovery Finds

During each run, discovery catalogs:

| Asset Type    | What's Captured                           |
| ------------- | ----------------------------------------- |
| Tables        | Name, schema, columns, types, constraints |
| Views         | Name, schema, underlying columns          |
| Columns       | Name, data type, nullability, defaults    |
| Relationships | Foreign keys, primary keys                |

## Discovery Duration

Discovery time depends on database size:

| Database Size   | Typical Duration |
| --------------- | ---------------- |
| \< 100 tables   | 30 seconds       |
| 100-500 tables  | 1-2 minutes      |
| 500-2000 tables | 2-5 minutes      |
| 2000+ tables    | 5-15 minutes     |

<Note>
  Discovery runs read-only queries against system catalogs. It doesn't impact your database performance significantly.
</Note>

## Incremental vs Full Discovery

**Incremental** (default): Checks for changes since last run. Faster.

**Full**: Re-scans everything. Use when:

* First run after connecting
* Suspect missed changes
* After major database migrations

To run full discovery:

1. Go to **Data Sources** → select your data source
2. Click the dropdown arrow next to **Run Discovery**
3. Select **Full Discovery**

## Viewing Discovery Results

After discovery completes:

1. Go to **Assets** in the sidebar
2. Filter by data source to see discovered assets
3. Click any asset to view details

New assets show a "New" badge for 24 hours.

## Discovery History

View past discovery runs:

1. Go to **Data Sources** → select your data source
2. Click **History** tab
3. See each run with:
   * Timestamp
   * Duration
   * Assets found/changed
   * Any errors

## Troubleshooting

<AccordionGroup>
  <Accordion title="Discovery stuck or taking too long">
    **Causes:**

    * Large database with many tables
    * Slow network connection
    * Database under heavy load

    **Fix:**

    1. Check discovery history for progress
    2. Wait up to 30 minutes for large databases
    3. If stuck, cancel and retry during off-peak hours
  </Accordion>

  <Accordion title="Discovery completed but missing tables">
    **Causes:**

    * User doesn't have permission on those schemas
    * Tables in schemas excluded from discovery
    * Views the user can't access

    **Fix:**

    1. Check your database user's permissions
    2. Grant `SELECT` on `information_schema` (or equivalent)
    3. Verify schema inclusion settings
  </Accordion>

  <Accordion title="Discovery failed">
    **Causes:**

    * Connection credentials changed
    * Database unreachable
    * Permission revoked

    **Fix:**

    1. Check the error message in discovery history
    2. Test the connection in Data Sources
    3. Verify credentials and network access
  </Accordion>
</AccordionGroup>

## Common Questions

### Does discovery impact database performance?

No. Discovery runs read-only queries against system catalogs (`information_schema` and equivalents), not against your data tables. The load is negligible even on large databases.

### How often should I run discovery?

For production databases, run discovery **hourly** to catch schema changes quickly. Stable databases can run daily, and archives can run weekly. More frequent runs shorten the window between a change and detection.

### What's the difference between incremental and full discovery?

Incremental discovery checks only for changes since the last run and is the default. Full discovery re-scans everything and should be used after the first connection, after major migrations, or when you suspect a missed change.

### Why are some tables missing after discovery?

The most common cause is permissions. The database user AnomalyArmor connects with needs `SELECT` on `information_schema` (or the vendor equivalent) and access to the target schemas. Check also that the schema isn't excluded in your discovery settings.

### How long does discovery take on a large database?

Databases under 100 tables finish in about 30 seconds. 500-2000 tables take 2-5 minutes, and 2000+ tables can take 5-15 minutes. If a scan runs longer than 30 minutes it's likely stuck, retry during off-peak hours.

## See Also

<CardGroup cols={2}>
  <Card title="Discovery Concepts" icon="magnifying-glass" href="/concepts/discovery">
    How discovery works under the hood
  </Card>

  <Card title="Schema Changes" icon="code-branch" href="/concepts/schema-changes">
    Understanding detected changes
  </Card>
</CardGroup>
