Yeah, either get a very large database, or don't do it in database.
If you have a database with lots of CPUs and memory, you can turn parallelism on the tables. This will make a lot of your sqls execute faster because internally, oracle will execute the query on multiple threads. Note that this can overload the database, and anything else that is going on at the same time in the database will be affected.
Another way of doing this is to use cloud technologies like Apache Hadoop and use map reduce
pattern. This way, you extract the data out of oracle, slice it up into chunks, and distribute the chunks to many machines. Each machine performs the calculations on its own chunk, and sends the results back to the database. This solution can scale a lot better than a database based solution, but is more difficult to implement.