Skip to content

Commit 33ed1a9

Browse files
authored
Merge pull request #6184 from influxdata/distributed-db-table-mgmt
Task-based table and db management docs for Dedicated and Clustered
2 parents 7a89527 + 490c57d commit 33ed1a9

File tree

10 files changed

+561
-58
lines changed

10 files changed

+561
-58
lines changed

content/influxdb3/cloud-dedicated/admin/databases/delete.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,19 @@ or the [Management HTTP API](/influxdb3/cloud-dedicated/api/management/)
3333
to delete a database from your {{< product-name omit=" Clustered" >}} cluster.
3434

3535
> [!Warning]
36-
>
37-
> #### Deleting a database cannot be undone
38-
>
39-
> Once a database is deleted, data stored in that database cannot be recovered.
40-
>
4136
> #### Wait before writing to a new database with the same name
4237
>
4338
> After deleting a database from your {{% product-name omit=" Clustered" %}}
4439
> cluster, you can reuse the name to create a new database, but **wait two to
4540
> three minutes** after deleting the previous database before writing to the new
4641
> database to allow write caches to clear.
42+
>
43+
> #### Tokens still grant access to databases with the same name
44+
>
45+
> [Database tokens](/influxdb3/cloud-dedicated/admin/tokens/database/) are associated to
46+
> databases by name. If you create a new database with the same name, tokens
47+
> that granted access to the deleted database will also grant access to the new
48+
> database.
4749
4850
{{< tabs-wrapper >}}
4951
{{% tabs %}}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Rename a database
3+
description: >
4+
Use the [`influxctl database rename` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/database/rename/)
5+
to rename a database in your {{< product-name omit=" Cluster" >}} cluster.
6+
menu:
7+
influxdb3_cloud_dedicated:
8+
parent: Manage databases
9+
weight: 202
10+
list_code_example: |
11+
##### CLI
12+
```sh
13+
influxctl database rename <DATABASE_NAME> <NEW_DATABASE_NAME>
14+
```
15+
related:
16+
- /influxdb3/cloud-dedicated/reference/cli/influxctl/database/rename/
17+
- /influxdb3/cloud-dedicated/admin/tokens/database/create/
18+
---
19+
20+
Use the [`influxctl database rename` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/database/rename/)
21+
to rename a database in your {{< product-name omit=" Cluster" >}} cluster.
22+
23+
> [!Note]
24+
> Renaming a database does not change the database ID, modify data in the database,
25+
> or update [database tokens](/influxdb3/cloud-dedicated/admin/tokens/database/).
26+
> After renaming a database, any existing database tokens will stop working and you
27+
> must create new tokens with permissions for the renamed database.
28+
29+
## Rename a database using the influxctl CLI
30+
31+
{{% code-placeholders "DATABASE_NAME|NEW_DATABASE_NAME" %}}
32+
```sh
33+
influxctl database rename DATABASE_NAME NEW_DATABASE_NAME
34+
```
35+
{{% /code-placeholders %}}
36+
37+
Replace the following:
38+
39+
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Current name of the database to rename
40+
- {{% code-placeholder-key %}}`NEW_DATABASE_NAME`{{% /code-placeholder-key %}}: New name for the database
41+
42+
## Update database tokens after renaming
43+
44+
After renaming a database, existing database tokens will no longer work because
45+
they reference the old database name. Do the following:
46+
47+
1. [Create new database tokens](/influxdb3/cloud-dedicated/admin/tokens/database/create/)
48+
with permissions for the renamed database.
49+
2. Update your applications and clients to use the new tokens.
50+
3. [Delete the old database tokens](/influxdb3/cloud-dedicated/admin/tokens/database/delete/)
51+
that reference the old database name.
52+
53+
{{% note %}}
54+
#### Renamed database retains its ID
55+
56+
The database ID remains the same after renaming. When you list databases,
57+
you'll see the new name associated with the original database ID.
58+
{{% /note %}}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Undelete a database
3+
description: >
4+
Use the [`influxctl database undelete` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/database/undelete/)
5+
to restore a previously deleted database in your {{< product-name omit=" Cluster" >}} cluster.
6+
menu:
7+
influxdb3_cloud_dedicated:
8+
parent: Manage databases
9+
weight: 204
10+
list_code_example: |
11+
```sh
12+
influxctl database undelete <DATABASE_NAME>
13+
```
14+
related:
15+
- /influxdb3/cloud-dedicated/reference/cli/influxctl/database/undelete/
16+
- /influxdb3/cloud-dedicated/admin/databases/delete/
17+
- /influxdb3/cloud-dedicated/admin/tokens/database/create/
18+
---
19+
20+
Use the [`influxctl database undelete` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/database/undelete/)
21+
to restore a previously deleted database in your {{< product-name omit=" Cluster" >}} cluster.
22+
23+
> [!Important]
24+
> To undelete a database:
25+
>
26+
> - The database name must match the name of the deleted database.
27+
> - A new database with the same name cannot already exist.
28+
> - You must have appropriate permissions to manage databases.
29+
30+
When you undelete a database, it is restored with the same retention period,
31+
table limits, and column limits as when it was deleted.
32+
33+
> [!Warning]
34+
> Databases can only be undeleted for
35+
> {{% show-in "cloud-dedicated" %}}approximately 14 days{{% /show-in %}}{{% show-in "clustered" %}}a configurable "hard-delete" grace period{{% /show-in %}}
36+
> after they are deleted.
37+
> After this grace period, all Parquet files associated with the deleted database
38+
> are permanently removed and the database cannot be undeleted.
39+
40+
## Undelete a database using the influxctl CLI
41+
42+
{{% code-placeholders "DATABASE_NAME" %}}
43+
```sh
44+
influxctl database undelete DATABASE_NAME
45+
```
46+
{{% /code-placeholders %}}
47+
48+
Replace the following:
49+
50+
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}:
51+
Name of the deleted database to restore
52+
53+
## Recreate tokens for the database
54+
55+
After successfully undeleting a database:
56+
57+
1. **Verify the database was restored** by [listing all databases](/influxdb3/cloud-dedicated/admin/databases/list/).
58+
2. **If you previously deleted tokens associated with the deleted database, create new database tokens**
59+
- Any tokens that existed before deletion are not restored.
60+
[Create new database tokens](/influxdb3/cloud-dedicated/admin/tokens/database/create/)
61+
with appropriate permissions for the restored database.
62+
3. **Update your applications** to use the new database tokens.
63+
64+
{{% note %}}
65+
#### Undeleted databases retain their original configuration
66+
67+
When a database is undeleted, it retains the same database ID, retention period,
68+
and table/column limits it had before deletion. However, database tokens are not
69+
restored and must be recreated.
70+
{{% /note %}}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Delete a table
3+
description: >
4+
Use the Admin UI or the [`influxctl table delete` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/table/delete/)
5+
to delete a table from a database in your {{< product-name omit=" Cluster" >}} cluster.
6+
menu:
7+
influxdb3_cloud_dedicated:
8+
parent: Manage tables
9+
weight: 203
10+
list_code_example: |
11+
```sh
12+
influxctl table delete <DATABASE_NAME> <TABLE_NAME>
13+
```
14+
related:
15+
- /influxdb3/cloud-dedicated/reference/cli/influxctl/table/delete/
16+
---
17+
18+
Use the Admin UI or the [`influxctl table delete` command](/influxdb3/cloud-dedicated/reference/cli/influxctl/table/delete/)
19+
to delete a table from a database in your {{< product-name omit=" Cluster" >}} cluster.
20+
21+
> [!Warning]
22+
> Deleting a table is irreversible. Once a table is deleted, all data stored in
23+
> that table is permanently removed and cannot be recovered.
24+
25+
Provide the following arguments:
26+
27+
- **Database name**: Name of the database that contains the table to delete
28+
- **Table name**: Name of the table to delete
29+
30+
{{% code-placeholders "DATABASE_NAME|TABLE_NAME" %}}
31+
```sh
32+
influxctl table delete DATABASE_NAME TABLE_NAME
33+
```
34+
{{% /code-placeholders %}}
35+
36+
Replace the following:
37+
38+
- {{% code-placeholder-key %}}`DATABASE_NAME`{{% /code-placeholder-key %}}: Name of the database that contains the table to delete
39+
- {{% code-placeholder-key %}}`TABLE_NAME`{{% /code-placeholder-key %}}: Name of the table to delete
40+
41+
When prompted, enter `y` to confirm the deletion.
42+
43+
{{% note %}}
44+
#### Wait before reusing a deleted table name
45+
46+
After deleting a table, wait a few minutes before attempting to create a new
47+
table with the same name to ensure the deletion process has fully completed.
48+
49+
{{% product-name %}} creates tables implicitly using table names specified in
50+
line protocol written to the databases. To prevent the deleted table from being
51+
immediately recreated by incoming write requests, pause all write requests to
52+
the table before deleting it.
53+
{{% /note %}}

0 commit comments

Comments
 (0)