Re: POWA tool - Mailing list pgsql-general

From Raghu Ram
Subject Re: POWA tool
Date
Msg-id CALnrrJT=2uiQ7CkB1DXT-jUeP5aU9+Bhr_1F8dMJ+gp0u-Dxpg@mail.gmail.com
Whole thread Raw
In response to Re: POWA tool  (Ramesh T <rameshparnanditech@gmail.com>)
Responses Re: POWA tool  (Ramesh T <rameshparnanditech@gmail.com>)
List pgsql-general

On Fri, Aug 22, 2014 at 4:40 PM, Ramesh T <rameshparnanditech@gmail.com> wrote:
How to include pg_stat_statements in postgres.conf.powa is need it.
      
any help..


Below are the steps to Install POWA Tool:

Step 1: Download POWA tool from below Website

https://github.com/dalibo/powa/archive/REL_1_1.zip

Step 2: Unpack the Downloaded file

[root@localhost tmp]# cd /tmp/
[root@localhost powa-REL_1_1]# unzip powa-REL_1_1.zip

Step 3: Install POWA Software

[root@localhost powa-REL_1_1]# export PATH=/opt/PostgreSQL/9.3/bin:$PATH
[root@localhost powa-REL_1_1]# export LD_LIBRARY_PATH=/opt/PostgreSQL/9.3/lib:$LD_LIBRARY_PATH
[root@localhost powa-REL_1_1]# make install
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I/opt/PostgreSQL/9.3/include/postgresql/server -I/opt/PostgreSQL/9.3/include/postgresql/internal -D_GNU_SOURCE -I/opt/local/20140108/fc7f8f12-7861-11e3-aaff-000c29d23b02/include/libxml2  -I/usr/local/include/libxml2 -I/usr/local/include  -c -o powa.o powa.c
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fpic -L/opt/PostgreSQL/9.3/lib -L/opt/local/20140108/fc7f8f12-7861-11e3-aaff-000c29d23b02/lib  -L/usr/local/lib -Wl,--as-needed -Wl,-rpath,'/opt/PostgreSQL/9.3/lib',--enable-new-dtags  -shared -o powa.so powa.o
/bin/mkdir -p '/opt/PostgreSQL/9.3/share/postgresql/extension'
/bin/mkdir -p '/opt/PostgreSQL/9.3/share/postgresql/extension'
/bin/mkdir -p '/opt/PostgreSQL/9.3/lib/postgresql'
/bin/mkdir -p '/opt/PostgreSQL/9.3/doc/postgresql/extension'
/usr/bin/install -c -m 644 ./powa.control '/opt/PostgreSQL/9.3/share/postgresql/extension/'
/usr/bin/install -c -m 644 ./powa--1.0.sql ./powa--1.1.sql  '/opt/PostgreSQL/9.3/share/postgresql/extension/'
/usr/bin/install -c -m 755  powa.so '/opt/PostgreSQL/9.3/lib/postgresql/'
/usr/bin/install -c -m 644 ./README.md '/opt/PostgreSQL/9.3/doc/postgresql/extension/'

Step 4: Create a POWA database & Create requires extensions

-bash-4.1$ /opt/PostgreSQL/9.3/bin/psql -p 5435
Password: 
psql.bin (9.3.5)
Type "help" for help.
postgres=# create database powa;
CREATE DATABASE
postgres=# \c powa 
You are now connected to database "powa" as user "postgres".
powa=# create extension pg_stat_statements ;
CREATE EXTENSION
powa=# create extension btree_gist ;
CREATE EXTENSION
powa=# create extension powa;
CREATE EXTENSION
powa=# \dt
                      List of relations
 Schema |              Name               | Type  |  Owner   
--------+---------------------------------+-------+----------
 public | powa_functions                  | table | postgres
 public | powa_last_aggregation           | table | postgres
 public | powa_last_purge                 | table | postgres
 public | powa_statements                 | table | postgres
 public | powa_statements_history         | table | postgres
 public | powa_statements_history_current | table | postgres
(6 rows)

Step 5:  add "power" & "pg_stat_statements" in the shared_preload_libraries in postgresql.conf file

-bash-4.1$ more /opt/PostgreSQL/9.3/data/postgresql.conf |grep shared_preload
# Note:  Increasing max_prepared_transactions costs ~600 bytes of shared memory
shared_preload_libraries = 'powa,pg_stat_statements' # (change requires restart)


-bash-4.1$ /opt/PostgreSQL/9.3/bin/pg_ctl -D /opt/PostgreSQL/9.3/data/ start
server starting
-bash-4.1$ 2014-07-25 03:48:20 IST LOG:  registering background worker "powa"
2014-07-25 03:48:20 IST LOG:  loaded library "powa"
2014-07-25 03:48:20 IST LOG:  loaded library "pg_stat_statements"
2014-07-25 03:48:20 IST LOG:  redirecting log output to logging collector process
2014-07-25 03:48:20 IST HINT:  Future log output will appear in directory "pg_log". 

Step 6: Install Mojolicious Software

[root@localhost ui]# pwd
/tmp/powa-REL_1_1/ui
[root@localhost ui]# ls -l
total 36
drwxr-xr-x 4 root root 4096 Aug 19  2014 lib
-rw-r--r-- 1 root root  393 Jul 25 04:05 powa.conf
-rw-r--r-- 1 root root  393 Aug 19  2014 powa.conf-dist
drwxr-xr-x 6 root root 4096 Aug 19  2014 public
-rw-r--r-- 1 root root 2121 Aug 19  2014 README.md
drwxr-xr-x 2 root root 4096 Aug 19  2014 script
drwxr-xr-x 2 root root 4096 Aug 19  2014 t
drwxr-xr-x 6 root root 4096 Aug 19  2014 templates
-rw-r--r-- 1 root root    4 Aug 19  2014 VERSION


[root@localhost ui]# cp powa.conf-dist powa.conf


[root@localhost ~]# /usr/bin/curl get.mojolicio.us | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    54    0    54    0     0    179      0 --:--:-- --:--:-- --:--:--   184
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  262k  100  262k    0     0  70788      0  0:00:03  0:00:03 --:--:--  120k
--> Working on Mojolicious
Fetching http://www.cpan.org/authors/id/S/SR/SRI/Mojolicious-5.33.tar.gz ... OK
Configuring Mojolicious-5.33 ... OK
Building Mojolicious-5.33 ... OK
Successfully installed Mojolicious-5.33
1 distribution installed


[root@localhost ui]# morbo script/powa 
[Tue Aug 26 00:46:29 2014] [debug] Reading configuration file "/tmp/powa-REL_1_1/ui/powa.conf".
[Tue Aug 26 00:46:29 2014] [info] Listening at "http://*:3000".
Server available at http://127.0.0.1:3000.


Step 7: Run http://127.0.0.1:3000 in web browser.

Thanks & Regards

Raghu Ram


 

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: Query planner question
Next
From: "Huang, Suya"
Date:
Subject: Re: how to query against nested hstore data type