SQL Server database prompt for "tempdb" log full problem solution _mssql

Source: Internet
Author: User

Execute SQL statement with no temporary table in the middle

Prompt server: Message 9002, Level 17, State 2, row 1
database ' tempdb ' logs are full. Please back up the transaction log of the database to free up some log space.

On the Internet to find a solution, is to expand the temporary library of the size of the log file to solve

Resolution process:
View the properties of the following database, which is automatically growing without specifying a maximum file size.
Google on the internet for a long time, tried some methods are not; The database contains a lot of free space on the disk and try to get the heavy medicine down.
Change the size of tempdb's data file and log file directly to 3000M,
Solve the problem.

Record the command to empty the log:

DUMP TRANSACTION dbname with no_log

Truncate the transaction log command:

BACKUP LOG dbname with no_log

Shrink Log Action:
Right-click Database-Properties-All Tasks-Shrink database-file-select File-ok.

Although the log for tempdb was emptied with the empty log command, the problem was not resolved. This expands the size of the data files and log files in tempdb,

ALTER DATABASE [tempdb] MODIFY file (name = N ' Templog ', MAXSIZE = unlimited)
ALTER DATABASE [tempdb] MODIFY file (name = N ' templog ', filegrowth = 10%)
alter DATABASE [tempdb] MODIFY FILE (NAME = n ' templog ', SIZE = 1000)
alter Datab ASE [tempdb] MODIFY FILE (NAME = N ' tempdev ', SIZE = 1000)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.