Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 07:09 AM
Karthikeyan Sundaram
 
Posts: n/a
Default Question relating to database space and adding partition

Hi all,

We are using postgres 8.0.1 on our production and 8.2 on our development.
The linuix partition is getting full where the database resides. In few
weeks our partition will ran out of space so the database will also run out
of space. We are added another partition of 300GB. Now my question is, how
will I point the database to the new partition along with the old one.

In oracle when we add a datafile, we can tell the location. I don't know
how to do this in postgres.

Can somebody help me?

Regards
skarthi

__________________________________________________ _______________
From predictions to trailers, check out the MSN Entertainment Guide to the
Academy Awards®
http://movies.msn.com/movies/oscars2...coscartagline1


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

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 07:09 AM
Joshua D. Drake
 
Posts: n/a
Default Re: Question relating to database space and adding partition

Karthikeyan Sundaram wrote:
> Hi all,
>
> We are using postgres 8.0.1 on our production and 8.2 on our
> development. The linuix partition is getting full where the database
> resides. In few weeks our partition will ran out of space so the
> database will also run out of space. We are added another partition of
> 300GB. Now my question is, how will I point the database to the new
> partition along with the old one.
>
> In oracle when we add a datafile, we can tell the location. I don't
> know how to do this in postgres.
>
> Can somebody help me?



The easiest way would be to create a new tablespace:

http://www.postgresql.org/docs/8.1/s...blespaces.html

>
> Regards
> skarthi
>
> __________________________________________________ _______________
> From predictions to trailers, check out the MSN Entertainment Guide to
> the Academy Awards®
> http://movies.msn.com/movies/oscars2...coscartagline1
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>



--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 07:09 AM
Karthikeyan Sundaram
 
Posts: n/a
Default how to add a new data partition

Hi all,

We are using postgres 8.0.1 on our production and 8.2 on our development.
The linuix partition is getting full where the database resides. In few
weeks our partition will ran out of space so the database will also run out
of space. We have added another HDD of 300GB. Now my question is, how will
I point the database to the new partition along with the old one. Do I need
to create a symbolic link to the exitisting DB?

Adding a new tablespace doesn't solve the issue as there are many tables
in the old tablespace. Is there a way to extend the tablespace to the new
partition like in Oracle.

Did anybody faced this problem and how did you resolve. Please share your
thoughts.


Regards
skarthi

__________________________________________________ _______________
Talk now to your Hotmail contacts with Windows Live Messenger.
http://get.live.com/messenger/overview


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 07:09 AM
Andrew Sullivan
 
Posts: n/a
Default Re: how to add a new data partition

On Tue, Feb 06, 2007 at 01:46:19PM -0800, Karthikeyan Sundaram wrote:
> We are using postgres 8.0.1 on our production and 8.2 on our development.
> The linuix partition is getting full where the database resides. In few


Which partition is getting full?

> Adding a new tablespace doesn't solve the issue as there are many tables
> in the old tablespace. Is there a way to extend the tablespace to the new
> partition like in Oracle.


Not like in Oracle; Postgres doesn't manage the disk the way Oracle
does. My suggestion is to use the underlying operating system tools
to do this. I know you _can_, but I haven't done it recently on
Linux.

A

--
Andrew Sullivan | ajs@crankycanuck.ca
Everything that happens in the world happens at some place.
--Jane Jacobs

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 07:09 AM
Phillip Smith
 
Posts: n/a
Default Re: how to add a new data partition

One option if you can have the DB offline for a little while:

1) Shutdown Postgres
2) Move your current data directory to the new partition
3) Update your PGDATA variable, and any scripts that reference it to reflect
the new data path. You might also like to symlink the old data dir to the
new one.
4) Restart Postgres. pg_ctl -D /new/path/to/data start

That's worked for me several time before.

Cheers,
-p

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailtogsql-admin-owner@postgresql.org] On Behalf Of Karthikeyan Sundaram
Sent: Wednesday, 7 February 2007 08:46
To: pgsql-admin@postgresql.org
Subject: [ADMIN] how to add a new data partition

