question

VidhyadharTS-6837 avatar image
0 Votes"
VidhyadharTS-6837 asked 70795778 commented

Sql express edition says limit is 10GB but my database has grown more thn 50GB



Sql express edition says limit is 10GB but my database has grown more than 50GB and things are working fine and no issues reported.
how to understand this 10 GB limit over growing 50+ GB please advise.

Thanks in Advance

sql-server-general
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


How did you obtain the value of 50 GB?

Check the results displayed by EXEC sp_spaceused.


1 Vote 1 ·

Hi VidhyadharTS-6837,

How are things going? Were the answers helpful?
Please feel free to let us know if you have any other question. If the post in the thread is helpful, you could kindly accept it as answer.

Best Regards,
Amelia

1 Vote 1 ·
DirkHondong avatar image
0 Votes"
DirkHondong answered 70795778 commented

Hi Vidhyadhar,

take a look at the size of your data file and the log file
The data file has the 10 GB Limit.
If your DB is that much larger, then I suppose that you're running the database in Full Recovery mode without taking log backups.
So you need to take care of a proper backup which includes Full database backup as well as T-Log backups.
Maybe you take a look at the maintenance solution Ola Hallengren provides. There are examples how to set it up for SQL Srv Express as well.


Regards
Dirk

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

VidhyadharTS-6837 avatar image
0 Votes"
VidhyadharTS-6837 answered DirkHondong edited

Hey Dirk
Thanks for quick reply!

I also read somewhere that the recovery model should be simple rather a full recovery? is that true ?


am not good at db or I just have too minimum knowledge at DBs

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Vidhyadhar,

the thing is: is just a backup of the whole database ok for you, eg. just once or twice a day?
Then you may go for simple recovery mode and just take database backups.
If you have the need to do so called point in time restores, then your database should stay in full recovery mode and you have to take log backups regularly.
Then you are to recover your database (if needed) to a specific point in time like 14:38:33

Info about Full Recovery mode
https://www.mssqltips.com/sqlservertutorial/3/sql-server-full-recovery-model/#:~:text=The%20%22Full%22%20recovery%20model%20tells,the%20transaction%20log%20is%20truncated.


1 Vote 1 ·
VidhyadharTS-6837 avatar image
0 Votes"
VidhyadharTS-6837 answered DirkHondong edited

When we say 10GB, it is for the MDF file, which is actually data stored file.
There is a LOG file called .LDF file, in that its a log file and it can grow until the HDD supports and another, the LDF file growth is restricted to certain limit.

So here the drive space is set to 299 GB . and if I dont change anything in any of options, can i expect db to grow till 290 GB atleast ?

How can I truncate the Log file ?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If your database is not mission critical, then you can try

     USE [yourdatabase]
     Checkpoint;
        
     USE [master]
     GO
     ALTER DATABASE [yourdatabase] SET RECOVERY SIMPLE WITH NO_WAIT
     GO
        
     USE [yourdatabase]
     GO
     DBCC SHRINKFILE (N'dba_local_log' , 1000)
     GO




This will change the recovery model and shrinks your Tlog file to 1000MB

This is just a simple example though

0 Votes 0 ·
AmeliaGu-msft avatar image
0 Votes"
AmeliaGu-msft answered

Hi VidhyadharTS-6837,

In addition, after shrinking the log file, you can have alter database modify file command to set max file size of log file so that the log file will not fill up the drive.
For example:

 ALTER DATABASE databasename
  MODIFY FILE
  (NAME = logname,
  MAXSIZE = 100GB);

And please also remember to monitor the log file size every once in a while. Please refer to Manage the size of the transaction log file for more details.

Best Regards,
Amelia


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.