Re: HowTo move indices' files to other hdd ?

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Vitaliy Pylypiv <pylypiv(at)hotbox(dot)ru>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: HowTo move indices' files to other hdd ?
Date: 2002-07-15 20:08:46
Message-ID: Pine.LNX.4.44.0207151402080.29139-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 15 Jul 2002, Vitaliy Pylypiv wrote:

> Hi all!
>
> Is it possible to move indices' files to other hdd ?

Yes. Here's what you need to do:

first, go to the postgresql-7.x.x/contrib/oid2name directory (as root) and
do a make;make install so you have the oid2name utility installed.

then, do:

oid2name | grep dbname

where dbname is the name of the database you want to move an index around
on. You should get a line like 10964230 = dbname back..

As the postgres superuser, do:

cd $PGDATA/base/oidfromoid2nameabove (i.e. 10964230 in my example)

Next do:

oid2name -d dbname|grep indexname

to get the oid of the index.

Then, shutdown the server and cp your index elsewhere:

pg_ctl stop
cp 10965165 /mnt/indexdisk/10965165
rm 10965165
ln -s /mnt/indexdisk/10965165
pg_ctl start

And that's that.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2002-07-15 20:10:43 Re: Question: merit / feasibility of compressing frontend <--> backend transfers w/ zlib
Previous Message scott.marlowe 2002-07-15 19:30:12 Re: MySQL vs. PostgreSQL