A large number of log files are generated during the use of SQL Server databases, especially frequently updated systems. Due to the commercial operation, our databases are backed up. After a while, we can clear the log data. Because most of the time we use virtual hosts, the Space Provider imposes restrictions on the security policy and directs
A large number of log files are generated during the use of SQL Server databases, especially frequently updated systems. Due to the commercial operation, our databases are backed up. After a while, we can clear the log data. Because most of the time we use virtual hosts, the Space Provider imposes restrictions on the security policy and directs
A large number of log files are generated during the use of SQL Server databases, especially frequently updated systems.
Due to the commercial operation, our databases are backed up. After a while, we can clear the log data. Because we are currently using virtual hosts many times, the Space Provider imposes security policy restrictions, resulting in no way to clear our database logs.
The only way is to use the dbower permission to open the query analyzer and use the following SQL statement to clear and contract your database space:
1. Clear logs
Dump transaction [yourdbname] WITH NO_LOG;
2. truncate database logs
Backup log [yourdbname] WITH NO_LOG;
3. shrink the database
Dbcc shrinkdatabase ([yourdbname]);
PS: the order of the preceding SQL statements cannot be disrupted.