Hi all,

We are using postgres 8.0.1 on our production and 8.2 on our development.

The linuix partition is getting full where the database resides. In few
weeks our partition will ran out of space so the database will also run out
of space. We have added another HDD of 300GB. Now my question is, how will
I point the database to the new partition along with the old one. Do I need
to create a symbolic link to the exitisting DB?

Adding a new tablespace doesn't solve the issue as there are many tables
in the old tablespace. Is there a way to extend the tablespace to the new
partition like in Oracle.

Did anybody faced this problem and how did you resolve. Please share your

thoughts.


Regards
skarthi

__________________________________________________ _______________
Talk now to your Hotmail contacts with Windows Live Messenger.
http://get.live.com/messenger/overview


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee. If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-10-2008, 07:10 AM
Karthikeyan Sundaram
 
Posts: n/a
Default Re: how to add a new data partition

Hi Philip,

Thanks for the reply. Our DB grows very fast. Hence I don't want to
move the exisisting data dir. If I move my data file to the new partition,
I will face the same issue in another month instead of week.

My requirement is to keep the old data directory along with the new
partition.

In Oracle, we can tell the alter database add data file '/new partition'
so the the new partition will take into effect along with the old one.

Is there a similar way in postgres?


Regards
skarthi


>From: "Phillip Smith" <phillip.smith@weatherbeeta.com.au>
>To: "'Karthikeyan Sundaram'"
><skarthi98@hotmail.com>,<pgsql-admin@postgresql.org>
>Subject: Re: [ADMIN] how to add a new data partition
>Date: Wed, 7 Feb 2007 08:52:06 +1100
>
>One option if you can have the DB offline for a little while:
>
>1) Shutdown Postgres
>2) Move your current data directory to the new partition
>3) Update your PGDATA variable, and any scripts that reference it to
>reflect
>the new data path. You might also like to symlink the old data dir to the
>new one.
>4) Restart Postgres. pg_ctl -D /new/path/to/data start
>
>That's worked for me several time before.
>
>Cheers,
>-p
>
>-----Original Message-----
>From: pgsql-admin-owner@postgresql.org
>[mailtogsql-admin-owner@postgresql.org] On Behalf Of Karthikeyan Sundaram
>Sent: Wednesday, 7 February 2007 08:46
>To: pgsql-admin@postgresql.org
>Subject: [ADMIN] how to add a new data partition
>
>Hi all,
>
> We are using postgres 8.0.1 on our production and 8.2 on our
>development.
>
>The linuix partition is getting full where the database resides. In few
>weeks our partition will ran out of space so the database will also run out
>of space. We have added another HDD of 300GB. Now my question is, how will
>I point the database to the new partition along with the old one. Do I need
>to create a symbolic link to the exitisting DB?
>
> Adding a new tablespace doesn't solve the issue as there are many
>tables
>in the old tablespace. Is there a way to extend the tablespace to the new
>partition like in Oracle.
>
> Did anybody faced this problem and how did you resolve. Please share
>your
>
>thoughts.
>
>
>Regards
>skarthi
>
>_________________________________________________ ________________
>Talk now to your Hotmail contacts with Windows Live Messenger.
>http://get.live.com/messenger/overview
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>
>
>*******************Confidentiality and Privilege Notice*******************
>
>The material contained in this message is privileged and confidential to
>the addressee. If you are not the addressee indicated in this message or
>responsible for delivery of the message to such person, you may not copy
>or deliver this message to anyone, and you should destroy it and kindly
>notify the sender by reply email.
>
>Information in this message that does not relate to the official business
>of Weatherbeeta must be treated as neither given nor endorsed by
>Weatherbeeta.
>Weatherbeeta, its employees, contractors or associates shall not be liable
>for direct, indirect or consequential loss arising from transmission of
>this
>message or any attachments
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: don't forget to increase your free space map settings


