Set-SPContentDatabase

设置 SharePoint 内容数据库的全局属性。

语法

Set-SPContentDatabase
   [-Identity] <SPContentDatabasePipeBind>
   [-AssignmentCollection <SPAssignmentCollection>]
   [-Confirm]
   [-MaxSiteCount <Int32>]
   [-Status <SPObjectStatus>]
   [-WarningSiteCount <Int32>]
   [-WhatIf]
   [-DatabaseFailoverServer <String>]
   [<CommonParameters>]

说明

Set-SPContentDatabase cmdlet 设置 SharePoint 内容数据库的全局属性。

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅 SharePoint Server cmdlet

示例

---------------示例 1---------------

Get-SPContentDatabase https://contoso.com | Set-SPContentDatabase -MaxSiteCount 1

本示例将包含 contoso.com 的内容数据库的 MaxSiteCount 设置为 1。

---------------示例 2---------------

Get-SPContentDatabase -WebApplication https://sitename | Set-SPContentDatabase -WarningSiteCount $null

本示例清除 Sitename Web 应用程序中所有数据库的 WarningSiteCount。

参数

-Confirm

执行命令前,看到确认提示。 有关详细信息,请键入以下命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-DatabaseFailoverServer

指定用于故障转移的镜像服务器的名称。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Identity

指定要更新的内容数据库。

键入的值必须为有效的 GUID(格式为 12345678-90ab-cdef-1234-567890bcdefgh);SharePoint 内容数据库的有效名称(例如 SPContentDB1);或者有效 SPContentDatabase 对象的实例。

Type:SPContentDatabasePipeBind
Position:1
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-MaxSiteCount

指定此数据库可承载的网站集的最大数量。

键入的值必须为正整数。 设置为 $null 将清空此值。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-Status

指定 SQL Server 数据库的状态。 将此参数设置为 Online 将使数据库可用于承载新网站。 将此参数设置为“已禁用”,使数据库无法托管新站点。

类型必须为以下任一:联机或已禁用

Type:SPObjectStatus
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WarningSiteCount

指定可创建的网站集的数量,超过该数量后将生成警告事件,并且网站集的所有者将收到该事件的通知。

键入的值必须为正整数。 设置为 $null 将清空此值。

Type:Int32
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-WhatIf

显示一条描述命令作用的消息,而不执行命令。 有关详细信息,请键入以下命令:get-help about_commonparameters

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition

-工作分配

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type:SPAssignmentCollection
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server Subscription Edition