SharePoint 数据库管理-PowerShell

简介: 1. 显示所有SharePoint数据库 Get-SPDatabase –ServerInstance "SP2010\SQLSharePoint" 2.

1. 显示所有SharePoint数据库

Get-SPDatabase –ServerInstance "SP2010\SQLSharePoint"

2. 获取指定的数据库

$database = Get-SPDatabase
-Identity 47036154-7a05-44be-9137-9be09f43ccb5

3. 创建一个新的内容数据库

New-SPContentDatabase –Name NewContentDB –WebApplication "PSWebApp"

4. 显示一个Web应用程序下所有的数据库

Get-SPContentDatabase –WebApplication "PSWebApp"

5. 从一个Web应用程序移除一个数据库

$database = Get-SPContentDatabase
-Identity 025b1239-cd62-451e-943d-dff2e0d52ec8
Dismount-SPContentDatabase $database

6. 附加一个数据库到Web应用程序

Mount-SPContentDatabase –Name "NewContentDB"
–WebApplication "PSWebApp"

7. 删除一个内容数据库

$database = Get-SPContentDatabase
-Identity 025b1239-cd62-451e-943d-dff2e0d52ec8
Remove-SPContentDatabase $database

8. 创建配置数据库

New-SPConfigurationDatabase –DatabaseName NewConfigurationDB
–DatabaseServer "SP2010\SQLSharePoint"

9. 删除配置数据库

Remove-SPConfigurationDatabase

10. 备份配置数据库

Backup-SPConfigurationDatabase –Directory F:\Backups

Backup-SPFarm –BackupMethod Full –Directory F:\Backups
-ConfigurationOnly

Full为完全备份,也可以使用Differential增量备份

11. 恢复配置数据库

Restore-SPFarm –Directory F:\Backups –ConfigurationOnly
–RestoreMethod Overwrite

12. 备份SharePoint场

Backup-SPFarm –BackupMethod Full –Directory F:\Backups

使用-ShowTree参数显示场中所有可备份的项目;使用-Item参数备份指定的项目

13. 恢复SharePoint场

Restore-SPFarm –Directory F:\Backups –RestoreMethod Overwrite

使用-Item参数恢复指定的项目

14. 备份网站集

Backup-SPSite –Identity "http://sp2010/sites/BICenter"
–Path F:\Backups\BICenter.bak

15. 还原网站集

Restore-SPSite –Identity "http://sp2010/sites/BICenter"
–Path F:\Backups\BICenter.bak –Force
相关文章
|
弹性计算 关系型数据库 数据库
使用ROS部署ECS+SqlServer资源并通过PowerShell操作数据库
本文介绍如何通过ROS部署ECS+RDS+SqlServer资源,以及如何通过PowerShell操作SqlServer数据库。 注意:附录模板和截图中的commandtext部分仅为演示作用,请根据需求修改后使用。
114 0
使用ROS部署ECS+SqlServer资源并通过PowerShell操作数据库
|
搜索推荐
SharePoint Foundation 搜索-PowerShell
1. 显示搜索服务信息 Get-SPSearchService 2. 显示搜索服务实例 Get-SPSearchServiceInstance 3.
637 0
|
数据库 数据格式 XML
SharePoint BDC(Business Data Connectivity)服务-PowerShell
1. 获取BCS服务应用程序的标识 Get-SPServiceApplication 2. 获取指定的BCS服务应用程序实例 $bcs = Get-SPServiceApplication -Identity b7b3652e-6f51-4161-935a-0631a1100ecf 3.
970 0
|
数据库连接 网络安全 数据安全/隐私保护
SharePoint Infopath表单服务-PowerShell
1. 激活可浏览的表单模板 Set-SPInfoPathFormsService -AllowUserFormBrowserEnabling $true -AllowUserFormBrowserRendering $true 2.
725 0
|
搜索推荐
SharePoint 企业搜索-PowerShell
1. 显示企业搜索服务信息 Get-SPEnterpriseSear1chService 2. 显示企业搜索服务实例 Get-SPEnterpriseSearchServiceInstance 3.
747 0