How to create a table space in Oracle

Source: Internet
Author: User

In Oracle, table space is the basic method of data management, all users ' objects should be stored in the table space, that is, the user has the right to use the space, in order to create user

Object Otherwise it is not allowed to create objects, because you want to create objects, such as tables, indexes, and so on, there is no place to store, Oracle will prompt: No storage quotas.

Therefore, before you create an object, you first allocate the storage space.

To allocate storage, you create a tablespace:

Examples of creating table spaces are as follows:

CREATE tablespace "SAMPLE"

LOGGING

DataFile ' D:\ORACLE\ORADATA\ORA92\LUNTAN.ora ' SIZE 5M

EXTENT MANAGEMENT local SEGMENT spaces MANAGEMENT AUTO

The above statements are divided into the following sections:

First: Create Tablespace "Sample" creates a tablespace named "Sample".

To name the table space, follow the Oracle naming conventions.

There are three types of tablespaces that Oracle can create:

(1) Temporary: Temporary table space for the storage of temporary data;

The syntax for creating temporary table spaces is as follows:

CREATE temporary tablespace "SAMPLE" ...

(2) Undo: Restores the table space. Used to save the redo log file.

The syntax for creating a restore table space is as follows:

CREATE UNDO tablespace "SAMPLE" ...

(3) User table space: The most important, but also for the storage of user data table space

Can be written directly: CREATE tablespace "SAMPLE"

The temporary and UNDO table spaces are special table spaces managed by Oracle. Only used to store system-related data.

Second: LOGGING

There are two options for nologging and LOGGING,

Nologging: When creating a tablespace, redo logs are not created.

LOGGING and nologging are just the opposite of generating a redo log when creating a tablespace.

When you use nologging, the advantage is that you do not need to generate a log when creating, so the table space is created faster, but can not log, data loss, can not recover, but generally we

When you create a table space, there is no data, in the usual practice, is to build the table space, and import data to do back up the data, so usually do not need to create a table space

Build the log, so when you create a tablespace, select nologging to speed up the creation of the table space.

Related Article

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.