• Home
  • Services
    • HR Services
      • HR Advisory Services
      • Contract Staffing
      • HR Outsourcing Services
      • Manpower Supply Services
      • Payroll Processing
      • Permanent Placement
      • Recruitment and Placement Services
      • Recruitment Process Outsourcing
      • Staffing Agency Services
    • DBA Support
      • DBA Consultancy Services
      • PostgreSQL Support
    • Website Maintenance
    • CoWorking/Virtual Office Space Solution
  • Courses

    About Courses

    • List Of Courses
    • Become an Instructor
    Greenplum

    Greenplum

    $2,000.00 $1,500.00
    Read More
  • Company
    • FAQs
    • About Us
    • Contact
  • Events
  • Portfolio
  • Blogs
    • Blog – RayaFeeL
    • Blog – PostgreSQL Support
    • Blog – PostgreSQL Migration
    • Blog – All DB’s
    • Blog – Linux
    • Blog – Medical Coding
      • Cart

        0

    Have any question?
    (+91)8838953252
    ITsupport@rayafeel.com
    RegisterLogin
    RayaFeeL
    • Home
    • Services
      • HR Services
        • HR Advisory Services
        • Contract Staffing
        • HR Outsourcing Services
        • Manpower Supply Services
        • Payroll Processing
        • Permanent Placement
        • Recruitment and Placement Services
        • Recruitment Process Outsourcing
        • Staffing Agency Services
      • DBA Support
        • DBA Consultancy Services
        • PostgreSQL Support
      • Website Maintenance
      • CoWorking/Virtual Office Space Solution
    • Courses

      About Courses

      • List Of Courses
      • Become an Instructor
      Greenplum

      Greenplum

      $2,000.00 $1,500.00
      Read More
    • Company
      • FAQs
      • About Us
      • Contact
    • Events
    • Portfolio
    • Blogs
      • Blog – RayaFeeL
      • Blog – PostgreSQL Support
      • Blog – PostgreSQL Migration
      • Blog – All DB’s
      • Blog – Linux
      • Blog – Medical Coding
        • Cart

          0

      Writing PostgreSQL Script for Enabling Audit Related Parameter

      • Home
      • Writing PostgreSQL Script for Enabling Audit Related Parameter

      Writing PostgreSQL Script for Enabling Audit Related Parameter

      • Posted by 2ndnijam
      • Date January 4, 2019
      • This script will be helpful to  enabling the audit related parameter automatically
      • all entries in bash profile so you don’t need to set bin, if you type pg_ctl it will automatically update the  all postgres path like pgdata,pghome pgdatabase..
      • create a file in root and set chmod 777 permission to postgres user  because you have to run this file as a root user only.

      1. Creating change_parmater.sh file as root user.
      2. Assign the permission to postgres or enterprisedb user  we are using enterprisedb database so user is enterprisedb as default.
      3. Before running the script  take the 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
      export PATH=/opt/PostgresPlus/9.2AS/bin:$PATH
      export PGDATA=/opt/PostgresPlus/9.2AS/data/
      export PGDATABASE=edb
      export PGUSER=enterprisedb
      export PGPORT=5444
      cd $PGDATA
      cd ..
      mkdir audit
      chmod 755 audit/
      chown -R enterprisedb:enterprisedb audit/
      cd $PGDATA
      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
      Now parameter is changed to reflect those parameter at server level you have to restart the postgres server by using following anyone.

      As a root user:

      service postgresql restart 
      /etc/init.d/postgresql restart
      systemctl restart postgresql-10  - this is for redhat linux above 6 version

      As a postgres user:

      su - postgres
      pg_ctl restart -D /opt/PostgreSQL/9.3/data

       

      Contact Us

      Fields with (*) are compulsory.

      • Share:
      2ndnijam

      Previous post

      Postgres database cloud Migration by using crontab job sheduler
      January 4, 2019

      Next post

      PostgreSQL Backup script to schedule daily -pg_basebackup
      January 24, 2019

      Search

      ADVERTISEMENT

      Latest Posts

      Rayafeel Business proposal
      18Apr2021
      24 Best Coworking Spaces in Chennai You Should Know
      13Apr2021
      Easy to get a Virtual Address in Chennai
      12Apr2021
      Easy to get a Virtual Office in Chennai
      12Apr2021
      What is a Virtual Office? And How to get in chennai ?
      11Apr2021

      Latest Courses

      PostgreSQL

      PostgreSQL

      $600.00 $500.00
      Greenplum

      Greenplum

      $2,000.00 $1,500.00

      Preview Course

      Free

      Recent Forum Topics

      • please let me know pre requirements to increase work_mem
      • how to copy some data in one table to another table in postgres
      • postgres script for finding queries more than 1 hours ?
      • How to take the tables backup in postgres
      • what are the extensions required to be in instance for performance

      2ndquadrant.in

      (+91) 8838953252

      ITsupport@rayafeel.com

      Company

      • About Us
      • Contact
      • Our Team
      • Blog

      COURSES

      • List Of Course
      • Become An Instructor
      • Events
      • Postgres Support Blog

      Support

      • DBA Support
      • Consultancy Services
      • Postgres Migration Blogs
      • Forum

      Recommend

      • Groups
      • Login
      • FAQs
      • SignUp

      IT Services by rayafeel.com. Powered by Rayafeel Technologies Pvt Ltd.

      • Privacy
      • Terms

      Become An Instructor?

      Join thousand of instructors and earn money hassle free!

      Get Started Now

      Login with:

      Login with Google Login with Twitter Login with LinkedIn Login with Microsoft

      Login with your site account

      Lost your password?

      Not a member yet? Register now

      Register a new account

      Are you a member? Login now