开始使用 Azure SQL 数据库中的单一数据库Getting started with single databases in Azure SQL Database
适用于:
Azure SQL 数据库
单一数据库是完全托管的平台即服务 (PaaS) 数据库即服务 (DbaaS),也是新式云原生应用程序的理想存储引擎。A single database is fully managed platform as a service (PaaS) database as a service (DbaaS) that is ideal storage engine for the modern cloud-born applications. 本部分介绍如何在 Azure SQL 数据库中快速配置和创建单一数据库。In this section, you'll learn how to quickly configure and create a single database in Azure SQL Database.
快速入门概述Quickstart overview
本部分提供了可帮助你快速开始使用单一数据库的可用文章的概述。In this section, you'll see an overview of available articles that can help you to quickly get started with single databases. 以下快速入门可帮助你快速创建单一数据库、配置服务器级防火墙规则,然后使用 .bacpac
文件将数据库导入新的单一数据库:The following quickstarts enable you to quickly create a single database, configure a server-level firewall rule, and then import a database into the new single database using a .bacpac
file:
- 使用 Azure 门户创建单一数据库。Create a single database using the Azure portal.
- 创建数据库后,需要通过配置防火墙规则来保护该数据库。After creating the database, you would need to secure your database by configuring firewall rules.
- 若要将 SQL Server 上的现有数据库迁移到 Azure SQL 数据库,应该安装数据迁移助手 (DMA),用于分析 SQL Server 上的数据库,并找出可能会阻止迁移的任何问题。If you have an existing database on SQL Server that you want to migrate to Azure SQL Database, you should install Data Migration Assistant (DMA) that will analyze your databases on SQL Server and find any issue that could block migration. 如果找不到任何问题,可将数据库导出为
.bacpac
文件,然后使用 Azure 门户或 SqlPackage 导入该文件。If you don't find any issue, you can export your database as.bacpac
file and import it using the Azure portal or SqlPackage.
自动化管理操作Automating management operations
可以使用 PowerShell 或 Azure CLI 创建、配置和缩放数据库。You can use PowerShell or the Azure CLI to create, configure, and scale your database.
- 使用 PowerShell 或 Azure CLI 创建和配置单一数据库Create and configure a single database using PowerShell or Azure CLI
- 使用 PowerShell 或 Azure CLI 更新单一数据库和缩放资源Update your single database and scale resources using PowerShell or Azure CLI
在尽量缩短停机时间的情况下迁移到单一数据库Migrating to a single database with minimal downtime
参考这些快速入门中的文章可以使用 .bacpac
文件快速创建数据库或将其导入 Azure。These quickstarts enable you to quickly create or import your database to Azure using a .bacpac
file. 但是,使用 .bacpac
和 .dacpac
文件可以快速在 Azure SQL 中以及不同 SQL Server 版本之间转移数据库,或者在 DevOps 管道中实现持续集成。However, .bacpac
and .dacpac
files are designed to quickly move databases across different versions of SQL Server and within Azure SQL, or to implement continuous integration in your DevOps pipeline. 但是,此方法不适合用于在尽量缩短停机时间的前提下迁移生产数据库,因为需要停止添加新数据,等待将源数据库导出到 .bacpac
文件,然后等待将其导入 Azure SQL 数据库。However, this method is not designed for migration of your production databases with minimal downtime, because you would need to stop adding new data, wait for the export of the source database to a .bacpac
file to complete, and then wait for the import into Azure SQL Database to complete. 所有这些操作会导致应用程序出现一段停机时间,尤其是数据库较大时。All of this waiting results in downtime of your application, especially for large databases. 若要转移生产数据库,需要采用更好的方式进行迁移,以确保尽量缩短迁移所导致的停机时间。To move your production database, you need a better way to migrate that guarantees minimal downtime of migration. 为此,请使用数据迁移服务 (DMS),它可以在尽量缩短停机时间的情况下迁移数据库。For this, use the Data Migration Service (DMS) to migrate your database with the minimal downtime. 为实现这种迁移,DMS 会以增量方式将源数据库中发生的更改推送到所要还原的单一数据库。DMS accomplishes this by incrementally pushing the changes made in your source database to the single database being restored. 这样,便可以在尽量缩短停机时间的前提下,快速将应用程序从源数据库切换到目标数据库。This way, you can quickly switch your application from source to target database with the minimal downtime.
后续步骤Next steps
- 查看 Azure SQL 数据库支持的功能的概要列表。Find a high-level list of supported features in Azure SQL Database.
- 了解如何使数据库变得更安全。Learn how to make your database more secure.
- 在如何在 Azure SQL 数据库中使用单一数据库中查看更深入的操作指南。Find more advanced how-to's in how to use a single database in Azure SQL Database.
- 查找在 PowerShell 和 Azure CLI 中编写的其他示例脚本。Find more sample scripts written in PowerShell and the Azure CLI.
- 详细了解可用于配置数据库的管理 API。Learn more about the management API that you can use to configure your databases.
- 确定适合本地数据库的 Azure SQL 数据库或 Azure SQL 托管实例 SKU。Identify the right Azure SQL Database or Azure SQL Managed Instance SKU for your on-premises database.