I got a question from customer how can he get a list of Oracle Instances that are running on machines that have more than 2 logical CPU's. I guess such request administrators get on a daily basis. The task seems to be quite easy as long as you have your environment fully discovered. I went to dist/sdk/bin directory and run following query:
./api.sh -u administrator find "select SID,host.fqdn,host.memorySize from OracleInstance where host.numCPUs > 2"
In my case where I have two Oracle Instances the output was:
<OracleInstance array="1" guid="72B99E1FD7193E6FA7F069E495C4087A"
So the second instance is running on a Computer that has 2 or less logical CPU's. I confirmed that and moved to next issue. What if we don't have everything discovered but we want to know that on some target machine Oracle is running. To do that , we can use StackScanSensor. I'm assuming that Oracle listens on port 1521. I ran a Level 1 discovery of few more machines and run following API query. Please note that I have limited output to Computers that have lower than 100 OS confidence level.
./api.sh -u administrator -p test find "select fqdn,ipInterfaces.portList from ComputerSystem WHERE EXISTS (ipInterfaces.portList contains '1521' and OSRunning.OSConfidence < '100')"
In the output I got this Computer:
<ComputerSystem array="1" guid="72E718E4BB68373EA4571E07AB986380"
In my case I knew password for this machine so I added it in the Access List. I ran Level 3 discovery and I checked if new machine meets my hardware expections that were set in the first question.
Unfortunately this machine has 2 logical CPU but it has quite a lot of memory:
<OracleInstance array="3" guid="9B807CD3C0863E7C8D0A38A44AA1AE9A"
If you get such request very often it would be good to think about writing a Birt report. I know that people look for database tables where we store such kind of information. Therefore I checked that portList is kept in table IPINTRFC, PORTLIST_X column.
Finding databases that are running on fast computers
Andrzej Wrobel 270000SCM9 email@example.com Tags:  api find count database cpu 1,332 Visits