• 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
    • Company Registration Services
    • Virtual Office Space Address
  • Company
    • FAQs
    • About Us
    • Contact
  • Locations
  • Blogs
    • Blog
    • Blog – PostgreSQL Support
    • Blog – PostgreSQL Migration
    • Blog – All DB’s
    • Blog – Linux
  • Courses

    About Courses

    • List Of Courses
    • Become an Instructor
    Greenplum

    Greenplum

    $1,500.00
    Read More
    Have any question?
    (+91)8838953252
    ITsupport@rayafeel.com
    Login
    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
      • Company Registration Services
      • Virtual Office Space Address
    • Company
      • FAQs
      • About Us
      • Contact
    • Locations
    • Blogs
      • Blog
      • Blog – PostgreSQL Support
      • Blog – PostgreSQL Migration
      • Blog – All DB’s
      • Blog – Linux
    • Courses

      About Courses

      • List Of Courses
      • Become an Instructor
      Greenplum

      Greenplum

      $1,500.00
      Read More

      Blog

      • Home
      • Blog
      • Blog
      • postgreSQL restoration simple 4 steps

      postgreSQL restoration simple 4 steps

      • Posted by 2ndnijam
      • Categories Blog
      • Date January 11, 2019
      • Comments 0 comment

      Before Restoring & creating the database you have to restore the appropriate roles and have to give appropriate roles permission

      Step 1.bakup the roles by using following command
      Taking postgres Roles only backup :

      pg_dumpall -h localhost -p 5432 U enterprisedb -v --roles-only -f "/path/to/Preprod_roles_01012019.sql"

      Step 2. Restoring the database roles it is the prerequest of postgres database restoration :

      psql -U enterprisedb -d edb -f "D:\tutorialdba\Preprod_roles_01012019.sql"

      Step 3. create the database with granting roles permission:

      CREATE DATABASE "tdba_dc"
        WITH OWNER = enterprisedb
             ENCODING = 'UTF8'
             TABLESPACE = pg_default
             LC_COLLATE = 'English_United States.1252'
             LC_CTYPE = 'English_United States.1252'
             CONNECTION LIMIT = -1;
      GRANT ALL ON DATABASE "tdba_dc" TO public;
      GRANT ALL ON DATABASE "tdba_dc" TO crm;
      GRANT ALL ON DATABASE "tdba_dc" TO adt;
      GRANT ALL ON DATABASE "tdba_dc" TO ahc;
      GRANT ALL ON DATABASE "tdba_dc" TO amb;
      GRANT ALL ON DATABASE "tdba_dc" TO bb;
      GRANT ALL ON DATABASE "tdba_dc" TO billing;
      GRANT ALL ON DATABASE "tdba_dc" TO digital;
      GRANT ALL ON DATABASE "tdba_dc" TO ehis;
      GRANT ALL ON DATABASE "tdba_dc" TO ehisinterface;
      GRANT ALL ON DATABASE "tdba_dc" TO es;
      GRANT ALL ON DATABASE "tdba_dc" TO fb;
      GRANT ALL ON DATABASE "tdba_dc" TO formgen;
      GRANT ALL ON DATABASE "tdba_dc" TO hl7;
      GRANT ALL ON DATABASE "tdba_dc" TO hr;
      GRANT ALL ON DATABASE "tdba_dc" TO lab;
      GRANT ALL ON DATABASE "tdba_dc" TO labequip;
      GRANT ALL ON DATABASE "tdba_dc" TO lhk;
      GRANT ALL ON DATABASE "tdba_dc" TO mis;
      GRANT ALL ON DATABASE "tdba_dc" TO mm;
      GRANT ALL ON DATABASE "tdba_dc" TO mnm;
      GRANT ALL ON DATABASE "tdba_dc" TO ot;
      GRANT ALL ON DATABASE "tdba_dc" TO payroll;
      GRANT ALL ON DATABASE "tdba_dc" TO pharmacy;
      GRANT ALL ON DATABASE "tdba_dc" TO prm;
      GRANT ALL ON DATABASE "tdba_dc" TO process;
      GRANT ALL ON DATABASE "tdba_dc" TO radiology;
      GRANT ALL ON DATABASE "tdba_dc" TO registration;
      GRANT ALL ON DATABASE "tdba_dc" TO security;
      GRANT ALL ON DATABASE "tdba_dc" TO timecard;
      GRANT ALL ON DATABASE "tdba_dc" TO wards;
      
      ####################################################
      CREATE DATABASE "tdba_lc"
        WITH OWNER = crm
             ENCODING = 'UTF8'
             TABLESPACE = pg_default
             LC_COLLATE = 'English_United States.1252'
             LC_CTYPE = 'English_United States.1252'
             CONNECTION LIMIT = -1;
      GRANT ALL ON DATABASE "tdba_lc" TO public;
      GRANT ALL ON DATABASE "tdba_lc" TO crm;
      GRANT ALL ON DATABASE "tdba_lc" TO adt;
      GRANT ALL ON DATABASE "tdba_lc" TO ahc;
      GRANT ALL ON DATABASE "tdba_lc" TO amb;
      GRANT ALL ON DATABASE "tdba_lc" TO bb;
      GRANT ALL ON DATABASE "tdba_lc" TO billing;
      GRANT ALL ON DATABASE "tdba_lc" TO digital;
      GRANT ALL ON DATABASE "tdba_lc" TO ehis;
      GRANT ALL ON DATABASE "tdba_lc" TO ehisinterface;
      GRANT ALL ON DATABASE "tdba_lc" TO es;
      GRANT ALL ON DATABASE "tdba_lc" TO fb;
      GRANT ALL ON DATABASE "tdba_lc" TO formgen;
      GRANT ALL ON DATABASE "tdba_lc" TO hl7;
      GRANT ALL ON DATABASE "tdba_lc" TO hr;
      GRANT ALL ON DATABASE "tdba_lc" TO lab;
      GRANT ALL ON DATABASE "tdba_lc" TO labequip;
      GRANT ALL ON DATABASE "tdba_lc" TO lhk;
      GRANT ALL ON DATABASE "tdba_lc" TO mis;
      GRANT ALL ON DATABASE "tdba_lc" TO mm;
      GRANT ALL ON DATABASE "tdba_lc" TO mnm;
      GRANT ALL ON DATABASE "tdba_lc" TO ot;
      GRANT ALL ON DATABASE "tdba_lc" TO payroll;
      GRANT ALL ON DATABASE "tdba_lc" TO pharmacy;
      GRANT ALL ON DATABASE "tdba_lc" TO prm;
      GRANT ALL ON DATABASE "tdba_lc" TO process;
      GRANT ALL ON DATABASE "tdba_lc" TO radiology;
      GRANT ALL ON DATABASE "tdba_lc" TO registration;
      GRANT ALL ON DATABASE "tdba_lc" TO security;
      GRANT ALL ON DATABASE "tdba_lc" TO timecard;
      GRANT ALL ON DATABASE "tdba_lc" TO wards;

      Step 4. restore the database backup by following psql utility :

      psql -U enterprisedb -d "tdba_dc" -f "D:\InCampusDB\HealthCraft_DC_daily_5.sql"
      psql -U enterprisedb -d "tdba_lc" -f "D:\InCampusDB\HealthCraft_LC_daily_5.sql"

      • Share:
      2ndnijam

      Previous post

      Taking PostgreSQL Basebackup script
      January 11, 2019

      Next post

      Install and Secure Latest Memcached on CentOS
      January 12, 2019

      Leave A Reply

      You must be logged in to post a comment.

      Connect with



      Search

      ADVERTISEMENT

      Latest Posts

      Tips to Choose the Best Serviced Office for Your Business
      24May2022
      What key considerations do you need to keep in mind when choosing a new serviced office to house your business?
      24May2022
      The Benefits of Coworking
      24May2022
      The Long-Term Impact of Coworking
      24May2022
      Are you spending more money than you earn? Outsource with Ease and Move When You’re Ready
      24May2022
      PostgreSQL

      PostgreSQL

      $800.00 $500.00
      Greenplum

      Greenplum

      $1,500.00
      Oracle Database

      Oracle Database

      $350.00
      2ndquadrant.in

      (+91) 8838953252

      ITsupport@rayafeel.com

      Company

      • About Us
      • Our Team

      COURSES

      • List Of Course
      • Become An Instructor

      Support

      • DBA Support
      • Consultancy Services

      Recommend

      • Login
      • Contact Us

      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

      Connect with

      Login with Google Login with Twitter Login with Linkedin Login with Windowslive Login with Yahoo

      Login with your site account

      Connect with



      Lost your password?