Oracle creates a tablespace and users to test it. oracle creates a tablespace.

Source: Internet
Author: User

Oracle creates a tablespace and users to test it. oracle creates a tablespace.

First, describe the table space as follows:

Temporary tablespace: used for grouping operations when sorting large data volumes. Normally, these operations are completed in the memory, but when sorting large data volumes, when the memory is not enough, temporary tablespace will be used. The table is not stored here, which is similar to the Virtual Memory concept in the operating system.

Data Table space: it is the tablespace that stores tables, indexes, and other data files. It is better to divide the tables and indexes into different tablespaces, so the performance will be much better.

User-specified tablespace: in fact, it only sets a default value for the tablespace during table creation. That is to say, if the user does not specify the tablespace during table creation, it is stored in the user-specified tablespace by default, however, if a tablespace is specified, other tablespaces can still be used. In addition, if other users are granted permissions, they can still use the tablespace.


As a general user, we can create a data table space and assign it to a user.


-- Create a user

Create user eh identified by "123 ";

-- Grant Permissions

Grant connect, resource to eh;

-- Create a tablespace

Create tablespace eh_temp_tablespace

Datafile 'd:/oracle_tablespace/eh_temp_tablespace.dbf'

Size 800 m

Autoextend on next 5 m

Maxsize 3000 m

-- Grant users the permission to use tablespaces.

Alter user eh quota unlimited on eh_temp_tablespace

Or alter user eh quota * M on eh_temp_tablespace

-- Delete a tablespace

Drop tablespace eh_temp_tablespace including contents and datafiles




How to Create a tablespace and a user in Oracle92?

// Create a temporary tablespace
Create temporary tablespace user_temp
Tempfile 'd: \ oracle \ oradata \ Oracle9i \ user_temp.dbf'
Size 50 m autoextend on next 50 m maxsize 20480 m
Extent management local;
// Create a data table space
Create tablespace test_data
Logging datafile 'd: \ oracle \ oradata \ Oracle9i \ user_data.dbf'
Size 50 m autoextend on next 50 m maxsize 20480 m
Extent management local;
// Create a user and specify the tablespace
Create user username identified by password default tablespace user_data
Temporary tablespace user_temp;
// Grant permissions to users
Grant connect, resource to username;
Delete USER commands
Drop user user_name cascade;

How to create a new user in oracle

First, create a tablespace and create users in the tablespace, for example:
Create tablespace (tablespace_name) datafile 'tablespace path' size (space size );
Create user (user_name) identified by (password) default tablespace tablespace_name;
Grant permission 1, permission 2 to user_name;

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.