Database Class
A database resource.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
- Inheritance
-
azure.mgmt.sql.models._models_py3.TrackedResourceDatabase
Constructor
Database(*, location: str, tags: Optional[Dict[str, str]] = None, sku: Optional[azure.mgmt.sql.models._models_py3.Sku] = None, create_mode: Optional[Union[str, azure.mgmt.sql.models._sql_management_client_enums.CreateMode]] = None, collation: Optional[str] = None, max_size_bytes: Optional[int] = None, sample_name: Optional[Union[str, azure.mgmt.sql.models._sql_management_client_enums.SampleName]] = None, elastic_pool_id: Optional[str] = None, source_database_id: Optional[str] = None, restore_point_in_time: Optional[datetime.datetime] = None, source_database_deletion_date: Optional[datetime.datetime] = None, recovery_services_recovery_point_id: Optional[str] = None, long_term_retention_backup_resource_id: Optional[str] = None, recoverable_database_id: Optional[str] = None, restorable_dropped_database_id: Optional[str] = None, catalog_collation: Optional[Union[str, azure.mgmt.sql.models._sql_management_client_enums.CatalogCollationType]] = None, zone_redundant: Optional[bool] = None, license_type: Optional[Union[str, azure.mgmt.sql.models._sql_management_client_enums.DatabaseLicenseType]] = None, read_scale: Optional[Union[str, azure.mgmt.sql.models._sql_management_client_enums.DatabaseReadScale]] = None, high_availability_replica_count: Optional[int] = None, secondary_type: Optional[Union[str, azure.mgmt.sql.models._sql_management_client_enums.SecondaryType]] = None, auto_pause_delay: Optional[int] = None, requested_backup_storage_redundancy: Optional[Union[str, azure.mgmt.sql.models._sql_management_client_enums.RequestedBackupStorageRedundancy]] = None, min_capacity: Optional[float] = None, maintenance_configuration_id: Optional[str] = None, is_ledger_on: Optional[bool] = None, **kwargs)
Parameters
- sku
- Sku
The database SKU.
The list of SKUs may vary by region and support offer. To determine the SKUs (including the
SKU name, tier/edition, family, and capacity) that are available to your subscription in an
Azure region, use the Capabilities_ListByLocation REST API or one of the following
commands:
az sql db list-editions -l <location> -o table
`
Get-AzSqlServerServiceObjective -Location <location>
`.
- create_mode
- str or CreateMode
Specifies the mode of database creation.
Default: regular database creation.
Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: "Default", "Copy", "Secondary", "PointInTimeRestore", "Restore", "Recovery", "RestoreExternalBackup", "RestoreExternalBackupSecondary", "RestoreLongTermRetentionBackup", "OnlineSecondary".
- max_size_bytes
- <xref:long>
The max size of the database expressed in bytes.
- sample_name
- str or SampleName
The name of the sample schema to apply when creating this database. Possible values include: "AdventureWorksLT", "WideWorldImportersStd", "WideWorldImportersFull".
- source_database_id
- str
The resource identifier of the source database associated with create operation of this database.
- restore_point_in_time
- datetime
Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
- recovery_services_recovery_point_id
- str
The resource identifier of the recovery point associated with create operation of this database.
- long_term_retention_backup_resource_id
- str
The resource identifier of the long term retention backup associated with create operation of this database.
- recoverable_database_id
- str
The resource identifier of the recoverable database associated with create operation of this database.
- restorable_dropped_database_id
- str
The resource identifier of the restorable dropped database associated with create operation of this database.
- catalog_collation
- str or CatalogCollationType
Collation of the metadata catalog. Possible values include: "DATABASE_DEFAULT", "SQL_Latin1_General_CP1_CI_AS".
- zone_redundant
- bool
Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
- license_type
- str or DatabaseLicenseType
The license type to apply for this database. LicenseIncluded if you
need a license, or BasePrice if you have a license and are eligible for the Azure Hybrid
Benefit. Possible values include: "LicenseIncluded", "BasePrice".
- read_scale
- str or DatabaseReadScale
The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Possible values include: "Enabled", "Disabled".
- high_availability_replica_count
- int
The number of secondary replicas associated with the database that are used to provide high availability.
- secondary_type
- str or SecondaryType
The secondary type of the database if it is a secondary. Valid values are Geo and Named. Possible values include: "Geo", "Named".
- auto_pause_delay
- int
Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled.
- requested_backup_storage_redundancy
- str or RequestedBackupStorageRedundancy
The storage account type to be used to store backups for this database. Possible values include: "Geo", "Local", "Zone".
- min_capacity
- float
Minimal capacity that database will always have allocated, if not paused.
- maintenance_configuration_id
- str
Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
- is_ledger_on
- bool
Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.
Variables
- id
- str
Resource ID.
- name
- str
Resource name.
- type
- str
Resource type.
- kind
- str
Kind of database. This is metadata used for the Azure portal experience.
- managed_by
- str
Resource that manages the database.
- status
- str or DatabaseStatus
The status of the database. Possible values include: "Online", "Restoring", "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", "Disabled".
- database_id
- str
The ID of the database.
- creation_date
- datetime
The creation date of the database (ISO8601 format).
- current_service_objective_name
- str
The current service level objective name of the database.
- requested_service_objective_name
- str
The requested service level objective name of the database.
- default_secondary_location
- str
The default secondary region for this database.
- failover_group_id
- str
Failover Group resource identifier that this database belongs to.
- max_log_size_bytes
- <xref:long>
The max log size for this database.
- earliest_restore_date
- datetime
This records the earliest start date and time that restore is available for this database (ISO8601 format).
- current_sku
- Sku
The name and tier of the SKU.
- current_backup_storage_redundancy
- str or CurrentBackupStorageRedundancy
The storage account type used to store backups for this database. Possible values include: "Geo", "Local", "Zone".
- paused_date
- datetime
The date when database was paused by user configuration or action(ISO8601 format). Null if the database is ready.
- resumed_date
- datetime
The date when database was resumed by user action or database login (ISO8601 format). Null if the database is paused.
- is_infra_encryption_enabled
- bool
Infra encryption is enabled for this database.
Feedback
Submit and view feedback for