因为导出DMP时,会对表空间的定义也导出,所以可通过如下方法将数据导入指定的表空间。 1、登录SYS用户。执行如下命令收回用户表空间。 SQL> revoke unlimited tablespace from admin;2、禁止该用户使用USERS表空间(可用同样的方法禁止使用导出DMP时源数据所在的表空间) SQL> alter user admin quota 0 on users; 3、仅给该用户授于访问SPACE的权限。 SQL> alter user admin quota unlimited on space;
revoke unlimited tablespace from admin; alter user admin default tablespace space quota unlimited on space;
SQL> revoke unlimited tablespace from scott;撤销成功。SQL> conn scott/scott@test 已连接。 SQL> show user USER 为 "SCOTT" SQL> create table test (id number) tablespace system; create table test (id number) tablespace system * 第 1 行出现错误: ORA-01950: 对表空间 'SYSTEM' 无权限 SQL> create table test (id number) tablespace users; create table test (id number) tablespace users * 第 1 行出现错误: ORA-01536: 超出表空间 'USERS' 的空间限额 SQL> create table test (id number) tablespace sysaux; create table test (id number) tablespace sysaux * 第 1 行出现错误: ORA-01950: 对表空间 'SYSAUX' 无权限 SQL> conn sys/top10@test as sysdba 已连接。 SQL> grant unlimited tablespace to scott;授权成功。SQL> conn scott/scott@test 已连接。 SQL> show user USER 为 "SCOTT" SQL> create table test (id number) tablespace system;表已创建。SQL> create table test1 (id number) tablespace users;表已创建。SQL> create table test2 (id number) tablespace sysaux;表已创建。SQL>
将space表空间设置为admin的默认表空间,并分配配额。
1、登录SYS用户。执行如下命令收回用户表空间。
SQL> revoke unlimited tablespace from admin;2、禁止该用户使用USERS表空间(可用同样的方法禁止使用导出DMP时源数据所在的表空间)
SQL> alter user admin quota 0 on users; 3、仅给该用户授于访问SPACE的权限。
SQL> alter user admin quota unlimited on space;
不用限制users表空间和system表空间吗
已连接。
SQL> show user
USER 为 "SCOTT"
SQL> create table test (id number) tablespace system;
create table test (id number) tablespace system
*
第 1 行出现错误:
ORA-01950: 对表空间 'SYSTEM' 无权限
SQL> create table test (id number) tablespace users;
create table test (id number) tablespace users
*
第 1 行出现错误:
ORA-01536: 超出表空间 'USERS' 的空间限额
SQL> create table test (id number) tablespace sysaux;
create table test (id number) tablespace sysaux
*
第 1 行出现错误:
ORA-01950: 对表空间 'SYSAUX' 无权限
SQL> conn sys/top10@test as sysdba
已连接。
SQL> grant unlimited tablespace to scott;授权成功。SQL> conn scott/scott@test
已连接。
SQL> show user
USER 为 "SCOTT"
SQL> create table test (id number) tablespace system;表已创建。SQL> create table test1 (id number) tablespace users;表已创建。SQL> create table test2 (id number) tablespace sysaux;表已创建。SQL>