What is the best way to copy schema from one user/instance/server:
jdbc:oracle:thin:@deeb02:1535:DH, user pov
to another user/instance/serv
Use oracle exp
utility to take a dump of the schema from the first database
exp user1/pass1@db1 owner=user1 file=user1.dmp log=user1.log
Then use imp
utility to populate the other schema in the other datbase
imp user2/pass2@db2 fromuser=user1 touser=user2 file=user1.dmp log=user2.log
you can directly copy schema via network (without moving files from one server to another) using datapump parameter NETWORK LINK as described here:
http://vishwanath-dbahelp.blogspot.com/2011/09/network-link-in-datapump.html
for example:
impdp -userid user/pass@destination_server LOGFILE=log.txt NETWORK_LINK=dblink_from_dest_to_source SCHEMAS=schema1 directory=DATA_PUMP_DIR
check that directory DATA_PUMP_DIR exists in
select *
from dba_directories
and points to correct place in destination_server file system.
Similarly, if you're using Oracle 10g+, you should be able to make this work with Data Pump:
expdp user1/pass1@db1 directory=dp_out schemas=user1 dumpfile=user1.dmp logfile=user1.log
And to import:
impdp user2/pass2@db2 directory=dp_out remap_schema=user1:user2 dumpfile=user1.dmp logfile=user2.log