Upgrade-SPContentDatabase

恢复失败的数据库升级或开始内部版本间数据库升级。

语法

ContentDatabaseById

Upgrade-SPContentDatabase
    [-Identity] <SPContentDatabasePipeBind>
    [-ForceDeleteLock]
    [-AssignmentCollection <SPAssignmentCollection>]
    [-Confirm]
    [-NoB2BSiteUpgrade]
    [-ServerInstance <SPDatabaseServiceInstancePipeBind>]
    [-SkipIntegrityChecks]
    [-UseSnapshot]
    [-WhatIf]
    [-AllowUnattached]
    [-SkipSiteUpgrade]
    [<CommonParameters>]

ContentDatabaseByName

Upgrade-SPContentDatabase
    -Name <String>
    -WebApplication <SPWebApplicationPipeBind>
    [-ForceDeleteLock]
    [-AssignmentCollection <SPAssignmentCollection>]
    [-Confirm]
    [-NoB2BSiteUpgrade]
    [-ServerInstance <SPDatabaseServiceInstancePipeBind>]
    [-SkipIntegrityChecks]
    [-UseSnapshot]
    [-WhatIf]
    [-AllowUnattached]
    [-SkipSiteUpgrade]
    [<CommonParameters>]

说明

此 cmdlet 包含多个参数集。 只能使用一个参数集中的参数,而不能结合使用不同参数集中的参数。 有关如何使用参数集的详细信息,请参阅 Cmdlet 参数集

Upgrade-SPContentDatabase使用 cmdlet 恢复失败的数据库升级,或针对 SharePoint 内容数据库开始生成到生成数据库升级。 cmdlet Upgrade-SPContentDatabase 启动附加到当前场的现有内容数据库的升级。 此 cmdlet 将开始一个新的升级会话,此会话可用于恢复失败的版本间或内部版本间内容数据库升级,也可以开始内容数据库的内部版本间升级。

如果数据库托管在支持创建和使用数据库快照的 SQL Server 版本上,则此 cmdlet 可以使用数据库快照进行内部版本升级。 在升级期间,用户会看到该数据库的只读版本,即快照。 升级后,用户可看到升级后的内容。

此 cmdlet 的默认行为会升级数据库的架构,并启动指定内容数据库中的所有网站集的内部版本间升级(如果需要)。 若要防止网站集的内部版本到内部版本升级,请使用 NoB2BSiteUpgrade 参数。

此 cmdlet 不会触发任何网站集的版本间升级。

示例

示例 1

Upgrade-SPContentDatabase WSS_Content

此示例升级现有 WSS_Content 内容数据库架构,然后在现有网站集上执行仅内部版本间升级操作(如果需要)。 此操作不更改此数据库中的现有网站集的 CompatibilityLevel。

示例 2

Upgrade-SPContentDatabase WSS_Content -NoB2BSiteUpgrade

此示例仅升级现有 WSS_Content 内容数据库架构。 不对任何网站集执行内部版本间升级操作。 此操作不更改此数据库中的现有网站集的 CompatibilityLevel。

示例 3

Upgrade-SPContentDatabase WSS_Content -NoB2BSiteUpgrade -UseSnapshot

此示例仅升级现有 WSS_Content 内容数据库架构,同时在升级期间使用数据库快照保留对内容的只读访问。 不对任何网站集执行内部版本间升级操作。 此操作不更改此数据库中的现有网站集的 CompatibilityLevel。

参数

-AllowUnattached

适用:SharePoint Server 2016,SharePoint Server 2019

使升级过程在当前未连接到 SharePoint 场的内容数据库上继续进行。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AssignmentCollection

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。

使用全局参数时,所有对象均包含在全局存储中。 如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。

参数属性

类型:SPAssignmentCollection
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Confirm

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

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

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ForceDeleteLock

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

在开始升级之前强制删除对数据库的锁定。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:2
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Identity

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定要升级的内容数据库。

键入的值必须为 12345678-90ab-cdef-1234-567890bcdefgh 形式的有效 GUID 或有效 SPContentDatabase 对象的实例。

参数属性

类型:SPContentDatabasePipeBind
默认值:None
支持通配符:False
不显示:False

参数集

ContentDatabaseById
Position:1
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Name

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定附加的内容数据库的名称。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

ContentDatabaseByName
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-NoB2BSiteUpgrade

适用:SharePoint Server 2010、SharePoint Server 2013

指定在执行内部版本间升级时,不升级所有子对象。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ServerInstance

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

承载附加的内容数据库的 SQL Server 实例。

参数属性

类型:SPDatabaseServiceInstancePipeBind
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-SkipIntegrityChecks

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定升级过程,在升级过程中不运行内部完整性检查,例如缺少模板和孤立检测。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-SkipSiteUpgrade

适用:SharePoint Server 2016,SharePoint Server 2019

指定在执行升级时不升级数据库及其子对象。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:NoB2BSiteUpgrade

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-UseSnapshot

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定使用快照方法来执行非附加升级。 这将快照当前数据库,然后执行所有适用于数据库及其内容的升级作。

与内容数据库的现有连接将设置为在升级期间使用 快照,然后在成功完成升级后切换回来。 失败的升级会将数据库恢复为拍摄快照时的状态。

此参数仅适用于支持创建和使用快照的 SQL Server 版本,例如 SQL ServerEnterprise 版本。

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WebApplication

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

指定承载附加的内容数据库的 Web 应用程序。

参数属性

类型:SPWebApplicationPipeBind
默认值:None
支持通配符:False
不显示:False

参数集

ContentDatabaseByName
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

适用:SharePoint Server 2010、SharePoint Server 2013、SharePoint Server 2016 SharePoint Server 2019

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

参数属性

类型:SwitchParameter
默认值:None
支持通配符:False
不显示:False
别名:无线

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters