Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1002
  • Last Modified:

'PRIMARY' filegroup is full

Trying to run a sql job I get "Could not allocate space for object (table name) in database (db name) because the 'PRIMARY' filegroup is full. [SQLSTATE 42000] [Erro 1105] The step failed.  How do I clean up the filegroup as backing up the database doesn't seem to be working?  I am running sql 2000.
0
jimhallenjr
Asked:
jimhallenjr
2 Solutions
 
ThorSG1Commented:
Backing up the database will not help.  You need to increase the size of the PRIMARY datafile.

ALTER DATABASE DBName MODIFY FILE (NAME = 'FileName' , SIZE = X)

DBName - Name of the database
FileName - Logical file name of the datafile.
X - You can specify in MB, GB.  If the database is currently 10MB you could change the X to 20MB.  If your database is 5GB you could change X to 6GB.  Obviously this depends on how much space you have.


0
 
RiteshShahCommented:
ThorSG1 gave you perfect solution but this problem keep occurring when your given limit will full again, you can do one thing, you can set your primary file group for auto growth, however, you can limit autogrowth so that it will not be grown more than your limit.

Steps:

Right click on database from SSMS

click on property and follow screen shot.
filegrowth.JPG
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
question: what edition is your sql installation?
I ask, because if it's sql express, your database size is limited and cannot be grown.

apart from that, I agree than manually resizeing the data file is a good method, however, you should check out if your have only 1 filegroup (PRIMARY) to move your tables and indexes to dedicated filegroups, which shall increase I/O performance.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now