戻る

postgresql-8-1-3.tgz

Out line

pkgtool にて インストール です ;postgresql-8-1-3.tgz の インストー ル を 簡単に 行うには postgresql-8-1-3.tgz のある ディレクトリ にて

# pkgtool
 Yes   postgresql-8-1-3 をインストールする     
#

おわりました。 内容を 見ておきましょう

# ls /usr/local/pgsql/bin/
clusterdb*   dropdb*    initdb*          pg_ctl*        pg_restore*  reindexdb*
createdb*    droplang*  ipcclean*        pg_dump*       postgres*    vacuumdb*
createlang*  dropuser*  pg_config*       pg_dumpall*    postmaster@
createuser*  ecpg*      pg_controldata*  pg_resetxlog*  psql*

色々試してみる

わかわかんねが?

# su - postgres
$ pwd
/home/postgres
$ cd /usr/local/pgsql/
$ ls -l
合計 24
drwxr-xr-x    2 root     root         4096  3月  9日  23:48 bin/
drwxr-xr-x    3 root     root         4096  3月  9日  23:44 doc/
drwxr-xr-x    6 root     root         4096  3月  9日  23:44 include/
drwxr-xr-x    3 root     root         4096  3月  9日  23:48 lib/
drwxr-xr-x    4 root     root         4096  3月  9日  23:44 man/
drwxr-xr-x    3 root     root         4096  3月  9日  23:44 share/
$ mkdir data
mkdir: cannot create directory `data': 許可がありません
$ exit
logout

なんで?

# cd /usr/local/
# chown postgres.postgres pgsql/
# cd

必要なのかどうか 不明 おまじない 今度は 一般ユーザーから postgres に 変身

$ su - postgres
Password: postgres_passwd
$ pwd
/home/postgres
$ exit
logout
$ su postgres
Password: postgres_passwd
$ pwd
/home/mm
$ cd /usr/local/pgsql/

再度

$ mkdir data

????????変

postgres@lx:/usr/local/pgsql$ /usr/local/pgsql/bin/initdb \
--encoding=EUC_JP --no -locale -D/usr/local/pgsql/data 

こうせにゃいけんのか 即ち

$ /usr/local/pgsql/bin/initdb --encoding=EUC_JP --no -locale -D/usr/local/pgsql/data 
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating directory /usr/local/pgsql/data/global ... ok
creating directory /usr/local/pgsql/data/pg_xlog ... ok
creating directory /usr/local/pgsql/data/pg_xlog/archive_status ... ok
creating directory /usr/local/pgsql/data/pg_clog ... ok
creating directory /usr/local/pgsql/data/pg_subtrans ... ok
creating directory /usr/local/pgsql/data/pg_twophase ... ok
creating directory /usr/local/pgsql/data/pg_multixact/members ... ok
creating directory /usr/local/pgsql/data/pg_multixact/offsets ... ok
creating directory /usr/local/pgsql/data/base ... ok
creating directory /usr/local/pgsql/data/base/1 ... ok
creating directory /usr/local/pgsql/data/pg_tblspc ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1000
creating configuration files ... ok
creating template1 database in /usr/local/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
enabling unlimited row size for system tables ... ok
initializing dependencies ... ok
creating system views ... ok
loading pg_description ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
or
    /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

なんだ なんだ なんなんだ?

$ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile002 2>&1 &
$ ps aux | grep postmaster | grep -v grep
postgres 20331  0.1  1.0 16216 2684 pts/2    S    00:00   0:00 /usr/local/pgsql/
bin/postmaster -D /usr/local/pgsql/data
$ ps ax | grep postmaster | grep -v grep
20331 pts/2    S      0:00 /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
$ /usr/local/pgsql/bin/pg_ctl stop -D /usr/local/pgsql/data
waiting for postmaster to shut down.... done
postmaster stopped
[1]+  Done                    /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile002 2>&1
$ cat logfile002 
LOG:  database system was shut down at 2006-03-09 23:57:22 JST
LOG:  checkpoint record is at 0/33A6AC
LOG:  redo record is at 0/33A6AC; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 565; next OID: 10794
LOG:  next MultiXactId: 1; next MultiXactOffset: 0
LOG:  database system is ready
LOG:  transaction ID wrap limit is 2147484146, limited by database "postgres"
LOG:  received smart shutdown request
LOG:  shutting down
LOG:  database system is shut down

補足

取り扱いを お勉強して から でないと つかえないよー!

にゃんたろう 拝!
2006年 3月16日 (木) 23:14:02 JST 作成


戻る

Copyright © 2004.-2007. nyantarou All Rights Reserved.