Discussion:
Exceeding the 4G limit
(too old to reply)
jib
2007-08-30 14:39:43 UTC
Permalink
Hi,

I am using a SQL Server 2005 Express database, which, according to the
literature is limited to storing a maximum of 4G. So far I haven't reached
that limit yet. However, in case I do, what can I expect to see happening?
Will my INSERT command come back with a failure? With SQL Server start to
flash error dialogs? Anything?

Jib
William Vaughn
2007-08-30 18:37:19 UTC
Permalink
Actually, you'll find that the overflow tray under the hard-drive will start
to fill with bits. ;)
Yes, you should expect to see exceptions as new rows are added or you make
changes to the database. Consider that an Update adds a new row and deletes
the old one--it eventually reclaims the space. SQL Server has no user
interface--it's just a service. It has no way to tell anyone things are
going badly except via the logs and performance counters.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
Post by jib
Hi,
I am using a SQL Server 2005 Express database, which, according to the
literature is limited to storing a maximum of 4G. So far I haven't reached
that limit yet. However, in case I do, what can I expect to see happening?
Will my INSERT command come back with a failure? With SQL Server start to
flash error dialogs? Anything?
Jib
Andrea Montanari
2007-08-31 10:44:09 UTC
Permalink
hi Jib,
Post by jib
Hi,
I am using a SQL Server 2005 Express database, which, according to the
literature is limited to storing a maximum of 4G. So far I haven't
reached that limit yet. However, in case I do, what can I expect to
see happening? Will my INSERT command come back with a failure? With
SQL Server start to flash error dialogs? Anything?
as Bill already stated, you'll stat gettinge "exceptions":
Msg 1105:
"Could not allocate space for object 'dbo.t' in database 'ext' because the
'PRIMARY' filegroup is full. Create disk space by deleting unneeded files,
dropping objects in the filegroup, adding additional files to the filegroup,
or setting autogrowth on for existing files in the filegroup."


the message can be little misleading and probably something similar to error
1827
"CREATE DATABASE or ALTER DATABASE failed because the resulting cumulative
database size would exceed your licensed limit of %I64d MB per %S_MSG."
could probably be a better "indicator" of the real problem, but such an
exception has not been defined..
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://italy.mvps.org
DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
--------- remove DMO to reply
Paul@GoldCoast
2007-11-09 04:15:01 UTC
Permalink
Hi Andrea, I have this same issue on a production MOSS 2007 Intranet server
at school. How do I get around it? Can I add a new Database? I'm new to this
so if you know what to do to fix this issue without going to SQL 2005 server
then I'd appreciate knowing how

Thanks
Paul
Gold Coast
Oz
Post by Andrea Montanari
hi Jib,
Post by jib
Hi,
I am using a SQL Server 2005 Express database, which, according to the
literature is limited to storing a maximum of 4G. So far I haven't
reached that limit yet. However, in case I do, what can I expect to
see happening? Will my INSERT command come back with a failure? With
SQL Server start to flash error dialogs? Anything?
"Could not allocate space for object 'dbo.t' in database 'ext' because the
'PRIMARY' filegroup is full. Create disk space by deleting unneeded files,
dropping objects in the filegroup, adding additional files to the filegroup,
or setting autogrowth on for existing files in the filegroup."
the message can be little misleading and probably something similar to error
1827
"CREATE DATABASE or ALTER DATABASE failed because the resulting cumulative
database size would exceed your licensed limit of %I64d MB per %S_MSG."
could probably be a better "indicator" of the real problem, but such an
exception has not been defined..
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://italy.mvps.org
DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
--------- remove DMO to reply
Andrea Montanari
2007-11-09 11:45:35 UTC
Permalink
hi Paul,
Post by ***@GoldCoast
Hi Andrea, I have this same issue on a production MOSS 2007 Intranet
server at school. How do I get around it? Can I add a new Database?
I'm new to this so if you know what to do to fix this issue without
going to SQL 2005 server then I'd appreciate knowing how
it's not legal to "hack" or workaround that limit of 2gb per database in
MSDE and 4gb per database in SQLExpress...
the only legal workaround is to split the database into more databases...
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://italy.mvps.org
DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
--------- remove DMO to reply
Paul@GoldCoast
2007-11-11 22:44:01 UTC
Permalink
Thanks Andrea, How do I split the 4GB database? I've tried to add a new
database but it still hits the 4GB limit. If you know how to split the
existing 4GB database in SQL Express then please let me know?
Many Thanks

