在调用Restore-SPSite时指定ContentDatabase

在我的上一篇Blog中,我介绍了如何 实现一个SiteCollection一个ContentDatabase
 
在今天的实践中,我们遇到了一个新问题
 
当调用Create-SC-OwnCDB (自定义函数,参见上一篇Blog)创建SiteCollection时,一个空的SiteCollection被成功创建,并且数据存放在指定的ContentDatabase中,一切按照计划进行。
但是当我调用Restore-SPSite企图用之前的SiteCollection备份覆盖新创建的空SiteCollection时,结果发生了意外:这个备份被恢复到了其他ContentDatabase中。查了一下Restore-SPSite命令的帮助,发现有一个-ContentDatabase参数,参数说明如下:
Specifies the SQL Server content database where the site collection data will be stored. If no content database is specified, the content database with the greatest unused site collection capacity and whose database status is ready will be used.
 
个人认为这种默认设置不合理,我觉得默认应该使用被覆盖的SiteCollection所在的ContentDatabase,而不是当前可用的具有最大SiteCollection可用数量(MaxSiteCount - CurrentSiteCount)的那个ContentDatabase。
 
最后的解决办法是用Move-SPSite将那个SiteCollection移动到我们期望的ContentDatabase中:
Move-SPSite -Identity http://mysharepointsite.com.au/sites/user -destinationdatabase WSS-Content-NewUserDB
 
这个命令提示需要重启IIS,于是在每台FEW服务器中执行IISRESET命令。
 
有谁知道简单的方式实现自动重启所有的FEW中的IIS? 望不吝赐教!





posted @ 2012-02-28 22:14  队长  阅读(488)  评论(0编辑  收藏  举报