Page 1 of 1

Best practice for setting port on DBMonitor

Posted: Thu 04 Jun 2015 17:16
by mikeho
Going old school with DBMonitor here... :)

When multiple people open a DBmonitor session, right now the first session open captures ALL the messages because the port # is defaulted to 1000.

Is there a best practice to automatically set the OraSQLMonitor.DBMonitorOptions.Port each time an app runs so that each developer can see their messages on their monitor? Currently I am doing:

FPid: integer;

FPid := Integer(GetCurrentProcessID) mod MAXWORD; // This makes sure it is limited to Max Windows Ports
OraSQLMonitor.DBMonitorOptions.Port := FPid;

Then in a Oracle Information pop up I have, I have added the Port # information for the user to set in DBMonitor.

Problem is that this may get into standard TCP/IP Ports (21, 80, 8000, 8080, etc.)

Any thoughts on a better process?

Re: Best practice for setting port on DBMonitor

Posted: Tue 09 Jun 2015 08:59
by AlexP
Hello,

In addition to that you can get standard ports on random selection, the retrieved port may be blocked by antivirus, firewall or another process. So, to ensure getting a free port, you should also check ports (port scanner).

Re: Best practice for setting port on DBMonitor

Posted: Mon 15 Jun 2015 19:54
by mikeho
Well we went another route. We decided to incorporate a circular Oracle sequence of 3000 or so numbers that we knew were not used as standard tpc/ip ports within Windows.

Now we just get the NextVal from the sequence and adjust the Port on the DBMonitor,

Re: Best practice for setting port on DBMonitor

Posted: Tue 16 Jun 2015 08:03
by AlexP
As I wrote earlier, you can use any method for port number retrieving. However, without a check for availability, this port may already be busy or locked.