SharePoint Content Database简介

SharePoint作为微软主打的企业Portal平台,功能强大,使用简单,非常的方便。对于很多关系数据,我们可以使用自定义列表来维护,如果是非关系数据,可以使用文档库来维护。另外还可以在上面进行版本维护,工作流审批,而这一切可以不用写一行代码,只需要在界面和SharePoint Designer中进行设置即可完成。

虽然SharePoint很简单,很容易上手,但是对于开发人员来说,维护在其中的数据又怎么和其他系统进行集成呢,我们可以使用3种方法:

  • 在SharePoint Server使用C#程序,调用SharePoint对象模型,读取其中的各种数据。
  • 在客户端调用SharePoint的WebService,读取其中的数据。
  • 直连SQL Server SharePoint Content数据库,使用SQL来读取其中的数据。

前面两种方法,都是官方推荐的,文档详细,介绍较多,我就不讲了,我接下来主要研究如何直接读取SharePoint Content DB的数据。微软官方肯定是不推荐使用这种方法的,因为这个太底层了,完全脱离了SharePoint的控制,如果对其中数据进行直接的修改,那么可能会产生SharePoint无法预期的数据值。不过做数据库应用开发的都明白,这种方法执行效率最高,灵活性最大。为了避免写入无法预期的数据导致SharePoint崩溃,所以我们只是读取SharePoint Content DB,不做任何Update和Delete操作。要读取SharePoint Content DB的数据,首先要对其表结构做给基本的了解。

从网上(http://blogs.technet.com/b/praveenh/archive/2010/12/20/inside-a-sharepoint-content-db.aspx)找的一个简介的表格,介绍了主要的几个SharePoint Content DB Table:

FeaturesTable that holds information about all the activated features for each site collection or site.
SitesTable that holds information about all the site collections for this content database.
WebsTable that holds information about all the specific sites (webs) in each site collection.
UserInfoTable that holds information about all the users for each site collection.
GroupsTable that holds information about all the SharePoint groups in each site collection.
RolesTable that holds information about all the SharePoint roles (permission levels) for each site.
All ListsTable that holds information about lists for each site.
GroupMembershipTable that holds information about all the SharePoint group members.
AllUserDataTable that holds information about all the list items for each list.
AllDocsTable that holds information about all the documents (and all list items) for each document library and list.
RoleAssignmentTable that holds information about all the users or SharePoint groups that are assigned to roles.
Sched SubscriptionsTable that holds information about all the scheduled subscriptions (alerts) for each user.
ImmedSubscriptionsTable that holds information about all the immediate subscriptions (alerts) for each user.
 

另外再配上了一个图,说明其中的关系。

SharePointContentDatabaseModel

其中最最重要的就是AllUserData这个表,我们可以从微软MSDN找的一些对几个核心表的介绍:

http://msdn.microsoft.com/en-us/library/hh625524(v=office.12).aspx

这个文档介绍的是最新的SharePoint2013的数据库结构,如果使用SharePoint2010或者07也不用担心,大部分字段都是一样的。如果SharePoint2003,还可以参考官方的另一个文档:

http://msdn.microsoft.com/en-us/library/dd587562(v=office.11).aspx

当然,仅仅有这么几个表还不够,在实际使用中,我们还需要关联其他的表进行联合查询,才能完成我们想要的东西。接下来我会写几个Case,一个一个的分析如何查询对应的表。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值