oracle initial next minextents maxextents pctincrease是什么意思???????

本文详细解析了Oracle数据库中表空间创建语句的各参数含义,包括INITIAL、NEXT、MINEXTENTS、MAXEXTENTS及PCTINCREASE等,并通过具体实例展示了如何为表空间指定这些参数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

oracle initial next minextents maxextents pctincrease是什么意思???????

INITIAL 100K NEXT 100K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0

CREATE TABLESPACE WDK_CODE DATAFILE 'D:\ORADATA\CODE\CODE01.ora' SIZE 20M DEFAULT STORAGE ( INITIAL 100K NEXT 100K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 ) MINIMUM EXTENT 0K;
那位老兄能帮我解释一下上面的语句是什么意思?


 

 

create tablespace 语法

CREATE [UNDO] TABLESPACE tablespace 
[DATAFILE datafile_tempfile_spec [, datafile_tempfile_spec]... ] 
[{ MINIMUM EXTENT integer [ K | M ]
| BLOCKSIZE integer [K]
| logging_clause  
| FORCE LOGGING
| DEFAULT [data_segment_compression] storage_clause
| { ONLINE | OFFLINE }
| { PERMANENT | TEMPORARY }
| extent_management_clause
| segment_management_clause
}
[ MINIMUM EXTENT integer [ K | M ]
| BLOCKSIZE integer [K]
| logging_clause
| FORCE LOGGING
| DEFAULT [data_segment_compression] storage_clause
| { ONLINE | OFFLINE }
| { PERMANENT | TEMPORARY }
| extent_management_clause
| segment_management_clause
]...
]
;

 

 

 

 

 

INITIAL:specifies the size in bytes of the object's first extent.  Oracle allocates space for this extent when you create the object.  You can also use K or M to specify this size in kilobytes or megabytes.  The default value is the size of 5 data blocks.  The minimum value is the size of 2 data blocks.  The maximum value varies depending on your operating system.  Oracle rounds values up to the next multiple of the data block size. 

NEXT:specifies the size in bytes of the next extent to be allocated to the object.  You can also use K or M to specify the size in kilobytes or megabytes.  The default value is the size of 5 data blocks.  The minimum value is the size of 1 data block.  The maximum value varies depending on your operating system.  Oracle rounds values up to the next multiple of the data block size. 

MINEXTENTS:specifies the total number of extents allocated when the segment is created.  This parameter allows you to allocate a large amount of space when you create an object, even if the space available is not contiguous.  The default and minimum value is 1, meaning that Oracle only allocates the initial extent, except for rollback segments for which the default and minimum value is 2.  The maximum value varies depending on your operating system. 
If the MINEXTENTS value is greater than 1, then Oracle calculates the size of subsequent extents based on the values of the INITIAL, NEXT, and PCTINCREASE parameters. 

MAXEXTENTS:specifies the total number of extents, including the first, that Oracle can allocate for the object.  The minimum value is 1.  The default and maximum values vary depending your data block size.

PCTINCREASE:specifies the percent by which each extent after the second grows over the previous extent.  The default value is 50,  meaning that each subsequent extent is 50% larger than the preceding extent. The minimum value is 0, meaning all extents after the first are the same size.  The maximum value varies depending on your operating system. 
You cannot specify PCTINCREASE for rollback segments.  Rollback segments always have a PCTINCREASE value of 0. 
Oracle rounds the calculated size of each new extent up to the next multiple of the data block size.



=====================
感谢网友答复:

initial 为表指定的第一个盘区大小;next 为表指定的第二个盘区的大小;minextends 一个表可用的最少的盘区数目;maxextends反之。上述四个参数只有在autoallocate方式下才能在storage子句中去设置。那句语句的意思是:创建表空间WDK_CODE,文件位置'D:\ORADATA\CODE\CODE01.ora',大小20M,为这个表空间分配的第一个盘区大小:100k,第二个盘区:100k,最小盘区:1个,最大盘区:无限制。


 

initial 为表指定的第一个盘区大小;next 为表指定的第二个盘区的大小;minextends 一个表可用的最少的盘区数目;maxextends反之。上述四个参数只有在autoallocate方式下才能在storage子句中去设置。那句语句的意思是:创建表空间WDK_CODE,文件位置'D:\ORADATA\CODE\CODE01.ora',大小20M,为这个表空间分配的第一个盘区大小:100k,第二个盘区:100k,最小盘区:1个,最大盘区:无限制。
此系统用于检测数据库更新后自动更新文件 Connect comm/comm@dbserver; Drop table client_ip_address; create table client_ip_address ( CLIENT_NAME Varchar2(30), IP_ADDRESS Varchar2(16), UPDATE_TIME Date, UPDATE_CLASS Number(2), constraints pk_client_ip_addr primary key ( IP_ADDRESS ) using index pctfree 5 storage ( initial 2M next 1M minextents 1 maxextents unlimited pctincrease 0 ) tablespace tsp_comm ) pctfree 5 pctused 90 storage ( initial 5M next 10M minextents 1 maxextents unlimited pctincrease 0 ); grant select,insert,update,delete on client_ip_address to role_comm; Drop table client_updata_path; create table client_updata_path ( UPDATE_CLASS Number(8,0), FILE_PATH Varchar2(16), REMARK Varchar2(16), constraints pk_client_updata_path primary key ( UPDATE_CLASS, FILE_PATH ) using index pctfree 5 storage ( initial 2M next 1M minextents 1 maxextents unlimited pctincrease 0 ) tablespace tsp_comm ) pctfree 5 pctused 90 storage ( initial 5M next 10M minextents 1 maxextents unlimited pctincrease 0 ); grant select,insert,update,delete on client_updata_path to role_comm; Drop table sever_updata_path; create table sever_updata_path ( server_ip_address Varchar2(16), updata_path Varchar2(16), constraints pk_server_ip_addr primary key ( server_ip_address, updata_path ) using index pctfree 5 storage ( initial 2M next 1M minextents 1 maxextents unlimited pctincrease 0 ) tablespace tsp_comm ) pctfree 5 pctused 90 storage ( initial 5M next 10M minextents 1 maxextents unlimited pctincrease 0 ); grant select,insert,update,delete on sever_updata_path to role_comm; Drop table updata_file_dict; create table updata_file_dict ( updata_file_no Number(8,0), updata_file_name Varchar2(16), updata_class Number(8,0), constraints pk_updata_file primary key ( updata_file_no ) using index pctfree 5 storage ( initial 2M next 1M minextents 1 maxextents unlimited pctincrease 0 ) tablespace tsp_comm ) pctfree 5 pctused 90 storage ( initial 5M next 10M minextents 1 maxextents unlimited pctincrease 0 ); grant select,insert,update,delete on updata_file_dict to role_comm; Connect system/manager@dbserver; Drop public synonym client_ip_address; create public synonym client_ip_address for comm.client_ip_address; Drop public synonym client_updata_path; create public synonym client_updata_path for comm.client_updata_path; Drop public synonym sever_updata_path; create public synonym sever_updata_path for comm.sever_updata_path; Drop public synonym updata_file_dict; create public synonym updata_file_dict for comm.updata_file_dict;
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值