PL SQL create tablespace

创建表空间

create tablespace KInfoData
datafile 'f:\KSSData\KInfoData01.ora' size 100M REUSE,'f:\KSSData\KInfoData02.ora' size 100M REUSE
DEFAULT STORAGE(INITIAL 500K NEXT 500K PCTINCREASE 20);
想问其中的size 100M 是tablespace kInfoData 的空间大小吗,如果以后随着表的增多,100M可以改变吗,REUSE和 PCTINCREASE 20是什么意思.

-----------------------------------------
size 100M是数据文件的大小,数据文件是表空间的组成部分。
可以改,也可以再增加一个100M的数据文件。
下一个next值的百分比率

-----------------------------------------------
一个表空间可以包含多个数据文件并且数据文件可以分别在不同的物理磁盘上,这样做是为了平衡I/O.
  以后还是可以说表空间的大小,不用说数据文件大小.因为表空间是数据文件在逻辑上的集合.
---------------------------------------------

[oracle@ora10g ~]$ !vi
vi /u01/product/10.2.0/db_1/sqlplus/admin/glogin.sql


-- Used for the SHOW ERRORS command
COLUMN LINE/COL FORMAT A8
COLUMN ERROR    FORMAT A65  WORD_WRAPPED

-- Used for the SHOW SGA command
COLUMN name_col_plus_show_sga FORMAT a24
COLUMN units_col_plus_show_sga FORMAT a15
-- Defaults for SHOW PARAMETERS
COLUMN name_col_plus_show_param FORMAT a36 HEADING NAME
COLUMN value_col_plus_show_param FORMAT a30 HEADING VALUE

-- Defaults for SHOW RECYCLEBIN
COLUMN origname_plus_show_recyc   FORMAT a16 HEADING 'ORIGINAL NAME'
COLUMN objectname_plus_show_recyc FORMAT a30 HEADING 'RECYCLEBIN NAME'
COLUMN objtype_plus_show_recyc    FORMAT a12 HEADING 'OBJECT TYPE'
COLUMN droptime_plus_show_recyc   FORMAT a19 HEADING 'DROP TIME'

-- Defaults for SET AUTOTRACE EXPLAIN report
-- These column definitions are only used when SQL*Plus
-- is connected to Oracle 9.2 or earlier.
COLUMN id_plus_exp FORMAT 990 HEADING i
COLUMN parent_id_plus_exp FORMAT 990 HEADING p
COLUMN plan_plus_exp FORMAT a60
COLUMN object_node_plus_exp FORMAT a8
COLUMN other_tag_plus_exp FORMAT a29
COLUMN other_plus_exp FORMAT a44

-- Default for XQUERY
COLUMN result_plus_xquery HEADING 'Result Sequence'

-- My custmorize start
COLUMN file_name FORMAT a60
COLUMN tablepace_name FORMAT a70

SET LONG 999999
SET PAGESIZE 50000
SET LINESIZE 500
-- My customrize end

"/u01/product/10.2.0/db_1/sqlplus/admin/glogin.sql" 58L, 1685C written                                         
[oracle@ora10g ~]$ exit
exit

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@ora10g ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 17 08:28:02 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> select file_name, tablespace_name from dba_data_files;

FILE_NAME                                                    TABLESPACE_NAME
------------------------------------------------------------ ------------------------------
/u01/oradata/jerry/users01.dbf                               USERS
/u01/oradata/jerry/sysaux01.dbf                              SYSAUX
/u01/oradata/jerry/undotbs01.dbf                             UNDOTBS1
/u01/oradata/jerry/system01.dbf                              SYSTEM
/u01/oradata/jerry/example01.dbf                             EXAMPLE
/u01/oradata/jerry/mes_dw.dbf                                MES_DW

6 rows selected.

SQL>
----------------------------------------------------------------------------------------------------------
--oracle 安装在aix系统 建立表空间语句
create tablespace test_service
datafile '/dev/rdata01' size 100M reuse
  LOGGING
  ONLINE
  PERMANENT
  EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M
-----------------------------------------------------------------------------------------------------------
-- 建立新用户test (用sys用户登陆 新建“command window”窗口(File>New>Command Window)执行语句)

create user icd identified by test default tablespace test_service temporary tablespace test_TEMP
/
grant dba to test with admin option
/
grant execute on sys.dbms_sys_sql to test with grant option
/
grant unlimited tablespace to test
/
GRANT SELECT ON SYS.DBA_JOBS TO test with grant option
/
--------------------------------------------------------------------
创建临时表空间:
CREATE TABLESPACE TEMP DATAFILE ’D:Oracleoradatatesttemp01.dbf’ SIZE 32M REUSE
AUTOEXTEND ON
NEXT 640K
MINIMUM EXTENT 64K
DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0)
TEMPORARY;
--------------------------------------------------------------------------------------------------

你可能感兴趣的:(tablespace)