Monthly Archives: December 2010

Postgresql Advanced Commands and Queries

Recommended .psqlrc Always commit manually. At the prompt, show the db username at the database hostname, at the database; show if we are in a transaction, and show either > or # at the prompt depending on whether or not … Continue reading

Posted in Uncategorized | Leave a comment

Install MySQL DB on CentOS

How to Install MySQL Database Using Yum groupinstall on CentOS In this article, let us review how to install MySQL on CentOS using yum. Instead of searching and installing mysql and related packages one-by-one, it is better to install MySQL … Continue reading

Posted in Uncategorized | Leave a comment

PgBouncer

PgBouncer is a lightweight connection pooler for PostgreSQL To know more about pgbouncer ==> http://wiki.postgresql.org/wiki/PgBouncer http://pgbouncer.projects.postgresql.org/doc/usage.html 1. Download the latest pgbouncer software 2. On Centos we need libevent 1.2+ version so download latest libevent from http://monkey.org/~provos/libevent/ 3. Complie pgbouncer and … Continue reading

Posted in Uncategorized | Leave a comment

PgBench

PgBench 1. createdb pgbench 2. pgbench -i -s 10 -d pgbench (Creates 10 branches, 100 tellers, 1000000 accounts and 0 history) 3. Threads = 2 and transactions 2000, number of connections 98 /usr/local/postgres/pg9.01/bin/pgbench -t 2000 -j 2 -c 98 pgbench … Continue reading

Posted in Uncategorized | Leave a comment

PG Upgrade 8.4 to 9.01 Installation Steps

PG 9.0.1 Installation ================INSTALL NEW BINARY================== cd postgresql-9.0.1 ./configure -prefix=/usr/local/bin/pg9.01 gmake gmake install cd postgresql-9.0.1/contrib gmake gmake install SET user_profile PATH=$PATH:$HOME/bin #PATH=$PATH:/usr/local/bin/pg9.01/bin export PATH Change Ownership of the directory to postgres chown -R postgres.postgres pg9.01/ \* AS Postgres USER *\ … Continue reading

Posted in Uncategorized | Leave a comment

Analyze Postgresql log files

download the below file epqa_1.1.tgz and untar. link to download the file epqa_1.1.tgz https://docs.google.com/leaf?id=0B7-_8Og_7Y2YZTY2OGJlM2MtZTYyOS00MzRiLWEyOWYtNzhlNDcyZDNiMWVh&hl=en&authkey=COrm8IIF After untaring the file, to analyze the log file and output the result to HTML file execute the below command ./epqa.pl -f=postgresql-2010-10-18.log > report_2010_10_18.html

Posted in Uncategorized | Leave a comment

Building ER-Diagram using Schema Spy

==> make sure you have java installed #cd /etc/yum.repos.d/ # wget http://www.graphviz.org/graphviz-rhel.repo el –> enterprise linux #yum localinstall graphviz-2.26.3-1.el5.x86_64.rpm –nogpgcheck download ScheamSpy_5.0.0.jar https://docs.google.com/leaf?id=0B7-_8Og_7Y2YOTIyZGFiNjUtYjIwMy00MTA4LTlmZDgtMmYzZDJjNWI5YmM5&hl=en&authkey=CJTr2okE and postgresql-8.4-701.jdbc3.jar https://docs.google.com/leaf?id=0B7-_8Og_7Y2YZGFiMTBmZDItMDIzYi00MWUyLWE1NDctMTJiZjRlZDk4ZDRl&hl=en&authkey=CIG3isYN you need to have schemaSpy_5.0.0.jar and the postgresql driver #java -jar schemaSpy_5.0.0.jar -t pgsql … Continue reading

Posted in Uncategorized | Leave a comment