| |

VerySource

 Forgot password?
 Register
Search
View: 2140|Reply: 10

MDF file is too big, how to get smaller

[Copy link]

2

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-1-27 06:00:01
| Show all posts |Read mode
The number of tables is not large and there is not much data, but there are more than 200M
The ldf file is also relatively small, only 2M
The database MDF of the same size as this database is only 2M.

I tried to shrink the database, but it is now minimal [300M before shrinking]
Reply

Use magic Report

0

Threads

93

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 United States

Post time: 2020-2-20 17:00:02
| Show all posts
Shrink the database file (if it is not compressed, the database file will not be reduced
Enterprise Manager--right click on the database you want to compact--all tasks--shrink the database--shrink the file
Select the data file-select shrink to XMM in the shrink mode, here will give a minimum number of M to allow shrinking, enter this number directly, and confirm it
Reply

Use magic Report

0

Threads

93

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 China

Post time: 2020-2-20 18:30:01
| Show all posts
Shrink repeatedly until you can't shrink until you can
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-20 23:00:01
| Show all posts
Shrink it in Enterprise Manager
Reply

Use magic Report

2

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 United States

 Author| Post time: 2020-2-21 02:45:02
| Show all posts
Yes. I have done this already .... There are still 200M.
In theory, it should not be so large: not many tables: 20; not many data: to be precise, there is no data
Reply

Use magic Report

0

Threads

48

Posts

30.00

Credits

Newbie

Rank: 1

Credits
30.00

 China

Post time: 2020-2-21 06:45:01
| Show all posts
Automatic maintenance with a wizard, and then shrink
Reply

Use magic Report

0

Threads

93

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 China

Post time: 2020-2-23 15:45:02
| Show all posts
Is the log file large?
Enterprise Manager--right click on the database you want to compact--all tasks--shrink the database--shrink the file
Select the log file-choose to shrink to XXM in the shrink mode, here will give a minimum number of M to allow shrinking, enter this number directly, and confirm it
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-24 09:00:01
| Show all posts
Export data to create ... insert ... statements
Delete the original database, and then use the exported statements to create database tables and data
That must be small!
Reply

Use magic Report

0

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-2-24 10:00:01
| Show all posts
1, execute dump transaction database name with no_log in Query Analyzer
2. Shrink the database in Enterprise Manager
Reply

Use magic Report

2

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

 Author| Post time: 2020-2-24 11:45:01
| Show all posts
Did not see improvement. I don't know if it's my improper operation or something else.
I'm as small as 232M now, it seems like it can't be any smaller ...

This database is mainly used to add and delete operations during debugging, I do not know if it has anything to do with this.
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