__________________________________________________ _______________
Valentine’s Day -- Shop for gifts that spell L-O-V-E at MSN Shopping
http://shopping.msn.com/content/shp/...e=wlmtagli ne


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-10-2008, 07:10 AM
Phillip Smith
 
Posts: n/a
Default Re: how to add a new data partition

AFAIK, Postgres doesn't support anything like this, apart from
table-spaces which you've already indicated aren't appropriate.

Perhaps a LVM group would be appropriate in this situation if you have
the luxury of being able to implement that somehow...

Cheers,
-p


On Tue, 2007-02-06 at 13:55 -0800, Karthikeyan Sundaram wrote:
> Hi Philip,
>
> Thanks for the reply. Our DB grows very fast. Hence I don't want to
> move the exisisting data dir. If I move my data file to the new partition,
> I will face the same issue in another month instead of week.
>
> My requirement is to keep the old data directory along with the new
> partition.
>
> In Oracle, we can tell the alter database add data file '/new partition'
> so the the new partition will take into effect along with the old one.
>
> Is there a similar way in postgres?
>
>
> Regards
> skarthi
>
>
> >From: "Phillip Smith" <phillip.smith@weatherbeeta.com.au>
> >To: "'Karthikeyan Sundaram'"
> ><skarthi98@hotmail.com>,<pgsql-admin@postgresql.org>
> >Subject: Re: [ADMIN] how to add a new data partition
> >Date: Wed, 7 Feb 2007 08:52:06 +1100
> >
> >One option if you can have the DB offline for a little while:
> >
> >1) Shutdown Postgres
> >2) Move your current data directory to the new partition
> >3) Update your PGDATA variable, and any scripts that reference it to
> >reflect
> >the new data path. You might also like to symlink the old data dir to the
> >new one.
> >4) Restart Postgres. pg_ctl -D /new/path/to/data start
> >
> >That's worked for me several time before.
> >
> >Cheers,
> >-p
> >
> >-----Original Message-----
> >From: pgsql-admin-owner@postgresql.org
> >[mailtogsql-admin-owner@postgresql.org] On Behalf Of Karthikeyan Sundaram
> >Sent: Wednesday, 7 February 2007 08:46
> >To: pgsql-admin@postgresql.org
> >Subject: [ADMIN] how to add a new data partition
> >
> >Hi all,
> >
> > We are using postgres 8.0.1 on our production and 8.2 on our
> >development.
> >
> >The linuix partition is getting full where the database resides. In few
> >weeks our partition will ran out of space so the database will also run out
> >of space. We have added another HDD of 300GB. Now my question is, how will
> >I point the database to the new partition along with the old one. Do I need
> >to create a symbolic link to the exitisting DB?
> >
> > Adding a new tablespace doesn't solve the issue as there are many
> >tables
> >in the old tablespace. Is there a way to extend the tablespace to the new
> >partition like in Oracle.
> >
> > Did anybody faced this problem and how did you resolve. Please share
> >your
> >
> >thoughts.
> >
> >
> >Regards
> >skarthi
> >
> >_________________________________________________ ________________
> >Talk now to your Hotmail contacts with Windows Live Messenger.
> >http://get.live.com/messenger/overview
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 4: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> >
> >
> >*******************Confidentiality and Privilege Notice*******************
> >
> >The material contained in this message is privileged and confidential to
> >the addressee. If you are not the addressee indicated in this message or
> >responsible for delivery of the message to such person, you may not copy
> >or deliver this message to anyone, and you should destroy it and kindly
> >notify the sender by reply email.
> >
> >Information in this message that does not relate to the official business
> >of Weatherbeeta must be treated as neither given nor endorsed by
> >Weatherbeeta.
> >Weatherbeeta, its employees, contractors or associates shall not be liable
> >for direct, indirect or consequential loss arising from transmission of
> >this
> >message or any attachments
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 5: don't forget to increase your free space map settings

