【转】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:
| Features | Table that holds information about all the activated features for each site collection or site. |
| Sites | Table that holds information about all the site collections for this content database. |
| Webs | Table that holds information about all the specific sites (webs) in each site collection. |
| UserInfo | Table that holds information about all the users for each site collection. |
| Groups | Table that holds information about all the SharePoint groups in each site collection. |
| Roles | Table that holds information about all the SharePoint roles (permission levels) for each site. |
| All Lists | Table that holds information about lists for each site. |
| GroupMembership | Table that holds information about all the SharePoint group members. |
| AllUserData | Table that holds information about all the list items for each list. |
| AllDocs | Table that holds information about all the documents (and all list items) for each document library and list. |
| RoleAssignment | Table that holds information about all the users or SharePoint groups that are assigned to roles. |
| Sched Subscriptions | Table that holds information about all the scheduled subscriptions (alerts) for each user. |
| ImmedSubscriptions | Table that holds information about all the immediate subscriptions (alerts) for each user. |
?
另外再配上了一個圖,說明其中的關系。
?
其中最最重要的就是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,一個一個的分析如何查詢對應的表。
總結
以上是生活随笔為你收集整理的【转】SharePoint Content Database简介的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 人民币升值加速!为什么进入下半年后,人民
- 下一篇: 映射网络驱动器后为什么每次都要重新连接_