---
title: How do I manually delete user tables?
---

Usually, you delete the user tables using the [API](../../deephaven-database/user-tables.md#add-modify-and-delete-user-tables). But if you get a user table into a state that workers cannot handle via errors or a sequence of definition changes, you can manually reset the state by removing the schema and data files from the command line on a Deephaven server.

### Step 1: Delete the schema

Run this command to delete a user table schema:

```
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig schemas delete UserNamespace.TableName --force
```

If this is the last table from the namespace, run this command to delete the namespace:

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

### Step 2: Delete the data files

Depending on the table type, one of the following commands will delete your data.
You can find more details about internal partitions and column partitions [in the table storage guide](../../sys-admin/table-storage/table-storage-filesystem.md).

#### Delete unpartitioned user table's data:

```
sudo rm -rf /db/Users/UserNamespace/Tables/TableName/
```

#### Delete direct partitioned user table's data:

Delete all the data files under every internal partition and column partition value.

```
ls -d /db/Users/UserNamespace/Partitions/*/*/TableName | sudo xargs rm -rf
```

Consider deleting empty directories after this operation.

#### Delete live partitioned user table's data:

```
ls -d /db/IntradayUser/UserNamespace/Partitions/*/*/TableName | sudo xargs rm -rf
```

These files can be found on the same host as the DIS that ingests live user data, which by default is the DIS provided upon installation.

## Related documentation

- [User tables](../../deephaven-database/user-tables.md)
- [Data Import Server](../../data-guide/dis.md)
- [Table storage](../../sys-admin/table-storage/table-storage-overview.md)
