数据库还原以及日志压缩
exec ('RESTORE FILELISTONLY FROM DISK= ''E:\KCPFrame\KCP_DC20110610.bak''')
use master
restore database kcp_dc from disk = 'E:\KCPFrame\KCP_DC20110610.bak'
with replace,
MOVE N'ePlanetNET' TO N'E:\KCPFrame\kcp_dc.mdf',
MOVE N'ePlanetNET_log' TO N'E:\KCPFrame\kcp_dc_log.ldf'
dump transaction kcp_dc with NO_LOG
BACKUP LOG kcp_dc WITH NO_LOG
DBCC SHRINKDATABASE(kcp_dc)
use master
restore database kcp_dc from disk = 'E:\KCPFrame\KCP_DC20110610.bak'
with replace,
MOVE N'ePlanetNET' TO N'E:\KCPFrame\kcp_dc.mdf',
MOVE N'ePlanetNET_log' TO N'E:\KCPFrame\kcp_dc_log.ldf'
dump transaction kcp_dc with NO_LOG
BACKUP LOG kcp_dc WITH NO_LOG
DBCC SHRINKDATABASE(kcp_dc)