ORA-01950: no privileges on tablespace 'USERS' - Oracle

Problem

Import the objects from one user scott to another user tom, returns error ORA-01950: no privileges on tablespace 'USERS'.

Procedure

Export all the objects from user scott,

[tom@ocp backup]$ exp scott/oracle file=scott
[tom@ocp backup]$ ll
-rw-rw-r--. 1 tom tom 24576 Aug 31 22:55 scott.dmp

Error occurred when Importing the objects from one user scott to another user tom,ORA-01950: no privileges on tablespace 'USERS', the message was as below,

[tom@ocp backup]$ imp system/oracle file=scott.dmp fromuser=scott touser=tom

Import: Release 11.2.0.1.0 - Production on Sat Aug 31 23:07:38 2019

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path

Warning: the objects were exported by SCOTT, not by you

import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses ZHS16GBK character set (possible charset conversion)
. importing SCOTT's objects into TOM
. . importing table                         "DEPT"
IMP-00058: ORACLE error 1950 encountered
ORA-01950: no privileges on tablespace 'USERS'
. . importing table                          "EMP"
IMP-00058: ORACLE error 1950 encountered
ORA-01950: no privileges on tablespace 'USERS'
. . importing table                     "SALGRADE"
IMP-00058: ORACLE error 1950 encountered
ORA-01950: no privileges on tablespace 'USERS'
About to enable constraints...
Import terminated successfully with warnings.
[tom@ocp backup]$


The object scheme was imported, however the table content cannot be imported, it was empty:

SQL> conn tom/oracle;
Connected.
SQL> select object_name,object_type from user_objects;

OBJECT_NAME	     OBJECT_TYP
-------------------- ----------
JOB1		     JOB
DEPT		     TABLE
PK_DEPT 	     INDEX
EMP		     TABLE
PK_EMP		     INDEX
SALGRADE	     TABLE

6 rows selected.

SQL> select * from emp;

no rows selected

SQL>

Now delete all the objects which had been imported into user tom,

SQL> drop table dept CASCADE CONSTRAINTS;

Table dropped.

SQL>

SQL> drop table emp CASCADE CONSTRAINTS;

Table dropped.
SQL> drop table salgrade CASCADE CONSTRAINTS;

Table dropped.

SQL>
SQL> select object_name,object_type from user_objects;

OBJECT_NAME	     OBJECT_TYP
-------------------- ----------
JOB1		     JOB

SQL>

If grant user tom the unlimited tablespace, the error ORA-01950: no privileges on tablespace 'USERS' was resolved.

Solution

SQL> GRANT UNLIMITED TABLESPACE TO tom;

Grant succeeded.

SQL>
SQL> select user from dual;

USER
------------------------------
SYS

SQL>

Verify the result

Do it again:

[tom@ocp backup]$ imp system/oracle file=scott.dmp fromuser=scott touser=tom

Import: Release 11.2.0.1.0 - Production on Sat Aug 31 23:36:19 2019

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path

Warning: the objects were exported by SCOTT, not by you

import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses ZHS16GBK character set (possible charset conversion)
. importing SCOTT's objects into TOM
. . importing table                         "DEPT"          4 rows imported
. . importing table                          "EMP"         14 rows imported
. . importing table                     "SALGRADE"          5 rows imported
About to enable constraints...
Import terminated successfully without warnings.

Check the result in Oracle:

SQL> select object_name,object_type from user_objects;

OBJECT_NAME	     OBJECT_TYP
-------------------- ----------
DEPT		     TABLE
PK_DEPT 	     INDEX
EMP		     TABLE
PK_EMP		     INDEX
SALGRADE	     TABLE
JOB1		     JOB

6 rows selected.

SQL> select * from dept;

    DEPTNO DNAME	  LOC
---------- -------------- -------------
	10 ACCOUNTING	  NEW YORK
	20 RESEARCH	  DALLAS
	30 SALES	  CHICAGO
	40 OPERATIONS	  BOSTON

SQL>

Reference

Oracle no privileges on tablespace USERS

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值