IMP数据到指定的表空间

IMP数据到指定的表空间

当我们通过imp导入dmp文件时,默认的情况下,数据会导入到exp出的dmp文件所对应的表空间里面。

比如:通过orcl_dev用户,exp数据,用orcl_test用户imp数据,这时数据还会默认导入到原来的表空间里。

现有表空间dev,用户orcl_dev,导出数据。

新建表空间test

CREATE TABLESPACE test

 DATAFILE 'D:oracledata est.dbf' SIZE 50M AUTOEXTEND ON NEXT 1024M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK OFF;

新建用户orcl_test,

Create the user 

create user orcl_test

  identified by "orcl_test"

--指定用户默认的表空间为test

  default tablespace test;

-- Grant/Revoke role privileges 

grant connect to orcl_test;

grant resource to orcl_test;

-- Grant/Revoke system privileges 

grant create database link to orcl_test;

grant create view to orcl_test;

grant debug any procedure to orcl_test;

grant debug connect session to orcl_test;

--先撤销此用户对表空间的unlimited权限

revoke unlimited tablespace from orcl_test;

--再赋予此用户当前表空间的权限。

alter user orcl_test quota unlimited on orcl_test;

再次imp orcl_test/orcl_test 数据已经导入到了test表空间里面。

原文地址:https://www.cnblogs.com/oktell/p/4601689.html