Home > Database > Mysql Tutorial > SqlServer清除日志并收缩数据库

SqlServer清除日志并收缩数据库

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:33:29
Original
1018 people have browsed it

在sqlserver 数据库的使用过程中,特别是频繁更新的系统中,会产生大量的日志文件。 由于商业化的运作,我们的数据库都是有备份的,在隔一段时间之后,我们就可以把日志数据清除掉。由于现在很多时候我们使用的都是虚拟主机,空间商在安全策略上做了限制,导

在sqlserver 数据库的使用过程中,特别是频繁更新的系统中,会产生大量的日志文件。

由于商业化的运作,我们的数据库都是有备份的,在隔一段时间之后,我们就可以把日志数据清除掉。由于现在很多时候我们使用的都是虚拟主机,空间商在安全策略上做了限制,导致没有办法清除我们的数据库日志。

唯一的办法就是利用dbower的权限打开查询分析器,使用如下的Sql语句就可以清空并收缩你的数据库空间了:

1.清空日志
             DUMP TRANSACTION   [yourdbname]   WITH   NO_LOG;
       2.截断数据库日志
            BACKUP LOG [yourdbname]WITH NO_LOG;
       3.收缩数据库
              DBCC SHRINKDATABASE([yourdbname]);

PS:以上Sql语句的顺序不能打乱

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Problem with tp6 connecting to sqlserver database
From 1970-01-01 08:00:00
0
0
0
Unable to connect to SQL Server in Laravel
From 1970-01-01 08:00:00
0
0
0
Methods of parsing MYD, MYI, and FRM files
From 1970-01-01 08:00:00
0
0
0
SQLSTATE: User login failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template