sys.database_service_objectives (Azure SQL Database)sys.database_service_objectives (Azure SQL Database)

適用範圍:Applies to: 是Azure SQL DatabaseAzure SQL DatabaseYesAzure SQL DatabaseAzure SQL Database 是Azure SQL 受控執行個體Azure SQL Managed InstanceYesAzure SQL 受控執行個體Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics適用範圍:Applies to: 是Azure SQL DatabaseAzure SQL DatabaseYesAzure SQL DatabaseAzure SQL Database 是Azure SQL 受控執行個體Azure SQL Managed InstanceYesAzure SQL 受控執行個體Azure SQL Managed Instance 是Azure Synapse AnalyticsAzure Synapse AnalyticsyesAzure Synapse AnalyticsAzure Synapse Analytics

針對 Azure SQL database 或 Azure Synapse Analytics,傳回 (服務層級) 、服務目標 (定價層) 和彈性集區名稱(如果有的話)。Returns the edition (service tier), service objective (pricing tier) and elastic pool name, if any, for an Azure SQL database or an Azure Synapse Analytics. 若已登入 Azure SQL Database 伺服器中的 master 資料庫,則傳回所有資料庫的相關資訊。If logged on to the master database in an Azure SQL Database server, returns information on all databases. 針對 Azure Synapse Analytics,您必須連接到 master 資料庫。For Azure Synapse Analytics, you must be connected to the master database.

如需定價的詳細資訊,請參閱 SQL Database 選項和效能: SQL Database 定價Azure Synapse Analytics 定價For information on pricing, see SQL Database options and performance: SQL Database Pricing and Azure Synapse Analytics Pricing.

若要變更服務設定,請參閱 ALTER database (Azure SQL Database) alter database (Azure Synapse Analytics) To change the service settings, see ALTER DATABASE (Azure SQL Database) and ALTER DATABASE (Azure Synapse Analytics).

Sys.database_service_objectives view 包含下列資料行。The sys.database_service_objectives view contains the following columns.

資料行名稱Column Name 資料類型Data type 描述Description
database_iddatabase_id intint 資料庫的識別碼,在 Azure SQL Database server 的實例內是唯一的。The ID of the database, unique within an instance of Azure SQL Database server. Joinable 與 sys. 資料庫 (transact-sql)Joinable with sys.databases (Transact-SQL).
editionedition sysnamesysname 資料庫或資料倉儲的服務層: 基本標準Premium資料倉儲The service tier for the database or data warehouse: Basic, Standard, Premium or Data Warehouse.
service_objectiveservice_objective sysnamesysname 資料庫的定價層。The pricing tier of the database. 如果資料庫是在彈性集區中,則會傳回 ElasticPoolIf the database is in an elastic pool, returns ElasticPool.

在「 基本 」層上,傳回「 基本」。On the Basic tier, returns Basic.

標準服務層級中的單一資料庫 會傳回下列其中一項: S0、S1、S2、S3、S4、S6、S7、S9 或 S12。Single database in a standard service tier returns one of the following: S0, S1, S2, S3, S4, S6, S7, S9 or S12.

進階層 中的單一資料庫 會傳回下列各項: P1、P2、P4、P6、P11 或 P15。Single database in a premium tier returns of the following: P1, P2, P4, P6, P11 or P15.

Azure Synapse Analytics 透過 DW30000C 傳回 DW100。Azure Synapse Analytics returns DW100 through DW30000c.

如需詳細資訊,請參閱單一資料庫彈性集區、資料倉儲For details, see single databases, elastic pools, data warehouses
elastic_pool_nameelastic_pool_name sysnamesysname 資料庫所屬 彈性集 區的名稱。The name of the elastic pool that the database belongs to. 如果資料庫是單一資料庫或資料倉儲,則會傳回 NullReturns NULL if the database is a single database or a data warehouse.

權限Permissions

需要 master 資料庫的 dbManager 許可權。Requires dbManager permission on the master database. 在資料庫層級,使用者必須是建立者或擁有者。At the database level, the user must be the creator or owner.

範例Examples

此範例可在 master 資料庫上執行,或在 Azure SQL Database 使用者資料庫上執行。This example can be run on the master database or on Azure SQL Database user databases. 此查詢會傳回資料庫 (s) 的名稱、服務和效能層級資訊。The query returns the name, service, and performance tier information of the database(s).

SELECT  d.name,   
     slo.*    
FROM sys.databases d   
JOIN sys.database_service_objectives slo    
ON d.database_id = slo.database_id;