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

SharePoint 数据库管理-PowerShell的更多相关文章

  1. 【SharePoint学习笔记】第2章 SharePoint Windows PowerShell 指南

    快速了解Windows PowerShell     从SharePoint 2010开始支持PowerShell,仍支持stsadm.exe工具:     可以调用.NET对象.COM对象.exe文 ...

  2. SharePoint 2010 最佳实践学习总结------第2章 SharePoint Windows PowerShell指南

    第2章 SharePoint Windows PowerShell指南 SharePoint 2010是SharePoint系列产品中第一个开始支持Windows PowerShell的产品,在以前的 ...

  3. 数据库管理——Powershell——使用Powershell脚本找出消耗最多磁盘空间的文件

    原文:数据库管理--Powershell--使用Powershell脚本找出消耗最多磁盘空间的文件 原文译自: http://www.mssqltips.com/sqlservertip/2774/p ...

  4. SharePoint 2013 PowerShell命令备份还原报错

    错误截图: 文字描述: Restore-SPSite : <nativehr>0x80070003</nativehr><nativestack></nati ...

  5. SharePoint 使用PowerShell恢复误删的网站集

    在SharePoint网站集的使用中,我们很有可能会误删我们需要的网站集,SharePoint其实并没有把网站集删掉,只是放到了SPDeletedSite中,这样,我们还可以通过PowerShell找 ...

  6. SharePoint 2010 PowerShell 系列 之 备份、还原、部署 .WSP

    转:http://www.cnblogs.com/Fengger/archive/2012/08/24/2654093.html PowerShell系列目录 最近在部署测试环境,就顺便把PowerS ...

  7. SharePoint 配置PowerShell任务计划

    前言 最近,有这么个需求,需要定时为SharePoint更新内容,所以,就想到了PowerShell命令和任务计划(Windows自带的功能,英文叫Task Schedule,在开始菜单里就能找到), ...

  8. [转]SharePoint 2010 Powershell Feature Cmdlets

    In this installment its time to look at the various cmdlets that have to do with Features. Of course ...

  9. sharepoint 2010 powershell

    可参看云总的博客:http://blog.csdn.net/yun_liang1028/article/details/6419729

随机推荐

  1. 进制转换 hdoj-2031

    进制转换,原题目:hdoj-2031 题目描述: 输入两个整数,十进制数n(32位整数)和进制r(2<=r<=16 r!=10),求转换后的数. 输入: 7 2 23 12 -4 3 输出 ...

  2. hdu 5144 NPY and shot 物理+三分

    NPY and shot Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Pro ...

  3. 使用docker安装myql/redis等软件

    使用docker安装myql/redis等软件 概述 基本命令 安装mysql 安装redis 概述 在开发时经常需要安装各种软件,有时甚至为了验证一个命令不得不安装配置一个缓存.数据库.MQ等,耽误 ...

  4. net网站发布-允许更新此预编译站点 及修改发布后内容

    我们可以通过如下的方法发布VS2010的网站: “生成”→“发布网站”:弹出对话框! 在打开的对话框中,有一个选项是至关重要的,那就是“允许更新此预编译站点”: “允许更新此预编译站点”这一项,默认情 ...

  5. Python day13文件的读写

    # 文件操作 f=open("E:\\1.txt",encoding="GBK")#打开文件 print(f.writable())#是否可写 print(f. ...

  6. MongoDB(课时15 数据排序)

    3.4.2.10 数据排序 在MongoDB里数据排序操作使用“sort()”函数,在进行排序的时候可以有两个顺序:升序(1),降序(-1). 范例:排序 db.students.find().sor ...

  7. 使用R内置函数操作数据框

    我们已经学习了数据框的基础,这里回顾一下用于筛选数据框的内置函数.尽管数据框本质上是一个由向量构成的列表,由于各列长度相同,所以可以将其看作矩阵进行访问和操作.选择满足特定条件的行,需要为 [ ] 的 ...

  8. Use a layout_width of 0dip instead of fill_parent for better performance

    安装了最新的ATD 18之后,新加的Lint Warnings插件会给我们检测出许多xml布局中不当的地方,例如: Use a layout_width of 0dip instead of fill ...

  9. Spring AMQP 源码分析 04 - MessageListener

    ### 准备 ## 目标 了解 Spring AMQP 如何实现异步消息投递(推模式) ## 前置知识 <RabbitMQ入门_05_多线程消费同一队列> ## 相关资源 Quick To ...

  10. English trip -- VC(情景课)4 A Health

    Word doctor doctor's office medicine   [ˈmɛdɪsɪn]  n. 药:医学:内科:巫术  vt. 用药物治疗:给…用药 pill  n. 药丸 nurse   ...