---
title: dhconfig schemas
sidebar_label: Schemas
---

The `schemas` configuration data type of the [`dhconfig`](./overview.md) tool is used to manage [schemas](../../../data-guide/schemas/schema-overview.md) in the system, with actions `import`, `export`, `list`, and `delete`.

```text
dhconfig schemas [import|export|list|delete|help] [arguments]
```

As with other `dhconfig` configuration data types, the `--help` argument provides detailed information on the available actions and arguments, as well as usage examples. Use `--help` whenever you need more information about the available actions. For example, if you want information about the `import` action, you can run:

```bash
dhconfig schemas import --help
```

Which prints the following:

```text
usage: dhconfig schemas import [--compile | --no-compile] [--configfile <arg>] [-d <arg>] [--diskprops] [-e] [--etcd]
       [-f <arg>] [-force] [-h] [-k <arg> | -user <arg>] [-l] [-n <arg>]  [-pf <arg>] [-s <arg>] [-u]  [-v]
Import schemas from disk.
```

A description of all the subcommand's options and some usage examples follows.

Due to the number of available actions and combinations, and the robust in-tool documentation via `--help`, an exhaustive list of all possible commands is not provided here. Instead, we will elaborate on some of the more complex arguments below, and then give some usage examples. We recommend that you use the `--help` argument as needed for more information.

## Arguments

| Argument                    | Description                                                                                                                                                                                                                                        |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-s,--namespaceset <arg>`   | Limit processing to this namespace set (User or System). Can be specified multiple times.                                                                                                                                                          |
| `-e,--skip-errors`          | Attempt to process all eligible schemas, even when errors are encountered. If omitted, processing stops at the first error.                                                                                                                        |
| `-l,--lenient-validation`   | It is possible that classes used in a schema are not available when reading a schema. This is a fatal error unless this option is specified. Validation can be disabled entirely by setting the property `SchemaXmlParser.disableValidation=true`. |
| `--no-compile`              | Do not compile listeners while importing a schema. This can be used to import schemas with apparent errors. Use with care: if the Data Import Server cannot compile the listeners, data cannot be ingested.                                        |
| `-o,--operate-on-namespace` | Operate on a namespace instead of a schema.                                                                                                                                                                                                        |

## `import`

> [!NOTE]
> Import actions require authentication, with `sudo`, `--key`, or `--user`.

Deploy a (new) single schema:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas import --file /tmp/schemas/LearnDeephaven.StockQuotes.schema
```

Deploy a (new) single schema, skipping all data validation (use with care):

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas import --file /tmp/schemas/LearnDeephaven.StockQuotes.schema --no-compile --lenient
```

Deploy a (new) single schema directly to etcd, bypassing the configuration server:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas import --etcd --file /tmp/schemas/LearnDeephaven.StockQuotes.schema
```

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas import --etcd /tmp/schemas/LearnDeephaven.StockQuotes.schema
```

Re-deploy the `ExampleNamespace` schemas:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas import --directory /tmp/schemas --namespace ExampleNamespace --force
```

## `export`

Export all schemas in namespace `DbInternal` to `/tmp/schemas`:

```bash
/usr/illumon/latest/bin/dhconfig schemas export --namespace DbInternal --directory /tmp/schemas
```

Print a schema to `stdout`:

```bash
/usr/illumon/latest/bin/dhconfig schemas export DbInternal.ProcessEventLog
```

## `list`

List all namespaces:

```bash
/usr/illumon/latest/bin/dhconfig schemas list --operate-on-namespace
```

List all schemas in namespace `DbInternal`:

```bash
/usr/illumon/latest/bin/dhconfig schemas list --namespace DbInternal
```

List all System schemas, bypassing configuration server (requires more file permissions):

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas list --namespaceset System --etcd
```

## `delete`

> [!NOTE]
> Delete actions require authentication, with `sudo`, `--key`, or `--user`.

Delete `MyTable1` and `MyTable2` from namespace `MyNamespace`:

```bash
/usr/illumon/latest/bin/dhconfig schemas delete --file MyNamespace.MyTable1 --file MyNamespace.MyTable2 --force --user some-admin-user --pwfile ~/pw.txt
```

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas delete MyNamespace.MyTable1 MyNamespace.MyTable2 --force
```

Delete namespace `MyNamespace`:

```bash
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas delete --operate-on-namespace MyNamespace --force
```

## Related documentation

- [dhconfig overview](./overview.md)
- [schema overview](../../../data-guide/schemas/schema-overview.md)
