Oracle 表空间 创建参数 说明(一)

2014-11-24 18:25:57 · 作者: · 浏览: 2

. 表空间的说明



官网的几个链接:


Logical Storage Structures



CREATE TABLESPACE


http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/statements_7003.htm#SQLRF01403




先看一个表空间的创建SQL:



CREATE TABLESPACE SYSAUX DATAFILE


'/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 250M AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED


LOGGING


ONLINE


PERMANENT


EXTENT MANAGEMENT LOCAL AUTOALLOCATE


BLOCKSIZE 8K


SEGMENT SPACE MANAGEMENT AUTO


FLASHBACK ON;




结合这个例子,对几个参数做下说明:


1.1 logging_clause


Specify the default logging attributes of all tables, indexes, materialized views, materialized view logs, and partitions within the tablespace. LOGGING is the default. This clause is not valid for a temporary or undo tablespace.


The tablespace-level logging attribute can be overridden by logging specifications at the table, index, materialized view, materialized view log, and partition levels.


--指定 表,视图,索引等的loging 属性。 该属性不行应用与undo temporary 表空间。 在表空间级别设置的logging 属性可以被表等对象自身的属性覆盖。



1.2 permanent_tablespace_clause


Use the following clauses to create a permanent tablespace. (Some of these clauses are also used to create a temporary or undo tablespace.)


tablespace


Specify the name of the tablespace to be created.



Note on the SYSAUX Tablespace SYSAUX is a required auxiliary system tablespace. You must use the CREATE TABLESPACE statement to create the SYSAUX tablespace if you are upgrading from a release prior to Oracle Database 11g. You must have the SYSDBA system privilege to specify this clause, and you must have opened the database in MIGRATE mode.


You must specify EXTENT MANAGEMENT LOCAL and SEGMENT SPACE MANAGEMENT AUTO for the SYSAUX tablespace. The DATAFILE clause is optional only if you have enabled Oracle Managed Files.


See "DATAFILE | TEMPFILE Clause" for the behavior of the DATAFILE clause.



Take care to allocate sufficient space for the SYSAUX tablespace. For guidelines on creating this tablespace, refer to Oracle Database Upgrade Guide.


Restrictions on the SYSAUX Tablespace You cannot specify OFFLINE or TEMPORARY for the SYSAUX tablespace.


--该选项主要用于指定指定表空间的类型,permanent 表示永久的,如果是其他类型,则写temporary 或者undo 如果是创建SYSAUX 表空间,则必须指定extent managent 类型和 segment space management 类型。




1.3 extent_management_clause


The extent_management_clause lets you specify how the extents of the tablespace will be managed.



Note:


After you have specified extent management with this clause, you can change extent management only by migrating the tablespace.


(1). AUTOALLOCATE specifies that the tablespace is system managed. Users cannot specify an extent size. You cannot specify AUTOALLOCATE for a temporary tablespace.


(2). UNIFORM specifies that the tablespace is managed with uniform extents of SIZE bytes.The default SIZE is 1 megabyte. All extents of temporary tablespaces are of uniform size, so this keyword is optional for a temporary tablespace. However, you must specify UNIFORM in order to specify SIZE. You cannot specify UNIFORM for an undo tablespace.



If you do not specify AUTOALLOCATE or UNIFORM, then the default is UNIFORM for temporary tablespaces and AUTOALLOCATE for all other types of tablespaces.



If you do not specify the extent_management_clause, then Oracle Database interprets the MINIMUM EXTENT clause and the DEFAULT storage_clause to determine extent managemen