Install-CsMirrorDatabase

Associates a mirror database with a Skype for Business Server database. A database mirror enables you to simultaneously maintain two copies of a database, each copy residing on a different server. This cmdlet was introduced in Lync Server 2013.

Syntax

Install-CsMirrorDatabase
       [-ConfiguredDatabases]
       -FileShare <String>
       -SqlServerFqdn <Fqdn>
       [-Confirm]
       [-DatabasePathMap <Hashtable>]
       [-DropExistingDatabasesOnMirror]
       [-ExcludeDatabaseList <String[]>]
       [-ForDefaultInstance]
       [-ForInstance <String>]
       [-Report <String>]
       [-WhatIf]
       [<CommonParameters>]
Install-CsMirrorDatabase
       -DatabaseType <DatabaseNameType>
       -FileShare <String>
       -SqlServerFqdn <Fqdn>
       [-Confirm]
       [-DatabasePathMap <Hashtable>]
       [-DropExistingDatabasesOnMirror]
       [-ExcludeDatabaseList <String[]>]
       [-Report <String>]
       [-SqlInstanceName <String>]
       [-WhatIf]
       [<CommonParameters>]

Description

Mirror databases enable you to simultaneously maintain two copies of a database: when data is written to Database A, a copy of that data is also written to its mirror database. This provides the ability to instantly replace Database A should that database become unavailable: you can "failover" to the mirror database with minimal disruption to your users and with minimal data loss. After you have installed your primary databases you can then install and configure mirror databases by using the Install-CsMirrorDatabase cmdlet.

By default, the Install-CsMirrorDatabase cmdlet installs and configures mirror databases for all the Skype for Business Server databases housed on the specified server. However, you can use the DatabaseType or the ExcludeDatabaseList parameters to specify exactly which mirror databases should or should not be installed. DatabaseType enables you to specify only the databases that should be installed; ExcludeDatabaseList lets you specify the databases that should not be installed.

Skype for Business Server Control Panel: The functions carried out by the Install-CsMirrorDatabase cmdlet are not available in the Skype for Business Server Control Panel.

Examples

-------------------------- Example 1 --------------------------

Install-CsMirrorDatabase -ConfiguredDatabases -FileShare "\\atl-fs-001.litware.com\DbBackup" -SqlServerFqdn "atl-primary-001.litwareinc.com" -DropExisitingDatabasesOnMirror

The command shown in Example 1 installs any predefined database. The ConfiguredDatabases parameter causes the Install-CsMirrorDatabase cmdlet to use the current topology to determine which databases should be.

Parameters

-ConfiguredDatabases

Reads information from the Skype for Business Server topology, and installs the required mirror databases on the specified SQL Server computer or SQL Server cluster.

Type:SwitchParameter
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-Confirm

Prompts you for confirmation before executing the command.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-DatabasePathMap

Enables you to specify custom folder paths for data files and log files; multiple paths should be separated by using a semicolon (;). For example:

-DatabasePathMap @{"Archiving:DbPath"="\\\\atl-sql-001.litwareinc.com\db";"Archiving:LogPath"="\\\\atl-sql-002.litwareinc.com\logs"}

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-DatabaseType

Type of mirror database to be installed. Allowed values are:

ActiveMonitoring

Application

Archiving

CentralMgmt

Edge

Lyss

Monitoring

PersistentChat

PersistentChatCompliance

Provision

Registrar

SigninTelemetry

User

Type:DatabaseNameType
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-DropExistingDatabasesOnMirror

When present, deletes any existing copies of the mirrored databases from the server acting as the mirror before new data is copied to that server.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-ExcludeDatabaseList

List of databases that should not be included in the mirror database; multiple databases can be specified by separating those databases using commas. For example:

-ExcludeDatabaseList "RTCCAB","RTCPROV"

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-FileShare

UNC path to the database shared folder. The file share is used to export of databases from the primary SQL Server and import those databases onto the mirror.

The shared folder and its contents can be deleted after mirroring is established. The folder should also be deleted if you decide to disable mirroring.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-ForDefaultInstance

When specified, instructs the Install-CsMirrorDatabase cmdlet to only act against the default SQL Server instance. You cannot use both ForDefaultInstance and ForInstance in the same command.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-ForInstance

When specified, instructs the Install-CsMirrorDatabase cmdlet to only act against the specified SQL Server instance. You cannot use both ForInstance and ForDefaultInstance in the same command.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-Report

Enables you to specify a file path for the log file created when the cmdlet runs. For example:

-Report "C:\Logs\InstallDatabaseMirror.html"

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-SqlInstanceName

Name of the database instance where the database is to be installed. A database instance is simply a set of running processes that provides access to database files. If this parameter is omitted, the Install-CsMirrorDatabase cmdlet will use the default SQL Server instance.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-SqlServerFqdn

Fully qualified domain name (FQDN) of the primary SQL Server computer. For example:

-SqlServerFqdn atl-sql-001.litwareinc.com

Type:Fqdn
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019

Inputs

None. The Install-CsMirrorDatabase cmdlet does not accept pipelined input.

Outputs

None.