Infrastructure at your Service

Category Archives: Database Administration & Monitoring

Daniel Westermann

SQL Interpolation with psql

By | Database Administration & Monitoring | One Comment

The PostgreSQL psql utility provides some really nice features. One of these features is SQL interpolation which allows us to do interesting things, e.g. reading files and analyze the results directly in the database. This post will show how to use this by reading and analyzing sar files of a linux server. Usually linux hosts store sar statistics in the /var/log/sa directory: ls /var/log/sa sa02 sa03 sa04 sa05 sa06 sa07 sa08 sa09 sa10 sa11 sa12…

 
Read More
Daniel Westermann

A free PostgreSQL cloud database?

By | Database Administration & Monitoring | One Comment

Recently I was looking for a free PostgreSQL cloud database service for testing. Why? Because I’d like to use such a cloud instance for testing no matter on which workstation or OS I am currently on. Another reason is, that I could could prepare some demos at home and use the same demos at work without needing to worry about taking the database with me each time. There are probable many more services than the…

 
Read More
Daniel Westermann

PostgreSQL portable?

By | Database Administration & Monitoring | One Comment

What a surprise: Headed over to the sourceforge page, downloaded, installed (which is just a matter of next/next/next) : Not really the latest patchset but far more than I expected So I can do tests on a Windows machine where I do not have any permissions to install software. Great. If you prefer a graphical client then go ahead and use the portable version of PgAdmin.  

 
Read More
Nathan Courtine

Get the main information from Windows Server with PowerShell

By | Database Administration & Monitoring | No Comments

This blog will present you a way to retrieve Windows Server main information via PowerShell. The goal is to be able to automate the extraction of information for different purposes: audit, report generation, dashboards…   Disclaimer: I am not a developer but a SQL Server dba. If you find errors or some ways of improvement, I will be glad to read your comments!     Computer System information First, I initialize the WMI object containing…

 
Read More
Oracle Team

Flashback logging overhead: ‘db file sequential read’ on UNDO tablespace

By | Database Administration & Monitoring, Oracle | No Comments

By Franck Pachot . in my previous post I’ve reproduced an issue where some bulk insert into a GTT was generating too much undo. But the real case I encountered was worse: the insert was reading lot of UNDO. And lot of this undo was read from disk. Jonathan Lewis has pointed me to a possible explanation he has given (here) I’ve reproduced the testcase from the previous post after setting the database to do…

 
Read More
Oracle Team

Oracle: an unexpected lock behavior with rollback

By | Database Administration & Monitoring, Oracle | No Comments

By Franck Pachot . Here is an odd Oracle behavior I observed when a transaction that acquired a lock is rolled back. Note that this is related to a specific combination of locks that should not be encountered in production. So it’s not a bug. Just something unexpected.   First session In my first session I lock the DEPT table in share mode (RS) 20:56:56 SQL1> lock table dept in row share mode; Table(s) Locked….

 
Read More
Oracle Team

Oracle 12.1.0.2: Wait event histograms in μs

By | Database Administration & Monitoring, Oracle | 2 Comments

By Franck Pachot . When an Oracle Database spends a high percentage of its DB time in User I/O, I usually check the wait event histograms in order to see if the storage system is working well. But today, with storage going to SSD, most I/O are less than 1 milliseconds and we have no details about those wait times. Here is what is exposed by V$WAIT_EVENT_HISTOGRAM:   select event,wait_time_milli,wait_count from v$event_histogram where event like…

 
Read More
Oracle Team

Linux: how to monitor the nproc limit

By | Database Administration & Monitoring, Oracle | 16 Comments

By Franck Pachot . You probably know about ‘nproc’ limits in Linux which are set in /etc/limits.conf and checked with ‘ulimit -u’. But do you know how to handle the monitoring and be alerted when you’re close the fixed limit? Nproc and ps Nproc is defined at OS level to limit the number of processes per user. Oracle 11.2.0.4 documentation recommends the following: oracle soft nproc 2047 oracle hard nproc 16384 But that is often…

 
Read More
Oracle Team

Oracle Exadata – poor optimization for FIRST_ROWS

By | Database Administration & Monitoring, Oracle | 3 Comments

By Franck Pachot . In a previous blog, I discussed the difference between rownum and row_number(), in particular their behaviour in implicitely adding a first_rows(n) to the optimizer. That reminded me that I forgot to blog about an issue I encountered and which concerns both approaches. It was on an Exadata: a nice full table scan with smartscan was taking a long time. And forcing to an index access – with a very bad index…

 
Read More
Oracle Team

Best practice for the sending of an Oracle execution plan

By | Database Administration & Monitoring, Oracle | 5 Comments

By Franck Pachot . You have a query that takes too long and you want help to analyze the execution plan? Then you need to get it with relevant information, and correctly formatted. Autotrace is not a good option as it does not bind the variables in the same way as your application. Explain plan only shows estimations, but if we have a performance issue, this probably means that the estimation is wrong. I prefer…

 
Read More