Upgrade-SPContentDatabase

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

语法

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

说明

This cmdlet contains more than one parameter set. You may only use parameters from one parameter set and you may not combine parameters from different parameter sets. For more information about how to use parameter sets, see Cmdlet Parameter Sets.

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

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

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

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

示例

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

Upgrade-SPContentDatabase WSS_Content

This example upgrades the existing WSS_Content content database schema and then performs only build-to-build upgrade actions on existing site collections if required. This operation does not changed the CompatibilityLevel for existing site collections in this database.

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

Upgrade-SPContentDatabase WSS_Content -NoB2BSiteUpgrade

This example upgrades the existing WSS_Content content database schema only. No build-to-build upgrade actions are performed on any site collections. This operation does not change The CompatibilityLevel for existing site collections in this database.

--------------------------示例 3------------------------------

Upgrade-SPContentDatabase WSS_Content -NoB2BSiteUpgrade -UseSnapshot

This example upgrades the existing WSS_Content content database schema only while using a snapshot of the database to retain read-only access to the content during the upgrade. No build-to-build upgrade actions are performed on any site collections. This operation does not change the CompatibilityLevel for existing site collections in this database.

参数

-AllowUnattached

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

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

-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

-ForceDeleteLock

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

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

-Identity

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

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

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

-NoB2BSiteUpgrade

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

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

-ServerInstance

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

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

-SkipIntegrityChecks

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

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

-SkipSiteUpgrade

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

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

-UseSnapshot

指定使用快照方法来执行非附加升级。 这会创建当前数据库的快照,然后执行应用于数据库的所有升级操作,并选择性地执行其内容。

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

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

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

-WebApplication

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

Type:SPWebApplicationPipeBind
Position:Named
Default value:None
Accept pipeline input:False
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

-名称

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

Type:String
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