Table of Contents
What is included in this blog post ?
This is Part 3 of the “Postgres for Oracle DBAs” series where we compare Postgres log and Oracle alert log. We covered 1) Default tablespaces 2) Executing sql scripts 3) Shutdown modes 4) Startup modes in part 1 and part 2
Oracle Alert log Vs Postgres log - How to find the location of log ?
As a DBA once you login to a server you may want to find the location of your log . Below is the comparison (NOTE – There are other methods as well and we are giving one popular method here)
Oracle Vs Postgres - What are the events captured in logs ?
Below is the comparison of events captured in logs – These are just sample events and there are many more that are not listed here
Oracle Vs Postgres - Sample log contents
Below diagram compares log contents (an excerpt from the log)
Oracle Vs Postgres - Log maintenance
As a DBA one of the common tasks is to maintain db logs – You need to keep rotating logs (According to your retention policy)
In Oracle people use Linux logrotate as shown below – Similar thing can be achieved in Postgres as well . Oracle DBAs also schedule log rotation via cron and we can do the same in Postgres as well
In addition to Linux logrotate , you can also use params like below in Postgres to enable rotation
Postgres log - Important params
In Postgres there are ton of logging related params. Below are some common ones – For example , If you want to log lock waits you need to have log_lock_waits set to ‘on’ or if you want to check for temp files you need to have log_temp_files set to ‘on’
Oracle Vs Postgres - Log comparison
- In Postgres queries are logged and people check postgres logs to find slow queries , query issues etc.. In Oracle alert log is not used to track slow queries generally and instead v$ views,AWR etc.. are used to troubleshoot query issues
- You can write user logged events in Oracle alert log
- In Oracle you have trace files, dumps,ADRCI etc and Postgres does not have similar concept of trace files ,ADRCI ,..
- Typically Oracle DBAs open a support ticket and send the needed log files and trace files ; In Postgres world we dont have paid support if you are using community version (Ofcourse you can buy paid support from different vendors but that is optional)
- In Oracle you can also use graphical interface to read events but in Postgres it is mostly commandline unless you buy a paid product
- In both Oracle and Postgres you can use linux logrotate to manage your logs
In part 3 of the series “Postgres for Oracle DBAs” we compared alert log and postgres log . Please also read part 1 and part 2
Also check our performance articles –Pg_fincore and pg_buffercache to troubleshoot performance issues , Pgbouncer multiple instances(How we increased our TPS using multiple instances) , Postgres and temporary files , Pgpool and performance tuning, How we improved Lambda performance by 130x etc..
Looking for Postgres support ? Please reach us at firstname.lastname@example.org