Do we need tonopen any database ports for monitoring the Appinsight for SQL and for Oracle database or MSSQL
Yes, SolarWinds will connect to the port the db-engine is listening on. Default TCP/1433 for MS SQL.
So from the polling engine, to the monitored server, on the port the engine is listening on.