Written by Eddy Coppens
Posted By Tony Andrews
If you would have asked me one month ago to come up with a query that coughs up missing numbers, I would have told you that there is no such a need … until a few days ago.
In preparation of a migration of our Db2 (LUW) instances from one hardware platform to another we saw that we exhausted all our IP ports. Counting the number of instances per environment indicated some of the IP port ranges were missed. It is not that we would not be able to find them if we were to look for open ranges, but that would minimize the re-usability of it. As we register the used IP ports into a database, a repeatable query could come to the rescue.
The wisdom of the internet helped us out more than once, but we got it glued together.
The follow conventions are at play:
· use only port numbers between 50500 and 59999
· a range starts with a number ending with a zero and end with a number ending with a 9
· within a [0-9] range, every ending number is an indicator for another environment
o an instance can exist within a maximum of 10 environments
· the IP port numbers are registered in the table IDUG.INSTANCE_INFORMATION
· instance idug[environment]1
o development (ends with 0)
o user acceptance testing (ends with 5)
o production (ends with 6)
o bi (ends with 7)
The above elements would have as a result: