Question : Oracle Export and Import

Do I need to change the enviroment setting when executing the command exp/imp?  For instance, I want to refresh test data with production data. Test and production databases are located in two different SERVERS. Should I go to the production enviroment to execute the exp command and then go to Test enviroment to execute the imp command?

Secondly, how do I come up with an exp/imp command to exp/imp everything except ROLES?

Thanks

Answer : Oracle Export and Import

Yes, that is safest, to physically do the import on the test server, to minimize mistakes.

But if you have tnsnames.ora configured, you can do the export and import from test server using a remote alias

# Note the export uses @PROD but the import uses a local connection (ORACLE_SID in environment)
exp fred/password@PROD file=prod.dmp
imp system/admin fromuser=fred touser=fred file=prod.dmp

Regarding roles, there is not an option specific for roles, just do a schema level export, like I showed above, and there will be no privileges/roles imported.
Random Solutions  
 
programming4us programming4us