November 30, 2015

Importing / Exporting oracle tables

Again, a summary of how tables are exported and imported using oracle tools:


--Exporting a table
exp userid=\'/ as sysdba\'  file='/tmp/emp.dmp' tables=sapsr3db.KMC_WF_SUBSTITUTE log='/tmp/emp.log' rows=yes indexes=yes
exp userid=\'/ as sysdba\'  file='/tmp/emp.dmp' tables=SAPSR3.DDNTF_CONV_UC log='/tmp/emp.log' rows=no indexes=yes
exp userid=\'/ as sysdba\'  file='/tmp/emp2.dmp' tables=SAPSR3.DDNTT_CONV_UC log='/tmp/emp2.log' rows=no indexes=yes

--Drop or truncate the table if required before importing,
drop TABLE SAPSR3DB.KMC_WF_SUBSTITUTE;

--Importing a table
imp userid=\'/ as sysdba\'  fromuser=SAPSR3 touser=SAPSR3 file='/tmp/emp.dmp'  tables=KMC_WF_SUBSTITUTE rows=yes indexes=yes
imp userid=\'/ as sysdba\'  fromuser=SAPSR3 touser=SAPSR3 file='/tmp/emp.dmp'  tables=DDNTF_CONV_UC  rows=no indexes=yes
imp userid=\'/ as sysdba\'  fromuser=SAPSR3 touser=SAPSR3 file='/tmp/emp2.dmp'  tables=DDNTT_CONV_UC rows=no indexes=yes

Further information can be found in: