Can we install DB agent in the same machine where AppDynamics controller has installed?
Technically there shouldn't be any issue running a Db agent on controller machine. Since the Db agent process will be running standalone. However recommend not to run the Db agent on controller machine as it would add overhead to your controller machine.
Db agents require some minimum heap space to monitor Database instance. That is, 1 GB of heap space and an additional 512 MB of heap space for each monitored database instance.
Example, Monitoring 5 databases instances requires ( 5 x 512 MB ) + 1024 MB = 3,584 MB of heap space and this is definitely going to stress you controller hardware. Better run the Db agent on a separate host.
Many thanks for the update.
Could please suggest the minimum hardware requirement to install the DB agent which should moniotor 40+ DB collectors?