Very powerfully and simple solution for 10g+ database.

Source: Run Library Script

https://livesql.oracle.com/apex/livesql/file/content_DKGPNGUHVKH7JRGJ1TWPDGIGP.html