X-Original-To: pgsql-admin@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CC7C9475925 for ; Sun, 2 Feb 2003 23:54:41 -0500 (EST) Received: from out-mta1.plasa.com (unknown [202.134.0.11]) by postgresql.org (Postfix) with ESMTP id E9D924758DC for ; Sun, 2 Feb 2003 23:54:36 -0500 (EST) Received: from exim by out-mta1.plasa.com with spam-scanned (Exim 4.12) id 18fYQ9-0005V6-00 for pgsql-admin@postgresql.org; Mon, 03 Feb 2003 11:41:25 +0700 Received: from [61.5.113.15] (helo=aris) by out-mta1.plasa.com with esmtp (Exim 4.12) id 18fYPW-0005FP-00 for pgsql-admin@postgresql.org; Mon, 03 Feb 2003 11:41:17 +0700 Content-Type: text/plain; charset="iso-8859-1" From: Aris wendy To: pgsql-admin@postgresql.org Subject: Re: Database Management Setup Date: Mon, 3 Feb 2003 11:55:30 +0700 User-Agent: KMail/1.4.3 References: <200301301111.03637.aris_postgre@telkom.net> <1043929923.1112.194.camel@linda.lfix.co.uk> In-Reply-To: <1043929923.1112.194.camel@linda.lfix.co.uk> MIME-Version: 1.0 Message-Id: <200302031155.30678.aris_postgre@telkom.net> X-Bogosity: No, tests=bogofilter, spamicity=0.414480, version=0.10.0 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/32 X-Sequence-Number: 7230 > 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=3D# 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. OK thx.....but I still got a problem [root@aris pgsql]# su postgres=20 bash-2.05b$ /usr/local/pgsql/bin/initdb -D /database bash-2.05b$ /usr/local/pgsql/bin/initdb -D /database1 bash-2.05b$ /usr/local/pgsql/bin/postmaster -D /database bash-2.05b$ /usr/local/pgsql/bin/createdb -D arisdb [root@aris pgsql]# ls -al /database/base drwx------ 7 postgres postgres 4096 Feb 3 10:59 . drwx------ 6 postgres postgres 4096 Feb 3 11:00 .. drwx------ 2 postgres postgres 4096 Jan 31 18:09 1 drwx------ 2 postgres postgres 4096 Jan 31 17:59 16975 drwx------ 2 postgres postgres 4096 Feb 3 11:01 16976 [root@aris pgsql]# mv /database/base/16976 /database1/base/16976 [root@aris pgsql]# /usr/local/pgsql/bin/psql -Upostgres arisdb psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? [root@aris pgsql]#mkdir /database/base/16976 [root@aris pgsql]#chown postgres.postgres /database/base/16976 [root@aris pgsql]#su postgres bash-2.05b$ ln -s /database/base/16976 /database1/base/16976 [root@aris pgsql]# ls -al /database/base/16976 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -= -=20 -rw------- 1 postgres postgres 8192 Jan 31 18:09 16680 lrwxrwxrwx 1 postgres postgres 20 Feb 3 11:35 16976 ->=20 /database/base/16976 -rw------- 1 postgres postgres 65776 Jan 31 18:09 pg_internal.init -rw------- 1 postgres postgres 4 Jan 31 18:09 PG_VERSION - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -= - [root@aris pgsql]# /usr/local/pgsql/bin/psql -Upostgres arisdb psql: FATAL: File /database/base/16976/PG_VERSION is missing. This is not = a=20 valid data directory. [root@aris pgsql]# cp /database1/base/16976/PG_VERSION /database/base/16976 [root@aris 16976]# /usr/local/pgsql/bin/psql -Upostgres arisdb psql: FATAL: _mdfd_getrelnfd: cannot open relation pg_class: No such file = or=20 directory Sorry if my e-mail is to long to read......... Best regards=20 Aris FYI : I use RH 8.0 and postgresql 7.3