• Home
  • Services
    • DBA Support
    • DBA Consultancy Services
    • PostgreSQL Support
    • Website Maintenance
  • Courses

    About Courses

    • List Of Courses
    • Become an Instructor
    Greenplum Database

    Greenplum Database

    $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
      • DBA Support
      • DBA Consultancy Services
      • PostgreSQL Support
      • Website Maintenance
    • Courses

      About Courses

      • List Of Courses
      • Become an Instructor
      Greenplum Database

      Greenplum Database

      $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

      Databases

      • Home
      • All courses
      • Databases
      • PostgreSQL Database
      CoursesIT & SoftwareDatabasesPostgreSQL Database
      • BASIC POSTGRESQL
        6
        • Lecture1.1
          PostgreSQL Brief History 30 min
        • Lecture1.2
          PostgreSQL Features 20 min
        • Lecture1.3
          PostgreSQL Monitoring Tools Overview 30 min
        • Lecture1.4
          PostgreSQL – Oracle Vs PostgreSQL 30 min
        • Lecture1.5
          PostgreSQL Data Types 30 min
        • Lecture1.6
          PostgreSQL Maximum Objects Size 30 min
      • VMWARE & POSTGRESQL INSTALLATION
        9
        • Lecture2.1
          Vmware Installation 30 min
        • Lecture2.2
          Creating Linux Virtual Machine 01 hour
        • Lecture2.3
          PostgreSQL Installation Types 30 min
        • Lecture2.4
          PostgreSQL GUI Installation 30 min
        • Lecture2.5
          PostgreSQL Text Mode Installation 30 min
        • Lecture2.6
          PostgreSQL Unattended Mode Installation 30 min
        • Lecture2.7
          Configure the network & Disk Partition 30 min
        • Lecture2.8
          How to install PostgreSQL10 On Linux Server ? 20 min
        • Lecture2.9
          PostgreSQL -11 Installation (rpm & source code) 30 min
      • POSTGRESQL DATABASE
        6
        • Lecture3.1
          Connect Postgres Server 10 min
        • Lecture3.2
          PostgreSQL startup / shutdown /restart the postgresql server 30 min
        • Lecture3.3
          PostgreSQL .bash_profile Set Up 30 min
        • Lecture3.4
          PostgreSQL Database Creation 30 min
        • Lecture3.5
          PostgreSQL Connect Database 30 min
        • Lecture3.6
          PostgreSQL Drop Database 30 min
      • POSTGRESQL TABLE
        16
        • Lecture4.1
          PostgreSQL Languages 30 min
        • Lecture4.2
          PostgreSQL Create Table 30 min
        • Lecture4.3
          PostgreSQL Select Table 30 min
        • Lecture4.4
          PostgreSQL Alter Table 30 min
        • Lecture4.5
          PostgreSQL Drop Table 30 min
        • Lecture4.6
          PostgreSQL Truncate Table 30 min
        • Lecture4.7
          PostgreSQL Rename 30 min
        • Lecture4.8
          PostgreSQL Comment 30 min
        • Lecture4.9
          PostgreSQL Insert 30 min
        • Lecture4.10
          PostgreSQL Update 30 min
        • Lecture4.11
          PostgreSQL Table Delete 30 min
        • Lecture4.12
          PostgreSQL Merge Table 30 min
        • Lecture4.13
          PostgreSQL UNION 30 min
        • Lecture4.14
          PostgreSQL UNION ALL 30 min
        • Lecture4.15
          PostgreSQL INTERSECT 30 min
        • Lecture4.16
          PostgreSQL DISTINCT 30 min
      • USER/OBJECTS PRIVILEGE AND ROLES ASIGNING
        3
        • Lecture5.1
          PostgreSQL Grant 30 min
        • Lecture5.2
          PostgreSQL Revoke 30 min
        • Lecture5.3
          Postgres user creation and restrict DDL statement & other database access 30 min
      • TRANSACTIONS - MVCC
        3
        • Lecture6.1
          PostgreSQL Commit 30 min
        • Lecture6.2
          PostgreSQL Rollback 30 min
        • Lecture6.3
          PostgreSQL Savepoint 30 min
      • POSTGRESQL USER/SCHEMA MANAGEMENT
        9
        • Lecture7.1
          PostgreSQL User Creation 30 min
        • Lecture7.2
          PostgreSQL User Creation Using Utility 30 min
        • Lecture7.3
          PostgreSQL Drop user 30 min
        • Lecture7.4
          PostgreSQL Drop User Using Utility 30 min
        • Lecture7.5
          PostgreSQL Password Changing and Views 30 min
        • Lecture7.6
          PostgreSQL Group/role 30 min
        • Lecture7.7
          Alter PostgreSQL User/Role/group 30 min
        • Lecture7.8
          PostgreSQL Schema 30 min
        • Lecture7.9
          PostgreSQL user creation and restrict DDL & database access 30 min
      • POSTGRESQL CONSTRAINTS
        6
        • Lecture8.1
          PostgreSQL Constraints 30 min
        • Lecture8.2
          PostgreSQL Primary Key 30 min
        • Lecture8.3
          PostgreSQL UNIQUE Constraint 30 min
        • Lecture8.4
          PostgreSQL CHECK Constraint 30 min
        • Lecture8.5
          PostgreSQL NOT NULL Constraint 30 min
        • Lecture8.6
          PostgreSQL Foreign Key 30 min
      • POSTGRESQL ADVANCE DATA TYPE
        5
        • Lecture9.1
          PostgreSQL DOMAIN Data Type 30 min
        • Lecture9.2
          PostgreSQL Alter Domain 30 min
        • Lecture9.3
          PostgreSQL Drop DOMAIN 30 min
        • Lecture9.4
          PostgreSQL Json Data Type 30 min
        • Lecture9.5
          PostgreSQL Sequence 30 min
      • POSTGRESQL VIEWS
        1
        • Lecture10.1
          How to Create PostgreSQL View 30 min
      • POSTGRESQL MONITORING OBJECT USUAGE/SIZE
        1
        • Lecture11.1
          How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database 30 min
      • POSTGRESQL DATABASE ARCHITECTURE
        4
        • Lecture12.1
          PostgreSQL Tablespace 30 min
        • Lecture12.2
          PostgreSQL UnderStanding Of Objects 30 min
        • Lecture12.3
          PostgreSQL Architecture 30 min
        • Lecture12.4
          PostgreSQL Query Flow 30 min
      • POSTGRESQL BACKUP AND RECOVERY
        13
        • Lecture13.1
          PostgreSQL Backup & Recovery Overview 30 min
        • Lecture13.2
          PostgreSQL Database Backup Tools – Pg_dump 30 min
        • Lecture13.3
          PostgreSQL Database Backup Tools – Pg_dumpall 30 min
        • Lecture13.4
          PostgreSQL Database Backup Tools – Pg_basebackup 30 min
        • Lecture13.5
          PostgreSQL COPY data From Text File 30 min
        • Lecture13.6
          PostgreSQL COPY data to Text File 30 min
        • Lecture13.7
          PostgreSQL Clone Table 20 min
        • Lecture13.8
          Postgres Database Schema Migration 30 min
        • Lecture13.9
          PostgreSQL Database clone/migration 30 min
        • Lecture13.10
          PostgreSQL Compress backup format 30 min
        • Lecture13.11
          PostgreSQL Archivelog 30 min
        • Lecture13.12
          PostgreSQL Point In Time Recovery 30 min
        • Lecture13.13
          Taking Backup On Postgres Slave (Standby) Server 30 min
      • POSTGRESQL PERFORMANCE TUNING
        5
        • Lecture14.1
          PostgreSQL Index 30 min
        • Lecture14.2
          PostgreSQL Reindex 30 min
        • Lecture14.3
          PostgreSQL PerformanceTuning 30 min
        • Lecture14.4
          Understanding Postgres VACUUM | VACUUM FULL | VACUUM ANALYZE 30 min
        • Lecture14.5
          Postgres Autovacuum Configuration/Setup 30 min
      • HIGH AVAILABILITY, LOAD BALANCING, AND REPLICATION
        11
        • Lecture15.1
          POSTGRESQL STREAMING REPLICATION 30 min
        • Lecture15.2
          SSL Streaming replication with PostgreSQL 10 30 min
        • Lecture15.3
          How to make Linux partition and configure the network on Redhat Linux7.3 30 min
        • Lecture15.4
          How To Fix Firewall Issues while connecting the other server? 30 min
        • Lecture15.5
          How to install the PostgreSQL10 On Linux ? 30 min
        • Lecture15.6
          How to Configure the cascade replication On PostgreSQL 10.3 ? 30 min
        • Lecture15.7
          How to add extra one slave an existing PostgreSQL cascade replication without down time ? 30 min
        • Lecture15.8
          PostgreSQL Switchover 30 min
        • Lecture15.9
          Postgres Failover 30 min
        • Lecture15.10
          Postgres Upgrade 30 min
        • Lecture15.11
          PostgreSQL Upgrade 9.5 to 11.3 . 30 min

        How to install PostgreSQL10 On Linux Server ?

        PostgreSQL 10.3 installation steps:
        In this tutorial i will explain how to install postgreSQL 10 on Red Hat Enterprise Linux Server release 7.3 Beta (Maipo) and How to make network configuration and how to do linux partition for DATA , ARCHIVE, BACKUP.

        Step 1. Download the rpm from below links
        https://yum.postgresql.org/10/redhat/rhel-7-x86_64/repoview/
        (OR)
        http://www.tutorialdba.com/2017/11/oracle-and-postgresql-dba-related.html
        (OR)
        https://yum.postgresql.org/rpmchart.php 

        Step 2. Install the below mandatory rpm’s .
        1.postgresql10-libs – The shared libraries required for any PostgreSQL clients
        2.postgresql10 – PostgreSQL client programs and libraries
        3.postgresql10-server – The programs needed to create and run a PostgreSQL server
        4.postgresql10-contrib – Contributed source and binaries distributed with PostgreSQL

        [root@master postgreSQL-10]# rpm -ivh postgresql10-10.3-1PGDG.rhel7.x86_64.rpm 
        Preparing...                          ################################# [100%]
         package postgresql10-10.3-1PGDG.rhel7.x86_64 is already installed
        [root@master postgreSQL-10]# rpm -ivh postgresql10-server-10.3-1PGDG.rhel7.x86_64.rpm 
        Preparing...                          ################################# [100%]
         package postgresql10-server-10.3-1PGDG.rhel7.x86_64 is already installed
        [root@master postgreSQL-10]# rpm -ivh postgresql10-libs-10.3-1PGDG.rhel7.x86_64.rpm 
        Preparing...                          ################################# [100%]
         package postgresql10-libs-10.3-1PGDG.rhel7.x86_64 is already installed
        [root@master postgreSQL-10]# rpm -ivh postgresql10-contrib-10.3-1PGDG.rhel7.x86_64.rpm 
        Preparing...                          ################################# [100%]
         package postgresql10-contrib-10.3-1PGDG.rhel7.x86_64 is already installed

        Step 3. Intialize  the  postgres cluster .

        [root@master bin]# pwd
        /usr/pgsql-10/bin
        [root@master bin]# ls -lrt postgresql-10-setup
        -rwxr-xr-x. 1 root root 8582 Feb 27 05:16 postgresql-10-setup

        Then initialize the database:

        [root@master bin]# /usr/pgsql-10/bin/postgresql-10-setup initdb
        Initializing database ... OK

        Note:PostgreSQL data is typically found /var/lib/pgsql/10/data/ directory.

        Verify the data directory:

        [root@master bin]# /var/lib/pgsql/10/data/
        base/         pg_commit_ts/ pg_multixact/ pg_serial/    pg_stat_tmp/  pg_twophase/
        global/       pg_dynshmem/  pg_notify/    pg_snapshots/ pg_subtrans/  pg_wal/
        log/          pg_logical/   pg_replslot/  pg_stat/      pg_tblspc/    pg_xact/

        Step 4.Currently postgres is not running we need to start the postgres cluster:
        A.check the postgres cluster status:

        [root@master bin]# ps -ef|grep postgres
        root       5141   3519  0 18:41 pts/0    00:00:00 grep --color=auto postgres

        B.start the postgres cluster:

        [root@master ~]# systemctl start postgresql-10
        [root@master ~]# ps -ef|grep post
        root       2271      1  0 17:21 ?        00:00:00 /usr/libexec/postfix/master -w
        postfix    2274   2271  0 17:21 ?        00:00:00 pickup -l -t unix -u
        postfix    2275   2271  0 17:21 ?        00:00:00 qmgr -l -t unix -u
        root       5171   3519  0 18:44 pts/0    00:00:00 su postgres
        postgres   5172   5171  0 18:44 pts/0    00:00:00 bash
        postgres   5295      1  0 18:47 ?        00:00:00 /usr/pgsql-10/bin/postmaster -D /var/lib/pgsql/10/data/
        postgres   5297   5295  0 18:47 ?        00:00:00 postgres: logger process   
        postgres   5299   5295  0 18:47 ?        00:00:00 postgres: checkpointer process   
        postgres   5300   5295  0 18:47 ?        00:00:00 postgres: writer process   
        postgres   5301   5295  0 18:47 ?        00:00:00 postgres: wal writer process   
        postgres   5302   5295  0 18:47 ?        00:00:00 postgres: autovacuum launcher process   
        postgres   5303   5295  0 18:47 ?        00:00:00 postgres: stats collector process   
        postgres   5304   5295  0 18:47 ?        00:00:00 postgres: bgworker: logical replication launcher   
        root       5306   5237  0 18:47 pts/0    00:00:00 grep --color=auto post

        C. Check the database connectivity:

        [root@master ~]# psql
        psql: FATAL:  role "root" does not exist
        
        [root@master ~]# su postgres
        [postgres@master root]$ cd
        [postgres@master ~]$ psql
        psql (10.3)
        Type "help" for help.
        
        postgres=# show data_directory;
             data_directory     
        ------------------------
         /var/lib/pgsql/10/data
        (1 row)

        Step 5.  Changing data directory path.

        A. Stop the postgres server .

        [postgres@master ~]$ /usr/pgsql-10/bin/pg_ctl -D /var/lib/pgsql/10/data/ stop 
        waiting for server to shut down.... done 
        server stopped

        B. Move the Data’s  to /mnt/DATA partition:

        [postgres@master ~]$ rsync -av /var/lib/pgsql/10/data/* /mnt/DATA/
        sending incremental file list
        PG_VERSION
        current_logfiles
        pg_hba.conf
        pg_ident.conf
        postgresql.auto.conf
        postgresql.conf
        postmaster.opts
        base/
        base/1/
        base/1/112
        ...
        ..
        .
        sent 41370578 bytes  received 18299 bytes  16555550.80 bytes/sec
        total size is 41316241  speedup is 1.00

        C.  Check the data directory on postgresql.conf file

        [postgres@slave1 ~]$ cat /mnt/DATA/postgresql.conf |grep data_directory
        #data_directory = 'ConfigDir'  # use data in another directory

        As postgres user:
        change the data partition ownership.

        [postgres@master DATA]$ /usr/pgsql-10/bin/pg_ctl -D /mnt/DATA start
        waiting for server to start....2018-03-06 19:18:05.013 IST [5745] FATAL:  data directory "/mnt/DATA" has group or world access
        2018-03-06 19:18:05.013 IST [5745] DETAIL:  Permissions should be u=rwx (0700).
         stopped waiting
        pg_ctl: could not start server

        Examine the log output.

        Solution:
        changing data partion permission as 700 then start the postgres cluster.

        [postgres@master ~]$  chmod 0700 /mnt/DATA/
        [postgres@master ~]$ /usr/pgsql-10/bin/pg_ctl -D /mnt/DATA start
        waiting for server to start....2018-03-06 19:22:47.515 IST [5920] LOG:  listening on IPv6 address "::1%1", port 5432
        2018-03-06 19:22:47.515 IST [5920] LOG:  listening on IPv4 address "127.0.0.1", port 5432
        2018-03-06 19:22:47.517 IST [5920] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
        2018-03-06 19:22:47.521 IST [5920] LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
        2018-03-06 19:22:47.660 IST [5920] LOG:  redirecting log output to logging collector process
        2018-03-06 19:22:47.660 IST [5920] HINT:  Future log output will appear in directory "log".
         done
        server started

         

        Checking postgres process whether is running or not.

        [postgres@master DATA]$ ps -ef|grep postgres
        root       5171   3519  0 18:44 pts/0    00:00:00 su postgres
        postgres   5172   5171  0 18:44 pts/0    00:00:00 bash
        root       5317   5237  0 18:48 pts/0    00:00:00 su postgres
        postgres   5318   5317  0 18:48 pts/0    00:00:00 bash
        root       5876   5843  0 19:22 pts/0    00:00:00 su postgres
        postgres   5877   5876  0 19:22 pts/0    00:00:00 bash
        postgres   5920      1  0 19:22 pts/0    00:00:00 /usr/pgsql-10/bin/postgres -D /mnt/DATA
        postgres   5921   5920  0 19:22 ?        00:00:00 postgres: logger process   
        postgres   5923   5920  0 19:22 ?        00:00:00 postgres: checkpointer process   
        postgres   5924   5920  0 19:22 ?        00:00:00 postgres: writer process   
        postgres   5925   5920  0 19:22 ?        00:00:00 postgres: wal writer process   
        postgres   5926   5920  0 19:22 ?        00:00:00 postgres: autovacuum launcher process  
        postgres   5927   5920  0 19:22 ?        00:00:00 postgres: stats collector process   
        postgres   5928   5920  0 19:22 ?        00:00:00 postgres: bgworker: logical replication launcher  
        postgres   5980   5877  0 19:28 pts/0    00:00:00 ps -ef
        postgres   5981   5877  0 19:28 pts/0    00:00:00 grep --color=auto postgres

        Step 6: then put the application details on pg_hba.conf file the reload or restart the postgres server then check the postgres connectivity and check the data partition whether is updated or not in data_directory parameter.

        [postgres@master ~]$ psql 
        psql (10.3) 
        Type "help" for help. 
        postgres=# 
        postgres=# show data_directory; 
        data_directory 
        ---------------- 
        /mnt/DATA 
        (1 row)
        
        

        Prev Configure the network & Disk Partition
        Next PostgreSQL -11 Installation (rpm & source code)

        ADVERTISEMENT

        Latest Courses

        PostgreSQL Database

        PostgreSQL Database

        $600.00 $500.00
        Greenplum Database

        Greenplum Database

        $2,000.00 $1,500.00

        Preview Course

        Free

        Latest Posts

        PostgreSQL Patching version 9, 10,11
        10Oct2019
        Tools for PostgreSQL
        16Sep2019
        Postgres user creation and restrict DDL & database access
        13Sep2019

        Recent Forum Topics

        • Are you going to take your first ste
        • How to start working on an application?
        • 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 ?

        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

        Modal title

        Message modal