Mount-NAVTenantDatabase

The shared schema feature is for use in conjunction only with Microsoft hosted offerings in Dynamics 365, is unsupported in Dynamics NAV, and may not be used outside Dynamics 365.

Syntax

Mount-NAVTenantDatabase
     [-ServerInstance] <String>
     [-Id] <TenantDatabaseId>
     [-DatabaseName] <String>
     [-DatabaseServer <String>]
     [-DatabaseCredentials <PSCredential>]
     [-Force]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

Use the Mount-NavTenantDatabase cmdlet to mount a tenant database on the specified Dynamics NAV Server instance. The database must already exist, it can be either an empty database or a valid Dynamics NAV database. Also, the Dynamics NAV Server instance must be configured for multitenancy.

When a database is mounted for the first time on a Dynamics NAV Server instance, the server instance can process requests for data on the tenant database, however, the tenant database is not in the Operational state because it has not been synchronized with the application database on the server instance. This means that you cannot yet create or mount tenants on the tenant database. To synchronize the tenant database and make it operational, use the Sync-NAVTenantDatabase cmdlet. When synchronized successfully, the application version of the application database on the server instance is then registered for support in tenant database.

A tenant database can be mounted on and synchronized with more than one server instance. The application database version of each server instance is registered for support in the tenant database. This enables you to have tenants in the tenant database that are using different application versions. This is useful, for example, when upgrading tenants to a newer application. An existing tenant can be upgraded to a newer application version by mounting it on the server instance that uses the newer application version, and then running a data upgrade.

Examples

---------- EXAMPLE 1 ----------

Mount-NAVTenantDatabase -ServerInstance DynamicsNAV -Id 'Test_Database' -DatabaseName 'Test_Database' -DatabaseServer localhost\NAVDEMO

This example mounts a tenant database 'Test_Database' on the Dynamics NAV Server instance 'DynamicsNAV'. The tenant database is running on the localhost SQL Server instance 'NAVDEMO'.

---------- EXAMPLE 2 ----------

Mount-NAVTenantDatabase DynamicsNAV -Id 'Test_Database' -DatabaseName 'Test_Database' -DatabaseServer localhost\NAVDEMO

This example mounts a tenant database 'Test_Database' on the Dynamics NAV Server instance 'DynamicsNAV'. The tenant database is running on the localhost SQL Server instance 'NAVDEMO'. The example uses positional arguments for the ServerInstance value.

---------- EXAMPLE 3 ----------

Mount-NAVTenantDatabase DynamicsNAV -Id 'Test_Database'-DatabaseName 'Test_Database' -DatabaseServer localhost\NAVDEMO -DatabaseCredentials (Get-Credential)

This example mounts the tenant database 'Test_Database' on the Dynamics NAV Server instance 'DynamicsNAV'. The tenant database is running on the localhost SQL Server instance 'NAVDEMO'. The example configures SQL authentication on the connection to the database with credentials that are obtained from the Get-Credential cmdlet.

---------- EXAMPLE 4 ----------

Get-NAVTenantDatabase -ServerInstance Server1 | Mount-NAVTenantDatabase -ServerInstance Server2

This example gets information about the tenant databases that are mounted on the Dynamics NAV Server instance 'Server1', and then mounts the tenant databases on the server instance 'Server2'. The tenant databases remain mounted on the server instance 'Server1' until you manually dismount them, but this is not required because a tenant database can be mounted on more than one server instance.

Parameters

-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

-DatabaseCredentials

Specifies the user name and password of the login account that the Dynamics NAV Server instance will use to access the tenant database in SQL Server. This parameter configures the Dynamics NAV Server instance to use SQL Server Authentication instead of Windows Authentication on the connection to the database. The login account must be a member of the db_owner role on the database.

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

-DatabaseName

Specifies the name of the SQL Server database, such as MyDatabase, that you want to mount as a tenant database on the Dynamics NAV server instance.

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

-DatabaseServer

Specifies the SQL Server computer name and database instance that hosts the database to mount as a tenant database. You specify the value by using the format ComputerName\SQLServerInstance. The default database instance for Dynamics NAV is NAVDEMO.

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

-Force

Forces the command to run without asking for user confirmation.

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

-Id

Specifies a unique identifier to assign the tenant database, such as MyTenantDatabase. The ID can be a maximum of 127 characters and consist of letters (Aa-Zz), numbers (0-9), or the following special characters: '.', '-', '@', '{', and '}'. It cannot start with '.', '}', or '-'. It cannot end with '{' or '-'. The ID is not case sensitive. You will use the ID to perform other operations on the tenant database, such as running the Sync-NAVTenantDatabase or Mount-NAVTenant cmdlet.

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

-ServerInstance

Specifies the name of a Dynamics NAV Server instance, for example, DynamicsNAV or myinstance. You can specify either the full name of an instance, such as MicrosoftDynamicsNavServer$myinstance or the short name such as myinstance.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
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

System.String

By value and by property name: ServerInstance

Microsoft.Dynamics.Nav.Types.TenantDatabaseId

By property name: Id

System.String

By property name: DatabaseName

System.String

By property name: DatabaseServer