【转】SharePoint Content Database简介
?
SharePoint作為微軟主打的企業(yè)Portal平臺,功能強(qiáng)大,使用簡單,非常的方便。對于很多關(guān)系數(shù)據(jù),我們可以使用自定義列表來維護(hù),如果是非關(guān)系數(shù)據(jù),可以使用文檔庫來維護(hù)。另外還可以在上面進(jìn)行版本維護(hù),工作流審批,而這一切可以不用寫一行代碼,只需要在界面和SharePoint Designer中進(jìn)行設(shè)置即可完成。
雖然SharePoint很簡單,很容易上手,但是對于開發(fā)人員來說,維護(hù)在其中的數(shù)據(jù)又怎么和其他系統(tǒng)進(jìn)行集成呢,我們可以使用3種方法:
- 在SharePoint Server使用C#程序,調(diào)用SharePoint對象模型,讀取其中的各種數(shù)據(jù)。
- 在客戶端調(diào)用SharePoint的WebService,讀取其中的數(shù)據(jù)。
- 直連SQL Server SharePoint Content數(shù)據(jù)庫,使用SQL來讀取其中的數(shù)據(jù)。
前面兩種方法,都是官方推薦的,文檔詳細(xì),介紹較多,我就不講了,我接下來主要研究如何直接讀取SharePoint Content DB的數(shù)據(jù)。微軟官方肯定是不推薦使用這種方法的,因?yàn)檫@個太底層了,完全脫離了SharePoint的控制,如果對其中數(shù)據(jù)進(jìn)行直接的修改,那么可能會產(chǎn)生SharePoint無法預(yù)期的數(shù)據(jù)值。不過做數(shù)據(jù)庫應(yīng)用開發(fā)的都明白,這種方法執(zhí)行效率最高,靈活性最大。為了避免寫入無法預(yù)期的數(shù)據(jù)導(dǎo)致SharePoint崩潰,所以我們只是讀取SharePoint Content DB,不做任何Update和Delete操作。要讀取SharePoint Content DB的數(shù)據(jù),首先要對其表結(jié)構(gòu)做給基本的了解。
從網(wǎng)上(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. |
?
另外再配上了一個圖,說明其中的關(guān)系。
?
其中最最重要的就是AllUserData這個表,我們可以從微軟MSDN找的一些對幾個核心表的介紹:
http://msdn.microsoft.com/en-us/library/hh625524(v=office.12).aspx
這個文檔介紹的是最新的SharePoint2013的數(shù)據(jù)庫結(jié)構(gòu),如果使用SharePoint2010或者07也不用擔(dān)心,大部分字段都是一樣的。如果SharePoint2003,還可以參考官方的另一個文檔:
http://msdn.microsoft.com/en-us/library/dd587562(v=office.11).aspx
當(dāng)然,僅僅有這么幾個表還不夠,在實(shí)際使用中,我們還需要關(guān)聯(lián)其他的表進(jìn)行聯(lián)合查詢,才能完成我們想要的東西。接下來我會寫幾個Case,一個一個的分析如何查詢對應(yīng)的表。
總結(jié)
以上是生活随笔為你收集整理的【转】SharePoint Content Database简介的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 人民币升值加速!为什么进入下半年后,人民
- 下一篇: 映射网络驱动器后为什么每次都要重新连接_