Paul
Post by Andrea Montanari
hi Paul,
Post by ***@GoldCoast
Hi Andrea, I have this same issue on a production MOSS 2007 Intranet
server at school. How do I get around it? Can I add a new Database?
I'm new to this so if you know what to do to fix this issue without
going to SQL 2005 server then I'd appreciate knowing how
it's not legal to "hack" or workaround that limit of 2gb per database in
MSDE and 4gb per database in SQLExpress...
the only legal workaround is to split the database into more databases...
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://italy.mvps.org
DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
--------- remove DMO to reply
Andrea Montanari
2007-11-12 16:36:24 UTC
Permalink
hi Paul,
Post by ***@GoldCoast
Thanks Andrea, How do I split the 4GB database? I've tried to add a
new database but it still hits the 4GB limit. If you know how to
split the existing 4GB database in SQL Express then please let me
know?
"splitting" means, for instance, separating a big table into separate lettle
tables... say you have an "orders" table, you can separate it into
Order1990to1995, Orders1995to2000, Order2000to2005, Orders (where Orders
means a reasonably partition or the actual current partition of data, say
the current year or the like)..
we are in fact dealing with horizontal partitioning and the "whole design"
should be modified accordingly to that...
you have than to move partitions across databases to split it.. so you gain
space.. usualy you maintain lookup tables in the "current database" and
modify existing views and stored procedures to mamange the partition as
well.. you have to consider "just" the "modified" name as long as the new
database storing the partition, and you can use for that a 3 part name
allowed by SQL Server,: database.owner/schema/object..

so you can, for instance, have your actual existing retrivial stored
procedure(s) modified from
CREATE PROCEDURE dbo.usp_GetOrdersByDate (@OrderDate)
AS BEGIN
SELECT <col_list>
FROM dbo.Orders
WHERE [Date] = @OrderDate;
END;

in
CREATE PROCEDURE dbo.usp_GetOrdersByDate (@OrderDate)
AS BEGIN
IF YEAR(@OrderDate) >= 2005 -- THIS IS THE "PARTITION' FUNCTION
SELECT <col_list>
FROM dbo.Orders
WHERE [Date] = @OrderDate;
IF YEAR(@OrderDate) >= 2000 AND YEAR(@OrderDate) < 2005
SELECT <col_list>
FROM db_Year200to2005.dbo.Orders2000to2005
WHERE [Date] = @OrderDate;
IF ......
END;

and so on, for all the CRUD operations (that's to say for
insert/update/delete/select)...
this is the base idea.. it's not "difficult" per se, but you have to plan
and test.. ah.. you have to test... and if I did not mention it, you have to
carefully test :)
regards
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://italy.mvps.org
DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
--------- remove DMO to reply
William Vaughn
2007-11-12 20:16:28 UTC
Permalink
Ah, the REAL answer here is to figure out how to use SQL Express within the
limitations. Invariably, an oversized database (one that's larger than 4GB)
contains binary large objects (BLOBs). IMHO, these should not be stored in
the database--and Microsoft agrees. That's why they're implementing the
FileStream datatype in Katmai (SS 2008). It's not hard to reengineer your
database to move the pictures and documents into a structured file system
(where they should be) and simply put pointers to the files in the database.
The result? Better performance (for about 6 reasons) and the ability to live
within the 4GB database size.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
Post by ***@GoldCoast
Hi Andrea, I have this same issue on a production MOSS 2007 Intranet server
at school. How do I get around it? Can I add a new Database? I'm new to this
so if you know what to do to fix this issue without going to SQL 2005 server
then I'd appreciate knowing how
Thanks
Paul
Gold Coast
Oz
Post by Andrea Montanari
hi Jib,
Post by jib
Hi,
I am using a SQL Server 2005 Express database, which, according to the
literature is limited to storing a maximum of 4G. So far I haven't
reached that limit yet. However, in case I do, what can I expect to
see happening? Will my INSERT command come back with a failure? With
SQL Server start to flash error dialogs? Anything?
"Could not allocate space for object 'dbo.t' in database 'ext' because the
'PRIMARY' filegroup is full. Create disk space by deleting unneeded files,
dropping objects in the filegroup, adding additional files to the filegroup,
or setting autogrowth on for existing files in the filegroup."
the message can be little misleading and probably something similar to error
1827
"CREATE DATABASE or ALTER DATABASE failed because the resulting cumulative
database size would exceed your licensed limit of %I64d MB per %S_MSG."
could probably be a better "indicator" of the real problem, but such an
exception has not been defined..
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz http://italy.mvps.org
DbaMgr2k ver 0.21.0 - DbaMgr ver 0.65.0 and further SQL Tools
--------- remove DMO to reply
Loading...