Class AzureSQLDatabaseSchema.DataContext
- Namespace
- LinqToDB.Tools.DataProvider.SqlServer.Schemas
- Assembly
- linq2db.Tools.dll
public class AzureSQLDatabaseSchema.DataContext
- Inheritance
-
AzureSQLDatabaseSchema.DataContext
- Extension Methods
Constructors
DataContext(IDataContext)
public DataContext(IDataContext dataContext)
Parameters
dataContext
IDataContext
Properties
BandwidthUsages
sys.bandwidth_usage (Azure SQL Database)
Applies to: √ Azure SQL Database √ Azure SQL Managed Instance
note
This applies only to Azure SQL DatabaseV11.
Returns information about the network bandwidth used by each database in a Azure SQL Database V11 database server, . Each row returned for a given database summarizes a single direction and class of usage over a one-hour period.
This has been deprecated in a Azure SQL Database.
The sys.bandwidth_usage view contains the following columns.
See sys.bandwidth_usage.
public ITable<AzureSQLDatabaseSchema.BandwidthUsage> BandwidthUsages { get; }
Property Value
DatabaseConnectionStats
sys.database_connection_stats (Azure SQL Database)
Applies to: √ Azure SQL Database
Contains statistics for SQL Database database connectivity events, providing an overview of database connection successes and failures. For more information about connectivity events, see Event Types in sys.event_log (Azure SQL Database).
public ITable<AzureSQLDatabaseSchema.DatabaseConnectionStat> DatabaseConnectionStats { get; }
Property Value
DatabaseFirewallRules
sys.database_firewall_rules (Azure SQL Database)
Applies to: √ Azure SQL Database √ Azure SQL Managed Instance
Returns information about the database-level firewall settings associated with your Microsoft Azure SQL Database. Database-level firewall settings are particularly useful when using contained database users. For more information, see Contained Database Users - Making Your Database Portable.
The sys.database_firewall_rules
view contains the following columns:
public ITable<AzureSQLDatabaseSchema.DatabaseFirewallRule> DatabaseFirewallRules { get; }
Property Value
DatabaseServiceObjectives
sys.database_service_objectives (Azure SQL Database)
Applies to: √ Azure SQL Database √ Azure SQL Managed Instance √ 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. If logged on to the master database in an Azure SQL Database server, returns information on all databases. For Azure Synapse Analytics, you must be connected to the master database.
For information on pricing, see SQL Database options and performance: SQL Database Pricing and Azure Synapse Analytics Pricing.
To change the service settings, see ALTER DATABASE (Azure SQL Database) and ALTER DATABASE (Azure Synapse Analytics).
The sys.database_service_objectives view contains the following columns.
public ITable<AzureSQLDatabaseSchema.DatabaseServiceObjective> DatabaseServiceObjectives { get; }
Property Value
DatabaseUsages
sys.database_usage (Azure SQL Database)
Applies to: √ Azure SQL Database √ Azure SQL Managed Instance
Note: This applies only to Azure SQL Database V11.
Lists the number, type, and duration of databases on the SQL Database server.
The sys.database_usage view contains the following columns.
See sys.database_usage.
public ITable<AzureSQLDatabaseSchema.DatabaseUsage> DatabaseUsages { get; }
Property Value
ElasticPoolResourceStats
sys.elastic_pool_resource_stats (Azure SQL Database)
Applies to: √ Azure SQL Database √ Azure SQL Managed Instance
Returns resource usage statistics for all the elastic pools in a SQL Database server. For each elastic pool, there is one row for each 15 second reporting window (four rows per minute). This includes CPU, IO, Log, storage consumption and concurrent request/session utilization by all databases in the pool. This data is retained for 14 days.
||
|-|
|Applies to: SQL Database V12.|
public ITable<AzureSQLDatabaseSchema.ElasticPoolResourceStat> ElasticPoolResourceStats { get; }
Property Value
EventLogs
sys.event_log (Azure SQL Database)
Applies to: √ Azure SQL Database
Returns successful Azure SQL Database database connections, connection failures, and deadlocks. You can use this information to track or troubleshoot your database activity with SQL Database.
> [!CAUTION]
> For installations having a large number of databases or high numbers of logins, activity in sys.event_log can cause limitations in performance, high CPU usage, and possibly result in login failures. Queries of sys.event_log can contribute to the problem. Microsoft is working to resolve this issue. In the meantime, to reduce the impact of this issue, limit queries of sys.event_log. Users of the NewRelic SQL Server plugin should visit Microsoft Azure SQL Database plugin tuning & performance tweaks for additional configuration information.
The sys.event_log
view contains the following columns.
See sys.event_log.
public ITable<AzureSQLDatabaseSchema.EventLog> EventLogs { get; }
Property Value
FirewallRules
sys.firewall_rules (Azure SQL Database)
Applies to: √ Azure SQL Database √ Azure SQL Managed Instance
Returns information about the server-level firewall settings associated with your Microsoft Azure SQL Database.
The sys.firewall_rules
view contains the following columns:
See sys.firewall_rules.
public ITable<AzureSQLDatabaseSchema.FirewallRule> FirewallRules { get; }
Property Value
ResourceStats
sys.resource_stats (Azure SQL Database)
Applies to: √ Azure SQL Database
Returns CPU usage and storage data for an Azure SQL Database. The data is collected and aggregated within five-minute intervals. For each user database, there is one row for every five-minute reporting window in which there is a change in resource consumption. The data returned includes CPU usage, storage size change, and database SKU modification. Idle databases with no changes may not have rows for every five-minute interval. Historical data is retained for approximately 14 days.
The sys.resource_stats
view has different definitions depending on the version of the Azure SQL Database Server that the database is associated with. Consider these differences and any modifications your application requires when upgrading to a new server version.
note
This dynamic management view applies to Azure SQL Database only. For an equivalent view for Azure SQL Managed Instance, use sys.server_resource_stats.
The following table describes the columns available in a v12 server:
See sys.resource_stats.
public ITable<AzureSQLDatabaseSchema.ResourceStat> ResourceStats { get; }
Property Value
ResourceUsages
sys.resource_usage (Azure SQL Database)
Applies to: √ Azure SQL Database √ Azure SQL Managed Instance
important
This feature is in a preview state. Do not take a dependency on the specific implementation of this feature because the feature might be changed or removed in a future release.
While in a preview state, the Azure SQL Database operations team might turn data collection off and on for this DMV:
- When turned on, the DMV returns current data as it is aggregated.
- When turned off, the DMV returns historical data, which might be stale.
Provides hourly summary of resource usage data for user databases in the current server. Historical data is retained for 90 days.
For each user database, there is one row for every hour in continuous fashion. Even if the database was idle during that hour, there is one row, and the usage_in_seconds value for that database will be 0. Storage usage and SKU information is rolled up for the hour appropriately.
See sys.resource_usage.
public ITable<AzureSQLDatabaseSchema.ResourceUsage> ResourceUsages { get; }
Property Value
ServerResourceStats
sys.server_resource_stats (Azure SQL Managed Instance)
√ Azure SQL Managed InstanceReturns CPU usage, IO, and storage data for Azure SQL Managed Instance. The data is collected, aggregated and updated within 5 to 10 minutes intervals. There is one row for every 15 seconds reporting. The data returned includes CPU usage, storage size, IO utilization, and SKU. Historical data is retained for approximately 14 days.
The
sys.server_resource_stats
view has different definitions depending on the version of the Azure SQL Managed Instance that the database is associated with. Consider these differences and any modifications your application requires when upgrading to a new server version.note
This dynamic management view applies to Azure SQL Managed Instance only. For an equivalent view for Azure SQL Database, use sys.resource_stats.
public ITable<AzureSQLDatabaseSchema.ServerResourceStat> ServerResourceStats { get; }