Posts

Showing posts with the label How to query sql for latest record in the table

Bash - Execute Pl/Sql script from Shell script

Hi, I am Malathi Boggavarapu working at Volvo Group and i live in Gothenburg, Sweden. I have been working on Java since several years and had vast experience and knowledge across various technologies. In this post we see how to build a bash script which executes pl/sql script, retrieve data and send it to graphite server using NetCat. We also go through various basic bash commands such as do/while, nc and also we use bash functions too. NetCat is used to connect to the servers and stream out the data to them. You can visit wiki to get basic understanding about it.  https://en.wikipedia.org/wiki/Netcat To understand what graphite is visit the following link https://graphiteapp.org/ Now let's start with pl/sql script to retrieve data inorder to send it to graphite server. Pl/sql script A table holds the size of each table exists in the database every 24hrs. The query is to get the latest record of each table and it's size and some other columns too.