Redigera

Dela via


New-AzSqlInstanceDatabase

Creates an Azure SQL Managed Instance database.

Syntax

New-AzSqlInstanceDatabase
   [-Name] <String>
   [-InstanceName] <String>
   [-ResourceGroupName] <String>
   [-Collation <String>]
   [-Tag <Hashtable>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-EnableLedger]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlInstanceDatabase
   [-Name] <String>
   [-Collation <String>]
   [-Tag <Hashtable>]
   [-InstanceObject] <AzureSqlManagedInstanceModel>
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlInstanceDatabase
   [-Name] <String>
   [-Collation <String>]
   [-Tag <Hashtable>]
   [-InstanceResourceId] <String>
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzSqlInstanceDatabase cmdlet creates an Azure SQL Managed instance database.

Examples

Example 1: Create a database on a specified instance

New-AzSqlInstanceDatabase -Name "Database01" -InstanceName "managedInstance1" -ResourceGroupName "ResourceGroup01"

ResourceGroupName        : resourcegroup01
ManagedInstanceName      : managedInstance1
Location                 : westcentralus
Id                       : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resourcegroup01/providers/Microsoft.Sql/managedInstances/managedInstance1/databases/Database01
Name                     : Database01
Tags                     :
Collation                : SQL_Latin1_General_CP1_CI_AS
Status                   : Online
CreationDate             : 4/27/2018 2:30:07 PM
EarliestRestorePoint     : 4/27/2018 2:40:47 PM
RestorePointInTime       :
DefaultSecondaryLocation : West US 2
CatalogCollation         :
CreateMode               :
EnableLedger             : False
StorageContainerUri      :
StorageContainerSasToken :
SourceDatabaseId         :
FailoverGroupId          :

This command creates a instance database named Database01 on instance managedInstance1.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Collation

The collation of the Azure SQL Instance Database collation to use.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableLedger

Creates a ledger database, in which the integrity of all data is protected by the ledger feature. All tables in the ledger database must be ledger tables. Note: the value of this property cannot be changed after the database has been created.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InstanceName

The instance name.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InstanceObject

The instance object

Type:AzureSqlManagedInstanceModel
Aliases:ParentObject
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-InstanceResourceId

The instance resource id

Type:String
Aliases:ParentResourceId
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

The name of the Azure SQL Instance Database to create.

Type:String
Aliases:InstanceDatabaseName
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Tag

The tags to associate with the Azure Sql Instance Database

Type:Hashtable
Aliases:Tags
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureSqlManagedInstanceModel

String

Outputs

AzureSqlManagedDatabaseModel