Will a database server perform better running on 2 CPUs with 16 cores or 4 CPUs with 8 cores?
There are two factors you want to look at:
Total aggregate performance: This is the measure of the total computing power of all the cores on the box. You can estimate this value by looking at the Passmark CPU rating for the CPU and multiplying by the number of physical CPUs in the system.
Single-thread performance: This is the measure of how much computing power the CPU can give to a single thread. You can estimate this value by looking at the Passmark CPU rating for the CPU and dividing by the number of cores in the CPU. (For hyper-threaded CPUs, divide by 1.25 times the number of physical cores.)
If one machine wins on both of these measures, it's probably your best choice. If it's split on the two measures, then it comes down to how effectively your software can take advantage of multiple cores.
Note that memory performance can be important too. More memory channels typically means faster memory access. Also, of course, the total amount of memory is important. Different CPUs often mean different motherboards, which can mean different memory performance.
Having approximately equal BogoMIPSes, I'd say you should estimate overall L1/L2 cache volume in both cases — the biggest is the winner.
You'll also need to know the NUMA configuration. If you'll have just a single NUMA node or multiple NUMA nodes. I know that SQL Server is NUMA aware, and I assume that Oracle is as well. This can have a big impact on database performance as getting access to memory in the same NUMA node is much faster than accessing memory in another NUMA node.