什么是 Azure SQL 数据库中的单一数据库?What is a single database in Azure SQL Database?

适用于: Azure SQL 数据库

单一数据库资源类型使用自己的资源集在 Azure SQL 数据库中创建数据库,并通过服务器进行管理。The single database resource type creates a database in Azure SQL Database with its own set of resources and is managed via a server. 对于单一数据库,每个数据库都是独立的,并且可移植。With a single database, each database is isolated and portable. 每个单一数据库在基于 DTU 的购买模型基于 vCore 的购买模型中都有其自己的服务层级,并具备有保证的计算大小。Each has its own service tier within the DTU-based purchasing model or vCore-based purchasing model and a guaranteed compute size.

重要

单一数据库是 Azure SQL 数据库的一种资源类型。Single database is one resource type for Azure SQL Database. 另一种是弹性池The other is elastic pools.

动态可伸缩性Dynamic scalability

可以在无服务器计算层级中,或者在预配的计算层级中采用小型计算大小,以低成本构建第一个基于小型单一数据库的应用。You can build your first app on a small, single database at low cost in the serverless compute tier or a small compute size in the provisioned compute tier. 可以根据解决方案的需要,随时以手动或编程方式更改计算或服务层级You change the compute or service tier manually or programmatically at any time to meet the needs of your solution. 可在不给应用或客户造成停机的情况下调整性能。You can adjust performance without downtime to your app or to your customers. 动态可伸缩性可让数据库以透明方式响应快速变化的资源要求,使用户只需为用到的资源付费。Dynamic scalability enables your database to transparently respond to rapidly changing resource requirements and enables you to only pay for the resources that you need when you need them.

单一数据库和弹性池Single databases and elastic pools

单一数据库可以移进或移出弹性池以进行资源共享。A single database can be moved into or out of an elastic pool for resource sharing. 许多业务和应用程序只要能够创建单一数据库并按需调高或调低性能即可,尤其是当使用模式相对容易预测时。For many businesses and applications, being able to create single databases and dial performance up or down on demand is enough, especially if usage patterns are relatively predictable. 但如果有无法预测的使用模式,则管理成本和业务模式就会变得相当困难。But if you have unpredictable usage patterns, it can make it hard to manage costs and your business model. 弹性池旨在解决此问题。Elastic pools are designed to solve this problem. 概念很简单。The concept is simple. 可以向池而不是单个数据库分配性能资源,并且仅需为池的总体性能资源付费,而无需为单一数据库的性能付费。You allocate performance resources to a pool rather than an individual database and pay for the collective performance resources of the pool rather than for single database performance.

监视和警报Monitoring and alerting

将内置的性能监视警报工具与性能等级组合使用。You use the built-in performance monitoring and alerting tools, combined with the performance ratings. 使用这些工具,可以根据当前需求或项目性能的需求,快速评估调高或调低性能产生的影响。Using these tools, you can quickly assess the impact of scaling up or down based on your current or project performance needs. 此外,SQL 数据库可发出指标和资源日志,以便于监视。Additionally, SQL Database can emit metrics and resource logs for easier monitoring.

可用性功能Availability capabilities

单一数据库和弹性池提供许多可用性特征。Single databases and elastic pools provide many availability characteristics. 有关信息,请参阅可用性特征For information, see Availability characteristics.

Transact-SQL 的差异Transact-SQL differences

Microsoft SQL Server 和 Azure SQL 数据库都完全支持应用程序使用的大多数 Transact-SQL 功能。Most Transact-SQL features that applications use are fully supported in both Microsoft SQL Server and Azure SQL Database. 例如,核心 SQL 组件(如数据类型、运算符、字符串、算术、逻辑和光标函数等)在 SQL Server 和 SQL 数据库中的工作方式相同。For example, the core SQL components such as data types, operators, string, arithmetic, logical, and cursor functions, work identically in SQL Server and SQL Database. 但是,DDL(数据定义语言)和 DML(数据操作语言)元素中的一些 T-SQL 差异导致存在仅部分受支持的 T-SQL 语句和查询(我们会在本文后面的内容中介绍)。There are, however, a few T-SQL differences in DDL (data-definition language) and DML (data manipulation language) elements resulting in T-SQL statements and queries that are only partially supported (which we discuss later in this article).

此外,还有一些功能和语法不受支持,因为 Azure SQL 数据库旨在将功能与 master 数据库和操作系统的依赖项隔离。In addition, there are some features and syntax that are not supported because Azure SQL Database is designed to isolate features from dependencies on the master database and the operating system. 因此,大多数服务器级活动不适用于 SQL 数据库。As such, most server-level activities are inappropriate for SQL Database. T-SQL 语句和选项在配置服务器级选项、配置操作系统组件或指定文件系统配置时不可用。T-SQL statements and options are not available if they configure server-level options, configure operating system components, or specify file system configuration. 需要此类功能时,通常是以某种其他方式从 SQL 数据库或从其他 Azure 功能或服务获取相应的替代项。When such capabilities are required, an appropriate alternative is often available in some other way from SQL Database or from another Azure feature or service.

有关详细信息,请参阅解析迁移到 SQL 数据库的过程中的 Transact-SQL 差异For more information, see Resolving Transact-SQL differences during migration to SQL Database.

安全性Security

SQL 数据库提供一系列内置安全性和符合性功能,帮助应用程序满足各种安全性和符合性要求。SQL Database provides a range of built-in security and compliance features to help your application meet various security and compliance requirements.

重要

Azure SQL 数据库已通过多项合规性标准认证。Azure SQL Database has been certified against a number of compliance standards. 有关详细信息,请参阅 Microsoft Azure 信任中心,可以从中找到 SQL 数据库合规认证的最新列表。For more information, see the Azure Trust Center where you can find the most current list of SQL Database compliance certifications.

后续步骤Next steps