title: Regenerate GRANTs for roles across schemas
body: <p>Similar to <a href="https://stackoverflow.com/questions/2093949/how-to-find-out-if-select-grant-is-obtained-directly-or-through-a-role">this question</a>, I would like to know how to generate all <code>GRANT</code> statements issued to all roles in a set of schemas and a list of roles whose names end in "PROXY". I want to recreate statements like:</p>
  
  <pre><code>GRANT SELECT ON TABLE_NAME TO ROLE_NAME;
  GRANT EXECUTE ON PACKAGE_NAME TO ROLE_NAME;
  </code></pre>
  
  <p>The purpose is to help migrate from a development database to a testing database (Oracle 11g). There are some tools that attempt to do this automatically, but often fail.</p>
  
  <p>Any ideas?</p>