>
> __________________________________________________ _______________
> Valentines Day -- Shop for gifts that spell L-O-V-E at MSN Shopping
> http://shopping.msn.com/content/shp/...e=wlmtagli ne
>
>



*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee. If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments

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

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-10-2008, 07:10 AM
Tom Lane
 
Posts: n/a
Default Re: how to add a new data partition

Phillip Smith <phillip.smith@weatherbeeta.com.au> writes:
> Perhaps a LVM group would be appropriate in this situation if you have
> the luxury of being able to implement that somehow...


Indeed, the existence of LVM and similar tools is exactly why we don't
deem it pressing to come up with Oracle-like tablespace management.
If you want a tablespace to span multiple physical volumes, use LVM.
The Postgres project tries to avoid re-inventing perfectly good wheels ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-10-2008, 07:10 AM
Scott Marlowe
 
Posts: n/a
Default Re: how to add a new data partition

On Tue, 2007-02-06 at 15:46, Karthikeyan Sundaram wrote:
> Hi all,
>
> We are using postgres 8.0.1 on our production and 8.2 on our development.
> The linuix partition is getting full where the database resides. In few
> weeks our partition will ran out of space so the database will also run out
> of space. We have added another HDD of 300GB. Now my question is, how will
> I point the database to the new partition along with the old one. Do I need
> to create a symbolic link to the exitisting DB?
>
> Adding a new tablespace doesn't solve the issue as there are many tables
> in the old tablespace. Is there a way to extend the tablespace to the new
> partition like in Oracle.


So,

alter table ... set tablespace new_tablespace

doesn't work for you in this circumstance?

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-10-2008, 07:10 AM
Karthikeyan Sundaram
 
Posts: n/a
Default Re: how to add a new data partition

Hi Scott,

Thanks for replying. The tablespace is not the main problem here. I
want the data files to grow in the new partition along with the old linux
partition.

Let me put like this.

We have a linux partition of 120GB called as
/local/postgres/database/Data/< followed by all files>

This /local partition is 95 % used.

So we are adding one more partition called /local1 which is
approximately 250 GB. Now I want to inform postgres that after /local
partiion is 100 %, I want to utilize the /local1 so that the database can
grow significantly. In other words, the data file created and maintained by
postgres will grow in the /local1 partition.

How to do this in postgres?

I don't want to compare with Oracle. But in Oracle, when we create the
DB

we will tell alter database add data file
'/local/postgres/database/data'
then if /local partition is full, we can add another data file such as
alter database <db Name> add data file '/local1/data2'

Is there a similar way or equivalent way to do in postgres?

Regards
skarthi



>From: Scott Marlowe <smarlowe@g2switchworks.com>
>To: Karthikeyan Sundaram <skarthi98@hotmail.com>
>CC: pgsql-admin@postgresql.org
>Subject: Re: [ADMIN] how to add a new data partition
>Date: Tue, 06 Feb 2007 17:17:15 -0600
>
>On Tue, 2007-02-06 at 15:46, Karthikeyan Sundaram wrote:
> > Hi all,
> >
> > We are using postgres 8.0.1 on our production and 8.2 on our

>development.
> > The linuix partition is getting full where the database resides. In few
> > weeks our partition will ran out of space so the database will also run

>out
> > of space. We have added another HDD of 300GB. Now my question is, how

>will
> > I point the database to the new partition along with the old one. Do I

>need
> > to create a symbolic link to the exitisting DB?
> >
> > Adding a new tablespace doesn't solve the issue as there are many

>tables
> > in the old tablespace. Is there a way to extend the tablespace to the

>new
> > partition like in Oracle.

>
>So,
>
>alter table ... set tablespace new_tablespace
>
>doesn't work for you in this circumstance?
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match


__________________________________________________ _______________
Invite your Hotmail contacts to join your friends list with Windows Live
Spaces
http://clk.atdmt.com/MSN/go/msnnkwsp...aspx&mkt=en-us


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

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376