473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Database Size Limiting

Is there a way to limit the size that an individual database can take
up?

My understanding is that all your databases go into a file system which
is your 'catalog cluster'.

But all the databases can grow until that filesystem is full.

Is there a way to limit how big a database can be? Can you allocated
space when the database is set up so you can say db1 can only be 100 MB?



Thank you!

Troy Campano
Nov 23 '05 #1
5 8663
Campano, Troy wrote:
Is there a way to limit the size that an individual database can take
up?

My understanding is that all your databases go into a file system which
is your 'catalog cluster'.

But all the databases can grow until that filesystem is full.

Is there a way to limit how big a database can be? Can you allocated
space when the database is set up so you can say db1 can only be 100 MB?


Well, you've got two main options:
1. Run multiple instances of PG
If you run each as its own user "postgres1","postgres2" etc then you can
use the standard user permissions to control resource usage.

2. Place each database on its own volume
Mount one volume per database, move and symlink that database to the
volume. If you volume is only 100MB then the database will stop there.

Of course, what you probably want to do is monitor each folder (tip -
the folder names in .../data/base are the OIDs of databases) and warn at
75MB and disallow access if usage is 125MB for more than 24 hours.
That's something outside of PG's control, but someone will have done it.

Oh - final option would be one of the virtual server setups which let
you allocate resource limits per vserver.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #2
Hello,

You could use Filsystem quotas but I strongly suggest against it as it
will probably bring about database corruption.

A better solution would be to monitor the space being allocated so you
can add storage as required.

Sincerely,

Joshua D. Drake
Campano, Troy wrote:
-->

Is there a way to limit the size that an individual database can take up?

My understanding is that all your databases go into a file system which
is your ‘catalog cluster’.

But all the databases can grow until that filesystem is full.

Is there a way to limit how big a database can be? Can you allocated
space when the database is set up so you can say db1 can only be 100 MB?



Thank you!

*Troy Campano*

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd@commandprompt.com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #3
Joshua D. Drake wrote:
Hello,

You could use Filsystem quotas but I strongly suggest against it as it
will probably bring about database corruption.


I thought we handled that? I'm not saying it'd be pleasant, but I think
it's no worse than a power-outage.

Hmm, can't find anything in the manuals to back that up. I can find
postings to the mailing lists though, and no-one is complaining PG ate
their data.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 23 '05 #4
Joshua D. Drake wrote:
Hello,

You could use Filsystem quotas but I strongly suggest against it as it
will probably bring about database corruption.


Ah - manual reference
http://www.postgresql.org/docs/curre...disk-full.html

"24.2. Disk Full Failure

The most important disk monitoring task of a database administrator is
to make sure the disk doesn't grow full. A filled data disk may result
in subsequent corruption of database indexes, but not of the tables
themselves. If the WAL files are on the same disk (as is the case for a
default configuration) then a filled disk during database initialization
may result in corrupted or incomplete WAL files. This failure condition
is detected and the database server will refuse to start up. "

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #5
Database Size LimitingI wonder if this will work:

each DB should assigned a diffrent user with set of premissions ( includinginsert ).

a script that can revoke the inseret privilage will emarge from time to time to check the DB size.

--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Fax: 972-4-6990098
http://www.canaan.net.il
--------------------------

----- Original Message -----
From: Campano, Troy
To: Postgres general mailing list
Sent: Thursday, May 27, 2004 8:07 PM
Subject: [GENERAL] Database Size Limiting
Is there a way to limit the size that an individual database can take up?

My understanding is that all your databases go into a file system which is your 'catalog cluster'.

But all the databases can grow until that filesystem is full.

Is there a way to limit how big a database can be? Can you allocated space when the database is set up so you can say db1 can only be 100 MB?

Thank you!

Troy Campano

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sharif T. Karim | last post by:
How would I get the total size of a mysql database in MB format? -- Sharif T. Karim ....you don't know wrath yet...
1
by: Robin Tucker | last post by:
As I had real problems working my head around sp_spaceused, I've written an SP to do it (I also noted a lot of questions about this when "searching"). Pass in a database name and it will return the...
19
by: dchow | last post by:
Our database size is currently 4G and is incrementing at a rate of 45M/day. What is the max size of a SQL database? And what is the size beyond which the server performance will start to go down?
2
by: Sue | last post by:
I have a large database currently using up 30GB of space -- problem is, I am running out of space on my harddrive and so have to do some cleanup. One of the tables has a blob field and I find that...
4
by: vijay.db | last post by:
Hi Group, It's really confusing to calculate the size of the DB2 UDB database in versions lesser than 8.2. In Version 8.2 if we run the query db2 "call get_dbsize_info(?,?,?,0)" it gives us...
2
by: Laurence | last post by:
Hi folks, My database DB03 is circular logging. I called the db2 procedure: get_dbsize_info to get the database size as below: Parameter Name : SNAPSHOTTIMESTAMP Parameter Value :...
5
by: aleu | last post by:
Hi all, Could you please advise whether there are documents describing impact of MS SQL server 2005 database size on its performance? I have essentially two things in mind when writing the...
3
by: ramprat | last post by:
Hi Everyone, I don't know if this is a problem but I have a database I have been building and currently there are 10 or less tables in it with 100 or less records in each. In many cases there are...
1
by: rednemesis | last post by:
Good Day everyone! When I calculated the size of the database on my system using the formula: Total Page size x Page size (4096) = Total Database Size Used page size x Page size (4096) =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.