Apr 22 2024 07:22 AM
Hello Community,
Im having a really hard time getting the mssql database file shrinked to minimum available size that SSMS shows in GUI. I really need help and explanation because it's not relevant on any tech forum I found about it.
My issue is that I want to shrink db data file and in GUI, the minimum size of the file is 2314MB.
I apply the shrink - it does nothing. The db file still remains the same and I can repeat the process forever and nothing will happen to file.
Im looking for a good explanation of this behaviour as tried lot of different methods found on the internet and I can't make this shrink to happen.
Best regards, Paweł
Apr 22 2024 10:22 PM
Apr 22 2024 10:25 PM
@Arshad440 Hi, thanks for the reply.
I forgot to mention that my db stays in simple mode recovery from the beginning.
Best regards
Apr 22 2024 10:59 PM
@pmrzyglod , first, why do you want to shrink the database at all? It is very small and shrink will cause index fragmentation and so performance issues.
What does the statement below return?
exec sp_spaceused;
Apr 22 2024 11:16 PM
@olafhelper Hi, thanks for the reply.
This are the results of sp_spaceused;
Answering your question about the shrink. Issue here is that this DB works in express for demo purposes and at the beginning it wasn't a problem as the db was staying at around 4GB. After some time it kept to grow even tho data that was comming through wasn't bigger. So for now It keeps going up to 10GB and Im forced to keep less and less data. My opinion is that it is keeping reserved space for tables that once could grow bigger than usual and it broke the whole inflow.
Best regards
Apr 23 2024 02:52 AM
Apr 23 2024 03:10 AM
@olafhelper Hi, what do you mean by saying there is mismatch in the information?
Where does it come from then?
Why in the same time, GUI says that it have 4GB available and procedure says it's not?
Apr 23 2024 10:19 PM
@pmrzyglod , really the same database?
Run command below to update stats about usage
dbcc updateusage(0);