# saveDatabase {#savedatabase}

**Parent topic:**[Functions](../../Functions/category.md)

## Syntax {#syntax}

`saveDatabase(dbHandle)`

## Arguments {#arguments}

**dbHandle** is a DolphinDB database handle.

## Details {#details}

Save a database handle. It must be executed by a logged-in user. It is used with the [database](../d/database.md) function.

After we create a database for the first time, we can save the database with the command `saveDatabase`. If the database location is a folder that already contains DolphinDB table related files, then function [database](../d/database.md) reopens a previously created database, and there is no need to use the `saveDatabase` command to save it.

## Examples {#examples}

```
db=database("C:/DolphinDB/")
saveDatabase(db);
```

