SQL Server database logs are full, how to shrink database logs

xiaoxiao2021-03-06  38

Microsoft OLE DB Provider for SQL Server Error '80040e14'

The database 'Mis1' log is full. Please back up the transaction log of the database to release some log space.

Use a simple method to shrink the log:

1, Backup Log .... with no_log 2, shrink database

OK, synchronous re-perform. . . .

Answer:

Do you check that the database log mode is Full? This pattern is enormous, it is possible to change to simple mode, and then set the database to automatic contraction.

Two methods of SQL Server log clearance are in the process of use, often encountering the status of database logs, here, introduced two processing methods ...

method one

In general, the shrinkage of the SQL database does not greatly reduce the size of the database. Its main role is to shrink the log size, and this will be performed regularly to prevent the database log.

1. Setting the database mode as simple mode: Open SQL Enterprise Manager, click on the Microsoft SQL Server -> SQL Server Group -> Double click to open your server -> Double click to open your database -> Double click to open the Database directory - > Choose your database name (such as the forum database forum) -> then right click to select Properties -> Select Options -> Select "Simple" in the fault reduction mode, then press OK.

2. Right-click on the current database to see the contraction database in all tasks, the default settings in the general settings are not adjusted, and the direct point is determined.

3. After the shrink database is completed, it is recommended to reset your database properties to standard mode, and the operation method is the first point, because the log is often an important basis for restoring the database in some abnormalities.

SQL Server speaks:

Backup log database name with no_log | Truncate_only can truncate the transaction log.

But after I make the above operation in the database, the transaction log has not changed.

The first step is to cut off the non-active transaction log, and there is no contraction database. After the second operation, the database will be cleaned up by the transaction log, and the truncated non-active transaction is deleted, and the transaction log file is shrunk to appropriate size. When using SQL Server, log files in the database are getting bigger and bigger, and you need to delete it. I first separate this database, right-click on the database -> All tasks -> After separating the database, you can delete the log file, and the data can be backed up. After that, you can add that database in all tasks, SQL Server will prompt the log file does not exist, ask you if you want to create a new one, choose it, this, the log file is emptied. This method is just a few minutes, but in these minutes, you can't access this database. I think it is only suitable for small applications. For large systems, you have to find other methods.

转载请注明原文地址:https://www.9cbs.com/read-59588.html

New Post(0)