You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -363,6 +362,8 @@ ALTER DATABASE { database_name | CURRENT }
363
362
| SERVICE_OBJECTIVE =
364
363
{ <service-objective>
365
364
| { ELASTIC_POOL ( name = <elastic_pool_name>) }
365
+
| DATABASE_NAME = <target_database_name>
366
+
| SECONDARY_TYPE = { GEO | NAMED }
366
367
}
367
368
}
368
369
@@ -602,6 +603,12 @@ SERVICE_OBJECTIVE
602
603
603
604
- Specifies the compute size (service objective). Available values for service objective are: `HS_GEN4_1``HS_GEN4_2``HS_GEN4_4``HS_GEN4_8``HS_GEN4_16`, `HS_GEN4_24`, `HS_Gen5_2`, `HS_Gen5_4`, `HS_Gen5_8`, `HS_Gen5_16`, `HS_Gen5_24`, `HS_Gen5_32`, `HS_Gen5_48`, `HS_Gen5_80`.
604
605
606
+
DATABASE_NAME
607
+
Only for Azure SQL Database Hyperscale. The database name that will be created. Only used by Azure SQL Database Hyperscale named replicas, when `SECONDARY_TYPE` = NAMED. For more information, see [Hyperscale Secondary Replicas](/azure/azure-sql/database/service-tier-hyperscale-replicas).
608
+
609
+
SECONDARY_TYPE
610
+
Only for Azure SQL Database Hyperscale. **GEO** specifies a geo-replica, **NAMED** specifies a named replica. Default is **GEO**. For more information, see [Hyperscale Secondary Replicas](/azure/azure-sql/database/service-tier-hyperscale-replicas).
611
+
605
612
For service objective descriptions and more information about the size, editions, and the service objectives combinations, see [Azure SQL Database Service Tiers and Performance Levels](/azure/azure-sql/database/purchasing-models), [DTU resource limits](/azure/sql-database/sql-database-dtu-resource-limits) and [vCore resource limits](/azure/sql-database/sql-database-dtu-resource-limits). Support for PRS service objectives have been removed. For questions, use this e-mail alias: premium-rs@microsoft.com.
@@ -613,9 +620,6 @@ To add an existing database to an elastic pool, set the SERVICE_OBJECTIVE of the
613
620
ADD SECONDARY ON SERVER \<partner_server_name>
614
621
Creates a geo-replication secondary database with the same name on a partner server, making the local database into a geo-replication primary, and begins asynchronously replicating data from the primary to the new secondary. If a database with the same name already exists on the secondary, the command fails. The command is executed on the master database on the server hosting the local database that becomes the primary.
615
622
616
-
> [!IMPORTANT]
617
-
> The Hyperscale service tier does not currently support geo-replication.
618
-
619
623
> [!IMPORTANT]
620
624
> By default, the secondary database is created with the same backup storage redundancy as that of the primary or source database. Changing the backup storage redundancy while creating the secondary is not supported via T-SQL.
621
625
@@ -636,7 +640,7 @@ REMOVE SECONDARY ON SERVER \<partner_server_name>
636
640
Removes the specified geo-replicated secondary database on the specified server. The command is executed on the master database on the server hosting the primary database.
637
641
638
642
> [!IMPORTANT]
639
-
> The user executing the REMOVE SECONDARY command must be DBManager on the primary server.
643
+
> The user executing the `REMOVE SECONDARY` command must be DBManager on the primary server.
640
644
641
645
FAILOVER
642
646
Promotes the secondary database in geo-replication partnership on which the command is executed to become the primary and demotes the current primary to become the new secondary. As part of this process, the geo-replication mode is temporarily switched from asynchronous mode to synchronous mode. During the failover process:
@@ -883,7 +887,7 @@ Designates that the current database in use should be altered.
883
887
Clearing the plan cache causes a recompilation of all subsequent execution plans and can cause a sudden, temporary decrease in query performance. For each cleared cachestore in the plan cache, the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] error log contains the following informational message: " [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] has encountered %d occurrence(s) of cachestore flush for the '%s' cachestore (part of plan cache) due to some database maintenance or reconfigure operations". This message is logged every five minutes as long as the cache is flushed within that time interval.
884
888
The plan cache is also flushed when several queries are executed against a database that has default options. Then, the database is dropped.
885
889
886
-
- Some `ALTER DATABASE` statements require exclusive lock on a database to be executed. This is why they might fail when another active process is holding a lock on the database. Error that is reported in a case like this is `Msg 5061, Level 16, State 1, Line 38` with message `ALTER DATABASE failed because a lock could not be placed on database '<database name>'. Try again later`. This is typically a transient failure and to resolve it, once all locks on the database are released, retry the ALTER DATABASE statement that failed. System view `sys.dm_tran_locks` holds information on active locks. To check if there are shared or exclusive locks on a database use following query.
890
+
- Some `ALTER DATABASE` statements require exclusive lock on a database to be executed. This is why they might fail when another active process is holding a lock on the database. Error that is reported in a case like this is `Msg 5061, Level 16, State 1, Line 38` with message `ALTER DATABASE failed because a lock could not be placed on database '<database name>'. Try again later`. This is typically a transient failure and to resolve it, once all locks on the database are released, retry the `ALTER DATABASE` statement that failed. System view `sys.dm_tran_locks` holds information on active locks. To check if there are shared or exclusive locks on a database use following query.
887
891
888
892
```sql
889
893
SELECT
@@ -894,7 +898,7 @@ The plan cache is also flushed when several queries are executed against a datab
894
898
resource_database_id = DB_ID('testdb')
895
899
```
896
900
897
-
## Viewing Database Information
901
+
## Viewing database information
898
902
899
903
You can use catalog views, system functions, and system stored procedures to return information about databases, files, and filegroups.
900
904
@@ -911,10 +915,10 @@ The following examples show you how to set automatic tuning and how to add a fil
911
915
912
916
```sql
913
917
ALTER DATABASE WideWorldImporters
914
-
SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON)
918
+
SET AUTOMATIC_TUNING ( FORCE_LAST_GOOD_PLAN = ON);
915
919
916
920
ALTER DATABASE WideWorldImporters
917
-
ADD FILE (NAME = 'data_17')
921
+
ADD FILE (NAME = 'data_17');
918
922
```
919
923
920
924
## See also
@@ -928,7 +932,8 @@ ALTER DATABASE WideWorldImporters
- [Azure Synapse Analytics list of reference articles](/azure/synapse-analytics/sql-data-warehouse/sql-data-warehouse-reference-tsql-language-elements)
@@ -1197,7 +1202,7 @@ Default is ON for new databases created after upgrading to AU7. The default is O
1197
1202
For more information about statistics, see [Statistics](../../relational-databases/statistics/statistics.md).
1198
1203
1199
1204
SET AUTO_UPDATE_STATISTICS_ASYNC { ON | OFF }
1200
-
The asynchronous statistics update option, AUTO_UPDATE_STATISTICS_ASYNC, determines whether the Query Optimizer uses synchronous or asynchronous statistics updates. The AUTO_UPDATE_STATISTICS_ASYNC option applies to statistics objects created for indexes, single columns in query predicates, and statistics created with the CREATE STATISTICS statement.
1205
+
The asynchronous statistics update option, AUTO_UPDATE_STATISTICS_ASYNC, determines whether the Query Optimizer uses synchronous or asynchronous statistics updates. The AUTO_UPDATE_STATISTICS_ASYNC option applies to statistics objects created for indexes, single columns in query predicates, and statistics created with the `CREATE STATISTICS` statement.
1201
1206
1202
1207
Default is ON for new databases created after upgrading to AU7. The default is OFF for databases created prior to the upgrade.
1203
1208
@@ -1219,7 +1224,7 @@ The values for `REPLICATED_SIZE`, `DISTRIBUTED_SIZE`, and `LOG_SIZE` can be grea
1219
1224
1220
1225
Grow and shrink operations are approximate. The resulting actual sizes can vary from the size parameters.
1221
1226
1222
-
[!INCLUDE[ssPDW](../../includes/sspdw-md.md)] does not perform the ALTER DATABASE statement as an atomic operation. If the statement is aborted during execution, changes that have already occurred will remain.
1227
+
[!INCLUDE[ssPDW](../../includes/sspdw-md.md)] does not perform the `ALTER DATABASE` statement as an atomic operation. If the statement is aborted during execution, changes that have already occurred will remain.
1223
1228
1224
1229
The statistics settings only work if the administrator has enable auto-stats. If you are an administrator, use the feature switch [AutoStatsEnabled](../../analytics-platform-system/appliance-feature-switch.md) to enable or disable auto-stats.
0 commit comments