Shrink database

Shrinks the size of the data and log files on the specified database.

By shrinking the size of data files and log files on a database, you can recover space by moving pages of data at the end of the file to unoccupied space near the front of the file. De-allocated pages at the end of the file are returned to the file system.

The request body accepts optional truncateLogsOnly body parameter. If true, only the logs are truncated. By default, false.

A timeout value (in hours) can optonally be set for the shrink job. If unspecified, the job times out after two hours.

🍐

Role-based Permissions

To perform this operation, a principal must belong to a group that has been assigned the appropriate role-based permissions. The table identifies the roles with permission to perform this operation.

ConsumerContributorData Bridge Admin
NONOYES

To learn more about role-based permissions in Data Bridge, see Access Controls.

Path Params
string
required

Name of managed SQL Server instance.

string
required

Name of database.

Body Params
integer
≤ 12
Defaults to 2

Timeout period in hours. Shrink job times out if incomplete after
the specified time. If unspecified, 2.

boolean
Defaults to false

If true, data files are ignored and only log files are truncated.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

400

Bad Request. Some of the provided parameters were not valid.

404

Not found. The entity you are trying to interact with does not
exist.

409

Conflict. The requested resource already exists.

500

Internal Server Error. If the problem persists you may want to
contact the Administrator.

Language
URL
LoadingLoading…
Response
Choose an example:
application/json
text/plain
text/json