Importing schema to new or different tablespace
It's not actually possible to specify a different tablespace when importing using the oracle imp
utility. However, as a workaround, you can pre-create the tables by doing a ROWS=N
import into the USERS
tablespace, then alter table mytable move tablespace BLOG_DATA;
for each table to move them to the new tablespace, then do the import again with the IGNORE=Y
parameter to ignore the table creation errors and import all of the data.
If the data was exported using Data Pump (expdp
), (as an aside, everyone should be using this these days, rather than the old legacy exp
/imp
utilities) you can easily import into another tablespace using the REMAP_TABLESPACE
parameter.
eg:
impdp scott/tiger@ZOMG file=blog_data.dmp directory=mydir remap_tablespace=USERS:BLOG_DATA