Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Audit Script For Postgresql

  • Here I explained about how to write audit script for  postgresql(postgresql.conf) server
  • i put all entries in bash profile so you don't need to set bin, if you type pg_ctl it ill automatically select all postgres path like pgdata,pghome pgdatabase..
  • create one file in root and set chmod 777 permission to postgres user  becouse you want to run this file..
1.vi change_parmater.sh
2.check enterprisedb privillages
3.take backup of postgresql.conf file 
eg.$cp /opt/PostgresPlus/9.2AS/data/postgresq.conf /opt/PostgresPlus/9.2AS/data/postgresql.conf.bkp --becouse saftey purpose..
vi change_paramter.sh

cd ..
mkdir audit
chmod 755 audit/
chown -R enterprisedb:enterprisedb audit/
echo "log_statement = 'none'" >>postgresql.conf
echo "log_destination='syslog'" >>postgresql.conf
echo "log_connections = on"  >>postgresql.conf
echo "log_disconnections = on"  >>postgresql.conf 
echo "log_directory=pg_log" >>postgresql.conf
echo "edb_audit_filename = 'audit-%Y-%m-%d_%H%M%S'" >>postgresql.conf
echo "log_filename = 'enterprisedb-%Y-%m-%d_%H%M%S.log'"  >>postgresql.conf
echo "edb_audit_directory ='/opt/PostgresPlus/9.2AS/audit/'" >>postgresql.conf
--Run the change_parmater.sh script following method
#sh change_parmater.sh
--after that user to start server like this way  
#/etc/init.d/ppas.9.2 restart (or)
#pg_ctl reload -D $PGDATA


Popular posts from this blog

PostgreSQL pgBadger

ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated ORA-01262: Stat failed on a file destination directory Linux-x86_64 Error: 2: No such file or directory

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

PostgreSQL Pgbadger Installation On Linux

PostgreSQL Database startup / shutdown /restart