How to Create a tablespace in Oracle

Source: Internet
Author: User

How to Create a tablespace in Oracle

Create a tablespace in Oracle

CREATE [UNDO] TABLESPACE tablespace_name
[DATAFILE datefile_spec1 [, datefile_spec2] ......
[{Mininum extent integer [k | m]
| BLOCKSIZE integer [k]
| Logging clause | FORCE LOGGING
| DEFAULT {data_segment_compression} storage_clause
| [Online | offline]
| [PERMANENT | TEMPORARY]
| Extent_manager_clause
| Segment_manager_clause}]
1. undo
The system creates a tablespace for rollback.
In Oracle 9i, the database administrator can manage rollback segments without having to create undo tablespaces. The system automatically manages rollback segment allocation and recovery.
Of course, you can also create general tablespaces and create rollback segments on them. However, for users, system management is much better than self-management.
If you need to manage it by yourself, see the detailed command for rollback segment management.
When the system does not specify a tablespace for rollback, the system uses the system rollback segment for transaction management.
 
2. tablespace_name
Name of the tablespace.
 
3. datafile datefile_spec1
Specifies the space file contained in the tablespace.
Datefile_spec1 is like: ['filename'] [SIZE integer [K | M] [REUSE] [autoextend_clause]
[Autoextend_clause] is an example: AUTOEXTEND {OFF | ON [NEXT integer [K | M] [maxsize_clause]}
Filename is the path name of the data file. It can be a relative or absolute path.
Size is the file size,
REUSE indicates whether the file is reused.
AUTOEXTEND indicates whether to automatically expand.
OFF | ON indicates whether auto scaling is disabled.
NEXT indicates the extended size when the data file is full.
Maxsize_clause indicates the maximum size of the data file, for example, MAXSIZE {UNLIMITED | integer [K | M]}.
UNLIMITED indicates an infinite tablespace.
Integer is the maximum size of the data file.
DATAFILE 'd: "Oracle" oradata "imagedata01.dbf' SIZE 2000 M,
'D: "oracle" oradata "IMAGEDATA02.dbf 'size 2000 M

4. mininum extent integer [k | m]
Specifies the minimum value of the range in the tablespace. This parameter can reduce space fragments and ensure that the range in the tablespace is an integer multiple of this value.

5. BLOCKSIZE integer [k]
This parameter can be used to set the size of an unstandard block. To set this parameter, you must set db_block_size,
At least one db_nk_block_size, and the declared integer value must be equal to db_nk_block_size.
Note: This parameter cannot be set in the temporary tablespace.

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

 
6. logging clause
This clause declares the log attributes of all user objects in the tablespace (logging by default ),
Including tables, indexes, partitions, materialized views, and indexes and partitions on materialized views.
 
7. FORCE LOGGING
Use this clause to indicate that the tablespace enters the forced log mode. At this time, the system records all changes to objects in the table space, except for changes to temporary segments.
This parameter is higher than the object's nologging option.
Note: The database cannot be opened and is in read/write mode. This option cannot be used in temporary tablespace and rollback tablespace.

8. DEFAULT storage_clause
Declare the default storage clause.

9. online | offline
Changes the status of a tablespace. Online makes the tablespace valid immediately after being created. This is the default value.
Offline makes the tablespace invalid after it is created. This value can be obtained from dba_tablespace.

10. PERMANENT | TEMPORARY
Specifies whether a tablespace is a permanent tablespace or a temporary tablespace.
Permanent tablespace stores permanent objects, while temporary tablespace stores temporary objects existing in the session lifecycle.
The temporary tablespace generated by this parameter is always in dictionary management after it is created, and the extent management local option cannot be used.
To create a local tablespace, you must use the create temporary tablespace
Note: block size cannot be declared after this parameter is declared.

 

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.