Is there something like pg_query for Oracle ? I want to use it for making AST's out of Oracle SQL queries

Is there even a grammar for Oracle SQL? I took a swing at trying to slurp it out of the "alt text" of the railroad images in the many, many html files in (e.g. https://docs.oracle.com/en/database/oracle/oracle-database/2... -> https://docs.oracle.com/en/database/oracle/oracle-database/2... ) but then I thankfully moved off any project from that point on that used Oracle and let it go

I'm aware of https://github.com/orafce/orafce and https://github.com/pgoracle before that (the commit history also references ora2pg and searching for that surfaces https://github.com/darold/ora2pg which was just updated yesterday!) but I've never tried to use any of them in anger

There are firewalls that claim to do deep packet inspection of Oracle queries for security. They are not without faults.

Perhaps you could directly use or decompile the OCI libs. Though that probably is against some license.