Skip to content

Commit 82c0538

Browse files
20231101 Update shrink-a-database.md
1 parent 8dbb42a commit 82c0538

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

docs/relational-databases/databases/shrink-a-database.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ Requires membership in the **sysadmin** fixed server role or the **db_owner** fi
5454

5555
Shrink operations in progress can block other queries on the database, and can be blocked by queries already in progress. Introduced in [!INCLUDE[sssql22-md](../../includes/sssql22-md.md)], shrink database operations have a WAIT_AT_LOW_PRIORITY option. This feature is a new additional option for `DBCC SHRINKDATABASE` and `DBCC SHRINKFILE`. If a new shrink operation in WAIT_AT_LOW_PRIORITY mode can't obtain the necessary locks due to a long-running query already in progress, the shrink operation will eventually time out after one minute and silently exit, preventing other queries from being blocked. For more information, see [DBCC SHRINKDATABASE](../../t-sql/database-console-commands/dbcc-shrinkdatabase-transact-sql.md).
5656

57+
For information on file management and shrink operations specific to Azure SQL Database, see [Manage file space for databases in Azure SQL Database](/azure/azure-sql/database/file-space-manage?view=azuresql-db&preserve-view=true).
58+
5759
## <a id="SSMSProcedure"></a> Use SQL Server Management Studio
5860

61+
**Applies to:** SQL Server, Azure SQL Managed Instance
62+
5963
#### Shrink a database
6064

6165
1. In **Object Explorer**, connect to an instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)], and then expand that instance.
@@ -102,17 +106,15 @@ Shrink operations in progress can block other queries on the database, and can b
102106

103107
Data that is moved to shrink a file can be scattered to any available location in the file. This causes index fragmentation and can slow the performance of queries that search a range of the index. To eliminate the fragmentation, consider rebuilding the indexes on the file after shrinking. For more information, see [Rebuild an index](../../relational-databases/indexes/reorganize-and-rebuild-indexes.md#rebuild-an-index).
104108

105-
## See also
109+
## Related content
106110

107111
- [Shrink the tempdb database](shrink-tempdb-database.md)
108112
- [Considerations for the autogrow and autoshrink settings in SQL Server](/troubleshoot/sql/admin/considerations-autogrow-autoshrink)
109113
- [Database Files and Filegroups](database-files-and-filegroups.md)
110114
- [sys.databases (Transact-SQL)](../../relational-databases/system-catalog-views/sys-databases-transact-sql.md)
111115
- [sys.database_files (Transact-SQL)](../../relational-databases/system-catalog-views/sys-database-files-transact-sql.md)
112-
113-
## Next steps
114-
115116
- [DBCC SHRINKDATABASE (Transact-SQL)](../../t-sql/database-console-commands/dbcc-shrinkdatabase-transact-sql.md)
116117
- [DBCC SHRINKFILE (Transact-SQL)](../../t-sql/database-console-commands/dbcc-shrinkfile-transact-sql.md)
117118
- [Delete Data or Log Files from a Database](delete-data-or-log-files-from-a-database.md)
118119
- [Shrink a file](shrink-a-file.md)
120+
- [Manage file space for databases in Azure SQL Database](/azure/azure-sql/database/file-space-manage?view=azuresql-db&preserve-view=true)

0 commit comments

Comments
 (0)