星外主机系统减少主控数据库的大小
以下SQL命令可以在主控数据库的企业管理器中运行,清除2011-1-1前的日志,在线问答,并收缩SQL
delete FreeHost.FreeHost_Loginlog where logintime<'2011-1-1'
delete FreeHost.FreeHost_oplog where logintime<'2011-1-1'
USE freehost BACKUP LOG freehost with NO_LOG;DBCC SHRINKDATABASE (freehost)
update FreeHost.FreeHost_USER set usernotice=null where lastnotice<'2011-1-1'
delete FreeHost.FreeHost_Netpay where paytime<'2011-1-1'
delete FreeHost.FreeHost_online_aws where posttime<'2011-1-1'
对于SQL2008以上的库,上面的第三行要改成:
USE [master] ALTER DATABASE FreeHost SET RECOVERY SIMPLE WITH NO_WAIT;ALTER DATABASE FreeHost SET RECOVERY SIMPLE;USE FreeHost DBCC SHRINKFILE ([FreeHost_Log] , 11, TRUNCATEONLY);USE [master] ALTER DATABASE FreeHost SET RECOVERY FULL WITH NO_WAIT;ALTER DATABASE FreeHost SET RECOVERY FULL;
注意要先停止IIS才能做。
对于ISP备案系统用户,在确保所有XML已上传的情况下,还可以运行以下命令减少库大小:
USE freehost
delete FreeHost.FreeHost_Beian_oplog
delete FreeHost.FreeHost_Beian_UP_History
delete FreeHost.FreeHost_Beian_Wz_xx_History
delete FreeHost.FreeHost_Beian_Ym_xx_History
delete FreeHost.FreeHost_Beian_Jr_xx_History
delete FreeHost.FreeHost_Beian_UP_ALLXML
delete FreeHost.FreeHost_Beian_UP_ALLXML_backup
delete FreeHost.FreeHost_Beian_logback
BACKUP LOG freehost with NO_LOG;DBCC SHRINKDATABASE (freehost)
注意运行前要先停止主控网站,重启下SQL先。
相关文章
发表评论
评论列表
- 这篇文章还没有收到评论,赶紧来抢沙发吧~