title: Backup and recover user roles oracle
body: <p>Is it possible to backup user roles (not the whole DB) with a script or is there some backup function in oracle 11 ?
  I want to backup the users and restore them later by script, this should be used as a backup against mis configurations.</p>
  
  <p>DBA_USERS
  DBA_ROLES
  DBA_ROLE_PRIVS
  ROLE_TAB_PRIVS
  SESSION_PRIVS
  SESSION_ROLES
  TABLE_PRIVILEGES</p>
  
  <p>Currently, i can query or create views of the tables that store most of the user settings. But creating roles and granting right on tables from that source involves a lot of text transformation.
  view > store to file > concat convert them to create/grant > execute script on commandline</p>
  
  <p>Is there another way to export AND import user rights and roles and the way they are assigned to tables ? Or can i simply backup and restore the tables mentioned in this question without braking the DB?</p>