Skip to content

Commit 0013cd7

Browse files
Update the page on how to delete db (#1777)
Fix the following: - the config - `dbms.directories.dumps.root` → `server.directories.dumps.root` - `neo4j-admin dump` command → `neo4j-admin database dump` - `neo4j-admin load` command → `neo4j-admin database load`
1 parent e71ca5a commit 0013cd7

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

modules/ROOT/pages/database-administration/standard-databases/delete-databases.adoc

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ DROP [COMPOSITE] DATABASE name [IF EXISTS] [{DUMP\|DESTROY} [DATA]] [WAIT [n [SE
2222

2323
|===
2424

25-
== Usage examples
25+
== Examples
26+
27+
[[delete-database]]
28+
=== Delete a database
29+
30+
To delete the database `customers`, run the following command:
2631

27-
.Delete a database
28-
======
29-
.Query
3032
[source, cypher]
3133
----
3234
DROP DATABASE customers
@@ -38,9 +40,8 @@ Both standard databases and composite databases can be deleted using this comman
3840
====
3941

4042
The `DROP DATABASE` command removes a database entirely.
41-
Therefore, it no longer shows up in the listing provided by the command `SHOW DATABASES`.
43+
Therefore, it no longer shows up in the listing provided by the command `SHOW DATABASES`:
4244

43-
.Query
4445
[source, cypher]
4546
----
4647
SHOW DATABASES YIELD name
@@ -57,54 +58,49 @@ SHOW DATABASES YIELD name
5758
| "system" |
5859
+---------------------+
5960
----
60-
======
61+
6162

6263
[[delete-databases-existing]]
63-
=== Use `IF EXISTS` when deleting databases
64+
=== Delete a database with `IF{nbsp}EXISTS`
6465

6566
The `DROP DATABASE` command is optionally idempotent, with the default behavior to fail with an error if the database does not exist.
66-
Appending `IF EXISTS` to the command ensures that no error is returned and nothing happens should the database not exist.
67-
It will always return an error if there is an existing alias that targets the database.
67+
68+
Appending `IF EXISTS` to the command ensures that no error is returned and nothing happens if the database does not exist.
69+
70+
It always returns an error if there is an existing alias that targets the database.
6871
In that case, the alias needs to be dropped before dropping the database.
6972

70-
.Query
7173
[source, cypher]
7274
----
7375
DROP DATABASE customers IF EXISTS
7476
----
7577

7678
[[manage-databases-dump]]
77-
=== Use `DUMP DATA` or `DESTROY DATA` when deleting databases
78-
79-
You can request that a dump of the store files is produced first, and stored in the path configured using the `dbms.directories.dumps.root` setting (by default `<neo4j-home>/data/dumps`).
80-
This can be achieved by appending `DUMP DATA` to the command (or `DESTROY DATA` to explicitly request the default behavior).
81-
These dumps are equivalent to those produced by `neo4j-admin dump` and can be similarly restored using `neo4j-admin load`.
79+
=== Delete a database with `DUMP DATA` or `DESTROY DATA`
8280

83-
////
84-
[source, cypher, role=test-setup]
85-
----
86-
DROP ALIAS `films` FOR DATABASE;
87-
DROP ALIAS `motion pictures` FOR DATABASE;
88-
----
89-
////
81+
By appending `DUMP DATA` to the command `DROP DATABASE`, you can create a dump of the store files before deleting the database:
9082

91-
.Query
9283
[source, cypher]
9384
----
9485
DROP DATABASE movies DUMP DATA
9586
----
9687

88+
These dumps are equivalent to those produced by xref:backup-restore/offline-backup.adoc[`neo4j-admin database dump`] and can be similarly restored using the xref:backup-restore/restore-dump.adoc[`neo4j-admin database load`] command.
89+
90+
In Neo4j, dumps can be stored in the directory specified by the xref:configuration/configuration-settings.adoc#config_server.directories.dumps.root[`server.directories.dumps.root`] setting (by default, the path for storing dumps is xref:configuration/file-locations.adoc#data[`<neo4j-home>/data/dumps`]).
91+
92+
The option `DESTROY DATA` explicitly requests the default behavior of the command.
93+
94+
[[delete-existing-db-with-dump]]
95+
=== Delete a database with `IF{nbsp}EXISTS` and `DUMP DATA`/ `DESTROY DATA`
96+
97+
The options `IF EXISTS` and `DUMP DATA`/ `DESTROY DATA` can also be combined.
9798

98-
.Combine `IF EXISTS` and `DUMP DATA`/ `DESTROY DATA`
99-
======
100-
The options `IF EXISTS` and `DUMP DATA`/ `DESTROY DATA` can also be combined.
10199
An example could look like this:
102100

103-
.Query
104101
[source, cypher]
105102
----
106103
DROP DATABASE customers IF EXISTS DUMP DATA
107104
----
108-
======
109105

110106

0 commit comments

Comments
 (0)