Skip to content

RootDBA

DBA expertise: PostgreSQL, SQL Server & MySQL

Menu
  • Home
  • blog
  • PostgreSql
  • MySql
  • Sql Server
  • About AHMED – Root DBA
Menu

Postgresql Dba Guide

PostgreSql stress testing database using pgbench

Posted on September 1, 2025September 1, 2025 by AHMED

pgbench is tools that used to stress test database base on deferent scenarios you can define by simulating database traffic . pgbench can help use also now our database setup limitationsand also get clear understand how our configuration will be able to tackle live use . i personly use pgbench for two propose  1- in…

Read more

Using a Separate Data Directory for Your PostgreSQL Cluster

Posted on September 1, 2025September 1, 2025 by AHMED

When installing PostgreSQL, it defaults to creating its data directory in /var/lib/postgresql. For better performance, reliability, and management, it is often recommended to relocate the PostgreSQL data directory to a dedicated disk or separate mount point. This can help with I/O performance, backup management, and isolation of database operations from the rest of the system. drop…

Read more

PostgreSql logical replication

Posted on September 1, 2025September 1, 2025 by AHMED

deferent than stream replication , where the master will send wall log , there we send the actual command such (insert into t1 values (1,”’value” )) physical replication in physical replication , the replica is force to copy the whole database schema tables and so on from master server .physical replication in this case can not…

Read more

How to failover stream replication in PostgreSQl

Posted on September 1, 2025September 1, 2025 by AHMED

verify the replication on slave server before we start the failover , we need to verified the syn between the master and slave in the slave run the below command and if its return 0 means no delay  SELECT CASE WHEN pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() THEN 0 ELSE EXTRACT(EPOCH FROM now() – pg_last_xact_replay_timestamp()) END AS log_delay;…

Read more

PostgreSql master-slave replication

Posted on September 1, 2025September 1, 2025 by AHMED

prerequisite : master slave hardware specs we will be implement master-slave streaming replication using two VMS running ubuntu 22 jammyboth node will have PostgreSQL 12 installed , and configured with ip in same subnetbelow are VM details .1.postgresqlDB01 : 10.10.10.772.postgresqlDB02 : 10.10.10.78 installing PostgreSQL first check if PostgreSQL 12 is available in Ubuntu repositories using…

Read more

PostgreSql Maintenance in PostgreSQL

Posted on September 1, 2025September 1, 2025 by AHMED

type of backup 1. logical backup A logical backup refers to the process of converting the data in a database into a straightforward text format. This typically involves creating scripts of the database, table, or database cluster, which are then saved as SQL files. The scripts for tables and databases are composed of SQL statements….

Read more

PostgreSql backup and restore

Posted on September 1, 2025September 1, 2025 by AHMED

${toc} type of backup 1. logical backup A logical backup refers to the process of converting the data in a database into a straightforward text format. This typically involves creating scripts of the database, table, or database cluster, which are then saved as SQL files. The scripts for tables and databases are composed of SQL…

Read more

PostgreSql table inheritance , table partion

Posted on September 1, 2025September 1, 2025 by AHMED

table inheritance To convey the idea that child tables inherit all columns from the parent master table while also allowing child tables to have additional fields, with the ability to specify the “ONLY” keyword for queries on specific tables, you can rewrite the statement as follows: “We enable child tables to inherit all columns from…

Read more

Postgresql configuration files

Posted on September 1, 2025September 1, 2025 by AHMED

postgresql.conf the file is located in data directory of the cluster  default is located in /etc/postgresql/13/main/  check parameter of PostgreSQL inside pgSQL console the parameter you saw in the file can also be viewed in the psql console itselfto check and verified whether they enabled or not , and what is the parameter set for itfor…

Read more

PostgreSQL Directory layout

Posted on September 1, 2025September 1, 2025 by AHMED

${toc} installation directory layout PostgreSQL is typicality installed to /usr/lib/postgresql/the same directory structure is the same both on windows and Linux.,now we will discussed the content of installation  bin folder here you will find all PostgreSQL utility files such as initdb a& bg_ctl data the folder is located in default cluster and might change depend on if there multilabel…

Read more
  • Previous
  • 1
  • 2
  • 3
  • Next
© 2025 RootDBA | Powered by Minimalist Blog WordPress Theme