<a></a>
<b>閱讀目錄</b>
<a href="http://www.cnblogs.com/OceanEyes/p/sharepoint-2013-migrate-db.html#_label0">PowerShell檢視内容資料庫大小</a>
<a href="http://www.cnblogs.com/OceanEyes/p/sharepoint-2013-migrate-db.html#_label1">遷移内容資料庫</a>
<a href="http://www.cnblogs.com/OceanEyes/p/sharepoint-2013-migrate-db.html#_label2">總結</a>
安裝和配置SharePoint Farm時,一定要注意将内容資料庫不要放在C槽,除非你的C槽能足夠承受起日益增長的資料。由于在安裝SQL SERVER中沒有注意,我将資料庫存放在預設的 C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA檔案夾中。這時不幸的事情發生了,内容資料庫增長過快直到将C槽撐暴,導緻SharePoint Server發生意外故障。 是以,遷移内容資料庫勢在必行了。
Add-PSSnapin Microsoft.SharePoint.PowerShell
Get-SPWebApplication | %{Write-Output "`n -$($_.Url)";foreach($cd in $_.ContentDatabases){
$ContentDatabaseSize = [Math]::Round(($cd.disksizerequired/1GB),2)
Write-Output "ContentName:$($cd.Name) `n Size:$($ContentDatabaseSize)G"
}}

登陸DB Server,打開SQL SERVER檢視資料庫所在的實體存儲位址,發現内容資料庫WSS_Content_Extra_ForCro存儲在C槽,WSS_Content_GCP已經被我遷移到D盤(因為這已經不是第一次因為内容資料庫過大撐暴C槽而當機了)。
登陸到SharePoint Server,打開IIS停止SharePoint WebApplication:
在運作輸入框輸入Services.msc,停止以下SharePoint Services:
登陸DB Server,停止與SharePoint Server關聯的Database執行個體:
定位到内容資料庫存儲的實體位址,将其遷移至其他磁盤。拷貝成功後,啟動資料庫執行個體,删除舊的内容資料庫:
删除之後,再附加轉移好的新的内容資料庫:
登陸SharePoint Server,再将SharePoint WebApplication啟動,并且将上述停用的SharePoint Services也一并啟用。
最後進入SharePoint背景管理中心,檢視内容資料庫是否正常工作:
連續掉了2次坑了,切忌切忌啊。
本文轉自木宛城主部落格園部落格,原文連結:http://www.cnblogs.com/OceanEyes/p/sharepoint-2013-migrate-db.html,如需轉載請自行聯系原作者