Q: During data migration, I wanted to import the data into a tablespace different from the original system. After the import, I accidentally found that the data was imported into the original tablespace. How can I solve this problem?
A: Let me give you a simple example:
First, if the default user has the DBA permission, the data will be imported to the original tablespace according to the original location.
$ Imp bjbbs/passwd file = bj_bbs.dmp fromuser = jive touser = bjbbs grants = N
Revoke the unlimited tablespace permission to import the table space to the user's default tablespace.
SQL> create user bjbbs identified by passwd
2 def *** t tablespace bjbbs
3 temporary tablespace temp
4/
User Created.
SQL> grant connect, resource to bjbbs;
Grant succeeded.
SQL> grant DBA to bjbbs;
Grant succeeded.
SQL> revoke unlimited tablespace from bjbbs;
Revoke succeeded.
SQL> alter user bjbbs quota 0 on users;
User altered.
SQL> alter user bjbbs quota unlimited on bjbbs;
User altered.
SQL> exit
Now the data can be imported into the correct user tablespace.