When managing PostgreSQL databases in production environments, one of the biggest challenges is identifying which queries and processes are consuming the most resources. Although PostgreSQL has great tools like pg_stat_statements, we often need historical… read more
How to find alerts in PostgreSQL through Plain Text Logs with a query
As Database Administrators, we are used to reading alerts as normal tables from v$diag_alert_ext with simple SQL queries in environments like Oracle. In PostgreSQL, things are a little different, by default its logs are plain text… read more
How to find the size of tables in a PostgreSQL database
When managing production databases, sooner or later there will come a time when the available disk space starts to decrease dangerously. The crucial question then is which table is eating up the space. In this article we will see… read more
How can we get email whenever PGA memory exceeds a limit in Oracle database
When an Oracle database is heavily used by many connections / sessions, one or some of them may consume a large percentage of memory (RAM). If there is a problem and it is not addressed due to lack of memory it may… read more
How can we see what CPU Usage we had per minute in SQL Server
SQL Server during its installation creates a lightweight Extended Event with a size of up to 5mb in which it records performance information. This Extended Event is called system_health and in this article we will see how we can with… read more
How can we get emails whenever we have high CPU Usage in SQL Server
In this article we will see a script that creates a SQL Server Agent Job that will notify us by email whenever the CPU exceeds a threshold. It derives the information not from performance counters of the operating system but... read more
How can we get email whenever Tablespace needs Datafile in Oracle database
In Oracle databases tables are stored in logical entities called Tablespaces. Each Tablespace consists of physical files called Datafiles. In Oracle, however, each datafile can have a maximum size of up to 32GB, because of this... read more
How do we find what queries are currently running in SQL Server?
Many times we will need to quickly find out what queries are running in an instance of SQL Server. In this article we will see a query that I have written that can directly extract all the information we need. The query retrieves… read more
How can we get email whenever an error occurs in SQL Server Error Log
In an instance of SQL Server, potential problems that occur are recorded in a place called the Error Log. However, it would be very useful for us if any important error appeared in the Error Log, SQL Server forwarded it to us... read more
