创建表空间。

l 创建字表空间用到的参数。

l DATAFIL参数一个例子,DATAFILE 'D:ORACLEPRODUCT10.2.0ORADATADICTIONARY_10GTEST01.DBF' SIZE 5M AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED

l MINIMUM EXTENT integer:单位为KM。该参数仅能用于字典管理的表空间(Dictionary Managed Tablespace)和CREATE TABLESPACE语句中,用于设置在该表空间中最小区段(extent)的值覆盖initial参数(在create table语句中),而且在该表空间的段(segment)中的区段(extent)大小始终是minimum extent值的整数倍,目的是减少表空间的空间碎片。This clause is not relevant for a dictionary-managed temporary tablespace.

l 注意:在数据字典dba_tablesinitial_extentnext_extent列的值并不是该表中真正区段(extent)的值,而是在create table语句中指定storage参数的值。正真的值在dba_extentsuser_extents中。

l BLOCKSIZE:用该参数指定使用非标准块大小的表空间,但是必须设置初始化参数db_cache_sizedb_nK_cache_size值。否则将不能使用该参数。该参数在本地管理的表空间和字典管理的表空间均适用。You cannot specify nonstandard block sizes for a temporary tablespace (that is, if you also specify TEMPORARY) or if you intend to assign this tablespace as the temporary tablespace for any users.

l LOGGINGNOLOGGINGOracle9i SQL Reference Release 2 (9.2) says that The logging_clause lets you specify whether creation of a database object will be logged in the redo log file (LOGGING) or not (NOLOGGING). This clause also specifies whether subsequent Direct Loader (SQL*Loader) and direct-path INSERT operations against the object are logged (LOGGING) or not logged (NOLOGGING).还没有做过实验,不太懂。做完实验再补充。

l FORCE LOGGINGOracle will log all changes to all objects in the tablespace except changes to temporary segments, overriding any NOLOGGING setting for individual objects. The database must be open and in READ WRITE mode. You can specify both FORCE LOGGING and NOLOGGING. In this case, NOLOGGING is the default logging mode for objects subsequently created in the tablespace, but Oracle ignores this default as long as the tablespace (or the database) is in FORCE LOGGING mode. If you subsequently take the tablespace out of FORCE LOGGING mode, then the NOLOGGING default is once again enforced. You cannot specify FORCE LOGGING for an undo or temporary tablespace.

l DEFAULT STORAGE参数:一个例子,default storageINITIAL 32K NEXT 32K MINEXTENTS 2 MAXEXTENTS 255 PCTINCREASE 50),在create tablespace语句中只有括号里的哪些参数。并且这些参数仅用于字典管理的表空间。

l ONLINEOFFLINE:使表空间联机或脱机。

l PERMANENT TEMPORARY 子句:permanent指定永久表空间,temporary指定临时表空间。Temporary tablespaces created with this clause are always dictionary managed, so you cannot specify the EXTENT MANAGEMENT LOCAL clause. To create a locally managed temporary tablespace, use the CREATE TEMPORARY TABLESPACE statement. If you specify TEMPORARY, then you cannot specify the BLOCKSIZE clause.

l EXTENT MANAGEMENT [LOCAL|DICTIONARY]:若指定了dictionary,则表空间为字典管理的,需要设置initialnextminextentsdefault storage子句)等参数,而且段空间管理(segment space management)仅有一种,即手动管理(manual),在该表空间创建段(表段create table,索引段等create index)时,需要指定pctfreepctusedfreelist等参数。若指定了local,则表空间为本地管理的表空间,这是区段(extent)分配的方式有两种,即autoallocate(自动分配),uniform size integer(统一分配)。并且在该表空间管理方式下(本地管理的)有两种段空间管理(segment space management)方式,一种是auto(自动),另一种时manual(手动的,就是在字典管理的表空间中管理段空间的那种方式)。在create tablespace语句中,仅可以指定到automanual这一层次,不可以指定maxtransinitransfreelist等参数。If you specify LOCAL, then you cannot specify DEFAULT storage_clause, MINIMUM EXTENT, or TEMPORARY.

l UNDO表空间:create undo tablespace。创建还原表空间(undo tablespace),该表空间必须是本地管理的,区段是自动分配的(extent management local autoallocate)。Oracle9i SQL Reference Release 2 (9.2)文档里的一些话:The only clauses you can specify for an undo tablespace are the DATAFILE clause and the extent_management_clause to specify local extent management. (You cannot specify dictionary extent management using the extent_management_clause.) All undo tablespaces are created permanent, read/write, and in logging mode. Values for MINIMUM EXTENT and DEFAULT STORAGE are system generated.

l 临时表空间:

l 本地管理的临时表空间:一个例子:CREATE TEMPORARY TABLESPACE "TEMP02" TEMPFILE 'E:ORACLEORADATADICTTEMP02.ora' SIZE 5M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M。本地管理的临时表空间区段(extent)必须统一分配的(uniform)。

l 流程图在 资源中心->oracle->创建表空间 中。

l 适用于oracle 9i r2