ORA-01950: no permission for table space 'users'

Source: Internet
Author: User

When creating a new user, you must specify the default tablespace; otherwise, the system tablespace will be treated as the default tablespace. This is not recommended. It is estimated that the default tablespace was not specified when a user was created, but the DBA has revoked the permission to use the system tablespace.
First try a simple method, generally the default Oracle installation has USERS tablespace.
For example, if you want to create a table in user (or SCHEMA) usera, log on to ORACLE using SYSTEM and run the following SQL statement:

Alter user usera quota unlimited on users;
If there is no USERS tablespace, an error is returned. You can find another tablespace and view all the tablespaces from v $ tablespace.

In the following situation, when a sany user starts to create a table, the default tablespace ********* is not specified ********

SQL> connect sany/as646333
Connected.
SQL> select * from user_sys_privs
2;

USERNAME PRIVILEGE ADM
-------------------------------------------------------------------------
SANY CREATE SESSION NO
SANY EXECUTE ANY PROCEDURE NO
SANY CREATE USER NO
SANY CREATE TABLE NO

SQL> create table bjwh (user_id number (5), user_name varchar2 (20), phone varchar2 (12), email varchar2 (20
));
Create table bjwh (user_id number (5), user_name varchar2 (20), phone varchar2 (12), email varchar2 (20 ))
*
Row 3 has an error:
ORA-01950: no permission for table space 'users'


SQL> connect system/oracle
Connected.
SQL> alter user sany quota unlimited on users;

The user has changed.

SQL> connect sany/as646333
Connected.
SQL> create table bjwh (user_id number (5), user_name varchar2 (20), phone varchar2 (12), email varchar2 (2
0 ));

The table has been created.

SQL> disconnect
From Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-Production
With the Partitioning, OLAP and Data Mining options disconnected
SQL> desc bjwh
SP2-0640: not connected
SP2-0641: "DESCRIBE" needs to connect to the server
SQL> connect sany/as646333
Connected.
SQL> desc bjwh
Is the name empty? Type
-----------------------------------------------------------------------------
USER_ID NUMBER (5)
USER_NAME VARCHAR2 (20)
PHONE VARCHAR2 (12)
EMAIL VARCHAR2 (20)


Solve the problem.

 

Create table test1 (
Id varchar (20) default '0' not null,
Name varchar (20) default '0' not null
)

Alter user UserName quota 200 M on TableSpaceName

Or: grant unlimited tablespace to username; or grant unlimited tablespace, dba to username;

Row 3 has an error:
ORA-01950: Table space 'users'

No permission

Later, I found that I often forget quota when creating a user. Generally, when creating a user, create user wangfan identified by wangfan default tablespace test is used. however, you must add the following: quota Storage (unlimited, 8 K, 10 M etc .) on tablespace; otherwise, the table space is not authorized. Quota means that the user can obtain the space on this tablespace. Later, I logged on as sysdba and alter user wangfan quota unlimited on test; then I created the table.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.