| |

VerySource

 Forgot password?
 Register
Search
View: 1306|Reply: 8

SQL-Server database file size problem

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-9 11:30:02
| Show all posts |Read mode
I have a database running for six months now
The database file reaches 17G
There are only more than 400,000 records in the largest table

Only a few tables have more than 100,000 data

What is the problem causing my database to become so big?
Reply

Use magic Report

0

Threads

114

Posts

69.00

Credits

Newbie

Rank: 1

Credits
69.00

 China

Post time: 2020-4-2 14:30:02
| Show all posts
Log file
LZ can compress logs or delete logs after making multiple copies
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-4-8 20:00:01
| Show all posts
Not a log file. The size of the data file (TEST_Data.MDF) reaches 17G
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-4-9 17:45:02
| Show all posts
Are there text, ntext, image type fields?
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-4-13 18:15:02
| Show all posts
Have,
With these fields
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-5 11:00:01
| Show all posts
I also want to know why, because I have encountered similar problems. A record is 144Byte, and a maximum of 500,000 records are generated per month. How can a data file of more than 10 gigabytes be generated in a year? The log file is limited in size, 100M, and all should have nothing to do with the log file.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-8-6 13:45:01
| Show all posts
A large number of inserted data and updated records will cause the database to grow larger and larger. It is recommended to maintain the index regularly. If it is too busy, you can shrink the database regularly.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-6 14:45:01
| Show all posts
It may be that the index is not maintained well, but it is still strange. My database has almost 1 million records, and none of them exceeds 2G. Does your record have a huge amount of data? Or someone maliciously attacked on the Internet, for each record Injected a huge amount of data?
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-6 15:00:01
| Show all posts
Theoretical feasible suggestions:

Execute backup log database with no_log first
Then dbcc shrinkdatabase (database)

Please be cautious in actual operation. Log information will be truncated and execution is slow.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list