Could not allocate space for object. because the 'PRIMARY' filegroup is full.

  • Hi,

    I am getting the following error on my SQL Server 2005 database.

    Could not allocate space for object 'dbo.OutgoingFaxes'.'PK_OutgoingFaxes' in database 'FaxService' 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.

    Why I am getting this error? and what is the solution?

    Thanks.

    Gunjan.

  • The error is pretty clear - you do not have enough space available in the file group for the operation you are trying to run.

    This could be that you are out of physical disk space on the machine and the data file cannot grow, or it could be that you have not enabled auto-grow and there is just not enough space in the allocated file.

  • Which SQL server edition are you using? Right click on SSMS on the database and you can see the "size" and "spaceavailable". If you still have disk space available increase the space for the database.

    this raises the question:

    Are you taking regular backups of your database?

    Delete any old data or any logs(if they are not needed) for immediate space.

  • Krishna (3/11/2009)


    Which SQL server edition are you using? Right click on SSMS on the database and you can see the "size" and "spaceavailable". If you still have disk space available increase the space for the database.

    Hi Krishna, please do not given wrong information. Rightclick and checking database gives the size of the file allocated and free space available for that database file .

    this raises the question:

    Are you taking regular backups of your database?

    Delete any old data or any logs(if they are not needed) for immediate space.

    Gunjan,

    From the error message it is clear that the file cann't be further expanded.

    Please check what are the other drives that are available on SQL Server and see free space availble on each drive by executing this command

    exec master.dbo.xp_fixeddrives.

    Now you have to cap the database file growth for the file that it cann't grow further and then extend database by adding another file and place this new file on other drive where there is ample space.

    command for you to create new file is

    alter database

    add file

    (filename = ,filegrowth = 100 MB,

    size = 1000 MB)

    Filegrowth and size are variable values and are to set as per requirements, also filegrowth can be set by percentage, but based on my expereince I recommend to set growth of file in MB that way file growth is controlled.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply