Skip to main content

database_migrations_sql_dbs

Creates, updates, deletes, gets or lists a database_migrations_sql_dbs resource.

Overview

Namedatabase_migrations_sql_dbs
TypeResource
Idazure.data_migration.database_migrations_sql_dbs

Fields

The following fields are returned by SELECT queries:

Successfully retrieved the Database Migration resource.

NameDatatypeDescription
idstring
namestring
propertiesobjectDatabase Migration Resource properties for SQL database. (x-ms-discriminator-value: SqlDb)
systemDataobjectMetadata pertaining to creation and last modification of the resource.
typestring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, sqlDbInstanceName, targetDbName, subscriptionIdmigrationOperationId, $expandRetrieve the Database Migration resource.
create_or_updateinsertresourceGroupName, sqlDbInstanceName, targetDbName, subscriptionIdCreate or Update Database Migration resource.
deletedeleteresourceGroupName, sqlDbInstanceName, targetDbName, subscriptionIdforceDelete Database Migration resource.
cancelexecresourceGroupName, sqlDbInstanceName, targetDbName, subscriptionIdStop on going migration for the database.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
resourceGroupNamestringName of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
sqlDbInstanceNamestring
subscriptionIdstringSubscription ID that identifies an Azure subscription.
targetDbNamestringThe name of the target database.
$expandstringComplete migration details be included in the response.
forcebooleanOptional force delete boolean. If this is provided as true, migration will be deleted even if active.
migrationOperationIdstring (uuid)Optional migration operation ID. If this is provided, then details of migration operation for that ID are retrieved. If not provided (default), then details related to most recent or current operation are retrieved.

SELECT examples

Retrieve the Database Migration resource.

SELECT
id,
name,
properties,
systemData,
type
FROM azure.data_migration.database_migrations_sql_dbs
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND sqlDbInstanceName = '{{ sqlDbInstanceName }}' -- required
AND targetDbName = '{{ targetDbName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND migrationOperationId = '{{ migrationOperationId }}'
AND $expand = '{{ $expand }}'
;

INSERT examples

Create or Update Database Migration resource.

INSERT INTO azure.data_migration.database_migrations_sql_dbs (
data__properties,
resourceGroupName,
sqlDbInstanceName,
targetDbName,
subscriptionId
)
SELECT
'{{ properties }}',
'{{ resourceGroupName }}',
'{{ sqlDbInstanceName }}',
'{{ targetDbName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
properties,
systemData,
type
;

DELETE examples

Delete Database Migration resource.

DELETE FROM azure.data_migration.database_migrations_sql_dbs
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND sqlDbInstanceName = '{{ sqlDbInstanceName }}' --required
AND targetDbName = '{{ targetDbName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
AND force = '{{ force }}'
;

Lifecycle Methods

Stop on going migration for the database.

EXEC azure.data_migration.database_migrations_sql_dbs.cancel 
@resourceGroupName='{{ resourceGroupName }}' --required,
@sqlDbInstanceName='{{ sqlDbInstanceName }}' --required,
@targetDbName='{{ targetDbName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"migrationOperationId": "{{ migrationOperationId }}"
}'
;