1.1PostGresql 数据库
Postgresql 9.0 下载:http://www.enterprisedb.com/products/pgdownload.do 源码:http://www.postgresql.org/ftp/source/ 学习:http://www.pgsqldb.org/pgsqldoc-8.1c/index.html 学习中心:http://www.enterprisedb.com/solutions/pg_tune_scale.do 性能优化文档:http://wiki.postgresql.org/wiki/Performance_Optimization 参考优化:http://www.westnet.com/~gsmith/content/postgresql/pg-5minute.htm 内存管理:http://www.pgsqldb.org/pgsqldoc-8.1c/kernel-resources.html 优化:http://www.enterprisedb.com/tservices/training/postgresql_performance_training.do 优化提示符:http://www.enterprisedb.com/docs/cn/8.3R2/perf/Performance_Guide_CN-26.htm#TopOfPage 数据库连接配置:http://www.pgsqldb.org/pgsqldoc-8.1c/client-authentication.html#AUTH-PG-HBA-CONF |
1.Postgresql 安装
#useradd -g postgres postgres #su - postgres /*9.0 安装*/ ./postgresql-9.0.1-1-linux.bin --安装目录下存在pg_env.sh文件,环境变量之间加入到vi /etc/profile里 [root@www Postgresql]# more pg_env.sh #!/bin/sh # The script sets environment variables helpful for Postgresql export PATH=/mnt/ext/Postgresql/bin:$PATH export PGDATA=/mnt/ext/Postgresql/data export PGDATABASE=postgres export PGUSER=postgres export PGPORT=5432 export PGLOCALEDIR=/mnt/ext/Postgresql/share/locale export MANPATH=$MANPATH:/mnt/ext/Postgresql/share/man /*8.0 安装*/ $tar -zxvf postgresql-8.4.2.tar.gz $cd postgresql-8.4.2 $./configure --prefix=/mnt/ext/Postgresql --enable-profiling --with-blocksize=8 --with-wal-blocksize=8 $make && make install --初始化data $cd /mnt/ext/Postgresql/bin $ ./initdb --encoding=utf8 -D /mnt/ext/Postgresql/data --启动数据库并查看进程 ./pg_ctl -D /mnt/ext/Postgresql/data/ -l /mnt/ext/Postgresql/log/alert.log start ps -ef | grep postgres /* 官方简单安装*/ ./configure gmake su gmake install adduser postgres mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test Postgres常用命令 postgres#\l查看系统中现存的数据库 postgres#\dt查看表 postgres#\d查看表结构 postgres#\di查看索引 |