From: Oliver Elphick <olly@lfix.co.uk>
To: Aris wendy <aris_postgre@telkom.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: Database Management Setup
Date: 30 Jan 2003 12:32:03 +0000
Message-ID: <1043929923.1112.194.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <200301301111.03637.aris_postgre@telkom.net>
References: <200301301111.03637.aris_postgre@telkom.net>
On Thu, 2003-01-30 at 04:11, Aris wendy wrote:
> I am a new comer in this millis. Can you help me how to configure the
> postgreSQL server which has some databases. I mean 5 databses is spread to
> different hardisk. For example a_db to hda1, b_db to hdb1, etc.......
You can use symbolic links, if your operating system allows them.
1. For safety, make a full backup with pg_dumpall.
2. Identify the database directories -- they are named by the oid of the
database in pg_databases:
template1=# select datname, oid from pg_database;
datname | oid
----------------+---------
accounts | 16983
comanagers | 1063179
template1 | 1
...
$ sudo ls $PGDATA/base
1 1063179 16983 ...
3. Shut down the postmaster.
4. Move the relevant directories from $PGDATA/base to the desired
locations on the other disks -- their parent directories should have the
same ownership and permissions as $PGDATA.
5. In $PGDATA/base, make symbolic links to the moved directories.
PostgreSQL should notice no difference in the structure.
6. Restart the postmaster.
If you destroy the database structure and recreate it by restoring from
a full dump, the symbolic link structure will not be restored, since
PostgreSQL knows nothing about it. It will have to be maintained
manually.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"The Lord knoweth how to deliver the godly out of
temptations, and to reserve the unjust unto the day of
judgment to be punished;" II Peter 2:9
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: olly@lfix.co.uk, aris_postgre@telkom.net
Subject: Re: Database Management Setup
In-Reply-To: <1043929923.1112.194.camel@linda.lfix.co.uk>
References: <200301301111.03637.aris_postgre@telkom.net> <1043929923.1112.194.camel@linda.lfix.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox