December 11, 2014 at 5:58 am
Hello.
I'm having some problems with my database usage space.
I have a database with atogrowth off and limited size to 150GB.
When users try to import files, large databases or other massive transaction this message appears:
"Could not allocate a new page for database 'DB_PRODUCAO' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup."
What I don't understand is why this error happens. This database have free space as you can see on the numbers above:
FileSizeMB-----------UsedSpaceMB-----------UnusedSpaceMB-----------DBFileName
140025.31------------21102.19----------------118923.13------------------db_Producao
1082.44-------------------21.31------------------1061.13------------------db_Producao_log
There is almost 119GB of free space for use but the database don't use it.
Autogrowth can't set on because the server polices.
Can someone help me with this question?
December 11, 2014 at 6:28 am
Is there only the one filegroup (PRIMARY) in the database?
December 11, 2014 at 6:59 am
Yes.
Just "PRIMARY" and log.
December 11, 2014 at 7:01 am
DBA From The Cold (12/11/2014)
Is there only the one filegroup (PRIMARY) in the database?
Yes.
Just "PRIMARY" and log.
December 11, 2014 at 7:21 am
Hmm, I'm wondering if the free space is actually free space within existing objects. Does the database have data bulk inserted and then removed often?
December 11, 2014 at 7:30 am
Have a look at this script:-
CREATE TABLE #TableSize
([Name]VARCHAR(255),
[rows]INT,
[Reserved]VARCHAR(255),
[Data]VARCHAR(255),
[Index Size]VARCHAR(255),
[Unused]VARCHAR(255));
CREATE TABLE #ConvertedSizes
([Name]VARCHAR(255),
[Rows]INT,
[Reserved (KB)]INT,
[Data (KB)]INT,
[Index Size (KB)]INT,
[Unused (KB)]INT);
EXEC sp_MSforeachtable @Command1="insert into #TableSize EXEC sp_spaceused '?'";
INSERT INTO #ConvertedSizes ([Name], [Rows], [Reserved (KB)], [Data (KB)], [Index Size (KB)], [Unused (KB)])
SELECT
[Name],
[Rows],
SUBSTRING([Reserved], 0, LEN([Reserved])-2),
SUBSTRING([Data], 0, LEN([Data])-2),
SUBSTRING([Index Size], 0, LEN([Index Size])-2),
SUBSTRING([Unused], 0, LEN([Unused])-2)
FROM
#TableSize;
SELECT
[Name],
[Rows],
[Data (KB)]/1024 AS [Data (MB)],
[Index Size (KB)],
[Unused (KB)]
FROM
#ConvertedSizes
ORDER BY
[Data (KB)] DESC;
DROP TABLE #TableSize;
DROP TABLE #ConvertedSizes;
GO
It's based on sp_spaceused to show you all the tables in the database and their free space. It will give you a more detailed view of the space consumed within your database.
December 11, 2014 at 8:06 am
M. Gamito (12/11/2014)
Hello.I'm having some problems with my database usage space.
I have a database with atogrowth off and limited size to 150GB.
When users try to import files, large databases or other massive transaction this message appears:
"Could not allocate a new page for database 'DB_PRODUCAO' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup."
What I don't understand is why this error happens. This database have free space as you can see on the numbers above:
FileSizeMB-----------UsedSpaceMB-----------UnusedSpaceMB-----------DBFileName
140025.31------------21102.19----------------118923.13------------------db_Producao
1082.44-------------------21.31------------------1061.13------------------db_Producao_log
There is almost 119GB of free space for use but the database don't use it.
Autogrowth can't set on because the server polices.
Can someone help me with this question?
It's very likely that the import is exceeding the space available and then SQL Server does a rollback... which would cause the space to revert back to "Unused". You need to monitor the space used DURING the import to se what it has consumed in the process.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 11, 2014 at 9:08 am
DBA From The Cold (12/11/2014)
Hmm, I'm wondering if the free space is actually free space within existing objects. Does the database have data bulk inserted and then removed often?
This database had some tables imported from another db and after the use those tables were dropped.
Could this action be the cause this problem?
December 11, 2014 at 9:10 am
Jeff Moden (12/11/2014)
M. Gamito (12/11/2014)
Hello.I'm having some problems with my database usage space.
I have a database with atogrowth off and limited size to 150GB.
When users try to import files, large databases or other massive transaction this message appears:
"Could not allocate a new page for database 'DB_PRODUCAO' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup."
What I don't understand is why this error happens. This database have free space as you can see on the numbers above:
FileSizeMB-----------UsedSpaceMB-----------UnusedSpaceMB-----------DBFileName
140025.31------------21102.19----------------118923.13------------------db_Producao
1082.44-------------------21.31------------------1061.13------------------db_Producao_log
There is almost 119GB of free space for use but the database don't use it.
Autogrowth can't set on because the server polices.
Can someone help me with this question?
It's very likely that the import is exceeding the space available and then SQL Server does a rollback... which would cause the space to revert back to "Unused". You need to monitor the space used DURING the import to se what it has consumed in the process.
Thanks for answer my question.
The file I'm trying to import have 10GB. I should have no problems with this one right?
December 11, 2014 at 9:13 am
DBA From The Cold (12/11/2014)
Have a look at this script:-
CREATE TABLE #TableSize
([Name]VARCHAR(255),
[rows]INT,
[Reserved]VARCHAR(255),
[Data]VARCHAR(255),
[Index Size]VARCHAR(255),
[Unused]VARCHAR(255));
CREATE TABLE #ConvertedSizes
([Name]VARCHAR(255),
[Rows]INT,
[Reserved (KB)]INT,
[Data (KB)]INT,
[Index Size (KB)]INT,
[Unused (KB)]INT);
EXEC sp_MSforeachtable @Command1="insert into #TableSize EXEC sp_spaceused '?'";
INSERT INTO #ConvertedSizes ([Name], [Rows], [Reserved (KB)], [Data (KB)], [Index Size (KB)], [Unused (KB)])
SELECT
[Name],
[Rows],
SUBSTRING([Reserved], 0, LEN([Reserved])-2),
SUBSTRING([Data], 0, LEN([Data])-2),
SUBSTRING([Index Size], 0, LEN([Index Size])-2),
SUBSTRING([Unused], 0, LEN([Unused])-2)
FROM
#TableSize;
SELECT
[Name],
[Rows],
[Data (KB)]/1024 AS [Data (MB)],
[Index Size (KB)],
[Unused (KB)]
FROM
#ConvertedSizes
ORDER BY
[Data (KB)] DESC;
DROP TABLE #TableSize;
DROP TABLE #ConvertedSizes;
GO
It's based on sp_spaceused to show you all the tables in the database and their free space. It will give you a more detailed view of the space consumed within your database.
Thanks for the script.
I checked the numbers and averything apparently to be normal.
The used space match with the tables.
Another idea ?
December 11, 2014 at 9:21 am
M. Gamito (12/11/2014)
Jeff Moden (12/11/2014)
M. Gamito (12/11/2014)
Hello.I'm having some problems with my database usage space.
I have a database with atogrowth off and limited size to 150GB.
When users try to import files, large databases or other massive transaction this message appears:
"Could not allocate a new page for database 'DB_PRODUCAO' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup."
What I don't understand is why this error happens. This database have free space as you can see on the numbers above:
FileSizeMB-----------UsedSpaceMB-----------UnusedSpaceMB-----------DBFileName
140025.31------------21102.19----------------118923.13------------------db_Producao
1082.44-------------------21.31------------------1061.13------------------db_Producao_log
There is almost 119GB of free space for use but the database don't use it.
Autogrowth can't set on because the server polices.
Can someone help me with this question?
It's very likely that the import is exceeding the space available and then SQL Server does a rollback... which would cause the space to revert back to "Unused". You need to monitor the space used DURING the import to se what it has consumed in the process.
Thanks for answer my question.
The file I'm trying to import have 10GB. I should have no problems with this one right?
Correct. There should be no problems here. I guess we need to see the code being used to help any further.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 12, 2014 at 6:28 am
Jeff Moden (12/11/2014)
M. Gamito (12/11/2014)
Jeff Moden (12/11/2014)
M. Gamito (12/11/2014)
Hello.I'm having some problems with my database usage space.
I have a database with atogrowth off and limited size to 150GB.
When users try to import files, large databases or other massive transaction this message appears:
"Could not allocate a new page for database 'DB_PRODUCAO' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup."
What I don't understand is why this error happens. This database have free space as you can see on the numbers above:
FileSizeMB-----------UsedSpaceMB-----------UnusedSpaceMB-----------DBFileName
140025.31------------21102.19----------------118923.13------------------db_Producao
1082.44-------------------21.31------------------1061.13------------------db_Producao_log
There is almost 119GB of free space for use but the database don't use it.
Autogrowth can't set on because the server polices.
Can someone help me with this question?
It's very likely that the import is exceeding the space available and then SQL Server does a rollback... which would cause the space to revert back to "Unused". You need to monitor the space used DURING the import to se what it has consumed in the process.
Thanks for answer my question.
The file I'm trying to import have 10GB. I should have no problems with this one right?
Correct. There should be no problems here. I guess we need to see the code being used to help any further.
It's a file, I'm not using a command. I'm using the Import Export Interface.
Here I have more information there can be usefull to resolve this problem.
SELECT name, size, max_size FROM sys.database_files
name---------------size--------------max_size
db_Producao--------14704024------19200000
db_Producao_log---384-------------268435456
What don't make sense to me is the fact of the db is using just 21GB and have more 130 avaible space, but when I check the the database file usage information I see this 147GB, and I locked autogrowth at 150GB. This can be the reason of the problem, but I don't know why this is happening.
I was trying to do a shrink database on this DB, but it was taking so long and I aborted it.
Any idea?
December 15, 2014 at 8:58 am
How many indexes are on the file. I would try dropping the indexes from the file and retry. Is this a new process? I would also, if you can, test how much space the import uses on a test server, set file to auto and see how big it gets and then see what's used after import has completed. You might have to batch the process so it commits more often. How long does it take before failure. Is the logfile growing at all. dbcc sqlperf(logspace) when you're running this.
Tom
December 15, 2014 at 9:05 am
I forgot to ask, what datatypes are in the table being inserted into.
Tom
December 15, 2014 at 9:09 am
M. Gamito (12/12/2014)
Jeff Moden (12/11/2014)
M. Gamito (12/11/2014)
Jeff Moden (12/11/2014)
M. Gamito (12/11/2014)
Hello.I'm having some problems with my database usage space.
I have a database with atogrowth off and limited size to 150GB.
When users try to import files, large databases or other massive transaction this message appears:
"Could not allocate a new page for database 'DB_PRODUCAO' because of insufficient disk space in filegroup 'PRIMARY'. Create the necessary space by dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup."
What I don't understand is why this error happens. This database have free space as you can see on the numbers above:
FileSizeMB-----------UsedSpaceMB-----------UnusedSpaceMB-----------DBFileName
140025.31------------21102.19----------------118923.13------------------db_Producao
1082.44-------------------21.31------------------1061.13------------------db_Producao_log
There is almost 119GB of free space for use but the database don't use it.
Autogrowth can't set on because the server polices.
Can someone help me with this question?
It's very likely that the import is exceeding the space available and then SQL Server does a rollback... which would cause the space to revert back to "Unused". You need to monitor the space used DURING the import to se what it has consumed in the process.
Thanks for answer my question.
The file I'm trying to import have 10GB. I should have no problems with this one right?
Correct. There should be no problems here. I guess we need to see the code being used to help any further.
It's a file, I'm not using a command. I'm using the Import Export Interface.
Here I have more information there can be usefull to resolve this problem.
SELECT name, size, max_size FROM sys.database_files
name---------------size--------------max_size
db_Producao--------14704024------19200000
db_Producao_log---384-------------268435456
What don't make sense to me is the fact of the db is using just 21GB and have more 130 avaible space, but when I check the the database file usage information I see this 147GB, and I locked autogrowth at 150GB. This can be the reason of the problem, but I don't know why this is happening.
I was trying to do a shrink database on this DB, but it was taking so long and I aborted it.
Any idea?
It's a simple xls file. I import files like this everyday on other databases. I will do the test on another DB and will check the log file to see how is it growing.
But this is a strange problem, don't know why this is happening.
Viewing 15 posts - 1 through 15 (of 19 total)
You must be logged in to reply to this topic. Login to reply