SharePoint 数据库管理-PowerShell

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
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值