> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/ix.-how-to-guides/80.-database-initialization/80.4-initialize-a-spring-batch-database.md).

# 80.4 初始化Spring Batch数据库

如果你使用Spring Batch，它会预先打包为大多数流行数据库平台的SQL初始化脚本。Spring Boot可以检测数据库类型，并在启动时执行这些脚本。如果使用嵌入式数据库，这是默认情况。你也可以为任何数据库类型启用它，如下所示:

```
spring.batch.initialize-schema=always
```

你还可以通过设置`spring.batch.initialize-schema=never`来显式地关闭初始化。
