title: How to export users in Oracle with its roles and system privileges using expdp?
body: <p>I am trying to export a schema/user in Oracle with its roles and system privileges. I don't want to export any data or any table. I have tried to export users using the following command.</p>
  <pre><code>expdp system/system@gisdblocal include=user DIRECTORY = TestBack  
  logfile=test12.log DUMPFILE=test12.dmp SCHEMAS=test_replication
  </code></pre>
  <p>When I import this in other database or in the same database with a different name i.e</p>
  <pre><code>impdp system/system@gisdblocal DIRECTORY = TestBack  DUMPFILE = test12.dmp   
  SCHEMAS = test_replication REMAP_SCHEMA = 
  test_replication:test_replication_copy 
  </code></pre>
  <p>the user or schema is created but it has not been granted any role or system privileges.</p>
  <p>I am doing this because I have created a backup of a schema using the user that did not have the required rights <strong>DATAPUMP_IMP_FULL_DATABASE</strong> or <strong>DATAPUMP_EXP_FULL_DATABASE</strong>. When I restore that backup in another database, it says the user does not exist. Therefore, I am thinking to create a user with the same privileges first and then restore the backup.</p>