Posts

Showing posts with the label PostgreSQL interview Q&A
Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

How to verifiy postgres dump correct or not?

1.Mention log  file as "backup successfull" at the time of backup completed. 2.count the row count some specific table if you want to move cloud or other server need down time only for insert,update,delete statement. 3.write shell script for mail alert if pg_dump successfull or not ? su postgres "pg_dump our_database 2>> $LOG_FILE | gzip > /home/smb/shared/database_backup.bak.gz" cat $LOG_FILE | mailx $MAINTAINERS -s "Postgresql backup" LOG_FILE=/tmp/pgdump.err if ! pg_dump -U backupuser "our_database" 2> $LOG_FILE then cat $LOG_FILE | mailx 'youremailaddress' -s "Postgresql backup failure!" fi 4.pgBackRest: PostgreSQL has supported page-level checksums since 9.3. If page checksums are enabled pgBackRest will validate the checksums for every file that is copied during a backup. All page checksums are validated during a full backup and checksums in files that have changed are validated during differential a...

what is the difference between rsync and scp in linux ?

RSYNC: 1.incrementanl data's 2.rsync will not be faster but data's integrity and If you repeat the copy, rsync may be faster as it only transfers differences in files. 3.rsync isn't necessarily encrypted and not more secure if want use rsync -avze ssh, then rsync would be as secure 4.Before a file is transferred rsync takes the checksums,After a file is transferred the receiver verifies the data integrity 5.rsync can also exclude certain subdirectories/files using the --exclude flag, scp can't do that. 6.-P flag which will display a progress 7. it automatically verifies if the transferred file has been transferred correctly. Scp will not do that, Example: Sending folder to remote location using rsync   # rsync -avzWe ssh --include 'R*' --exclude '*' --progress oracle@192.168.2.181:/home/oracle # rsync -avzWe ssh   --progress /home/oracle/database oracle@192.168.2.181:/home/oracle/ W-you can see the bandwidth SCP 1.Overwrite the data's 2.scp will be...

PostgreSQL Query Slow or Particular Job Slow

1.Find out any network issues or not 2.Check any code/query changed or not. 3.Take Explain plan then check indexe used or not   Force index scan --> Seq_scan=false,   rebuild index-->pg_index,pg_stat_all_indexes    Find vaccum analyze-->pg_stat_all_tables   check join condition   check no.of process id in client connection    USING:        select count(*) from pg_stat_activity        select backend from pg_stat_database

what are the steps in PostgreSQL Replication and tell with prerequest and postrequest?

Prerequest: 1.We will determine the mount points of the Postgresql data directories and the WAL  directories. 2.Check the ip address,port number and hostname, of the master server using "hostname -i,hostname" if using linux this is for knowledge purposes. 3.Allocate the mount point directories  for data and wal   4.Set the the ip address and check the availability of port number at slave server using "netstat -na" 5.Check the firewall whether enable or not for both server of master and slave using  "service iptables status"  if firewall is enabled you need to disable using  "service iptables stop" "or chkconfig ip6tables off". 6.Check the both server whether ping or not using "ping master ip from slave server and ping slave ip from master server" Replication steps: 1.install the postgres software on salve server 2.On the master, edit the $PGDATA/postgresql.conf wal_level = hot_standby archive_mode = on ## /pgdata/...

PostgreSQL Interview Q & A For Experience -2

1.how to set up pgbouncer connection pooling with postgres? Postgreslq PgBouncer SetUp 2.what is ur backup startegy? Daily taking basebaackup,if client request to taking particular objects means i will use pg_dump,pg_dumpall is used taking full cluser backup. 3.what is ur database size,and how long ur taking backup; our environment db size is 500gb totally we have 60 db 4.why we use hot standby and slave? Rplication provides a comprehensive set of services that create, maintain, manage, and monitor one or more slave(standby database) to enable production postgres server to survive disasters and data corruptions.  Rplication maintains these slave databases as transactionally consistent copies of the production database. 5 .if iam selecting select queriy in slaven,if it is wrok or not? only hot and streaming replication standby only will be permit to use select query, but warm standby will not be permit to use select query we cannot connect to the standby if warm standby...

PostgreSQL Interview Q & A For Experience -1

1.what is ur roles and responsibilites?   YOU CAN TELL UR DAILY ACTIVITIES 2.Are you facing any critical issues?   you can tell some postgres errors  3.you  are in support,the client send to ticket it an critical issue,what u do? 4.how do you  manage the seviarity  issues? first i will infrom to my team leader if im team leader means i will inform my client after that i will find out issues and i will fix it with my team members 5.ITIL(infrastructre library) Information Technology Infrastructure Library 6.how many servers are u having?  it is  depend on your environment,our environment is maintaining 12 server 2 for production 4 for testing 2 for developing 2 fro application 2 for slave(replication) 7.what ur team size? mostly team size will be 4 to 8 members. 8.any issues face on application side? If you faced any errors in application side you can tell with solution 9.what is backup stargeies?how many time's to take full dat...