Scripts:创建索引组织表例子example_create_index_organized_table.sql
2014-05-28 09:11
417 查看
-- +----------------------------------------------------------------------------+
-- | Jeffrey M. Hunter |
-- | jhunter@idevelopment.info |
-- | www.idevelopment.info |
-- |----------------------------------------------------------------------------|
-- | Copyright (c) 1998-2012 Jeffrey M. Hunter. All rights reserved. |
-- |----------------------------------------------------------------------------|
-- | DATABASE : Oracle |
-- | FILE : example_create_index_organized_table.sql |
-- | CLASS : Examples |
-- | PURPOSE : Example SQL script that demonstrates how to create an Index |
-- | Organized Table (IOT) object. |
-- | NOTE : As with any code, ensure to test this script in a development |
-- | environment before attempting to run it in production. |
-- +----------------------------------------------------------------------------+
/*
* ------------------------
* NORMAL IOT
* ------------------------
*/
DROP TABLE my_iot
/
CREATE TABLE my_iot (
id NUMBER
, name VARCHAR2(100)
, hiredate DATE
, CONSTRAINT my_iot_pk PRIMARY KEY (id)
)
ORGANIZATION INDEX
OVERFLOW TABLESPACE users
/
/*
* --------------------------------------------
* CREATE IOT FROM SELECTING FROM ANOTHER TABLE
* --------------------------------------------
*/
DROP TABLE my_iot_from_table
/
CREATE TABLE my_iot_from_table (
emp_id
, dept_id
, name
, date_of_birth
, date_of_hire
, monthly_salary
, position
, extension
, office_location
, CONSTRAINT my_iot_from_table_pk PRIMARY KEY (emp_id)
)
ORGANIZATION INDEX
OVERFLOW TABLESPACE users
AS
SELECT * FROM emp
/
-- | Jeffrey M. Hunter |
-- | jhunter@idevelopment.info |
-- | www.idevelopment.info |
-- |----------------------------------------------------------------------------|
-- | Copyright (c) 1998-2012 Jeffrey M. Hunter. All rights reserved. |
-- |----------------------------------------------------------------------------|
-- | DATABASE : Oracle |
-- | FILE : example_create_index_organized_table.sql |
-- | CLASS : Examples |
-- | PURPOSE : Example SQL script that demonstrates how to create an Index |
-- | Organized Table (IOT) object. |
-- | NOTE : As with any code, ensure to test this script in a development |
-- | environment before attempting to run it in production. |
-- +----------------------------------------------------------------------------+
/*
* ------------------------
* NORMAL IOT
* ------------------------
*/
DROP TABLE my_iot
/
CREATE TABLE my_iot (
id NUMBER
, name VARCHAR2(100)
, hiredate DATE
, CONSTRAINT my_iot_pk PRIMARY KEY (id)
)
ORGANIZATION INDEX
OVERFLOW TABLESPACE users
/
/*
* --------------------------------------------
* CREATE IOT FROM SELECTING FROM ANOTHER TABLE
* --------------------------------------------
*/
DROP TABLE my_iot_from_table
/
CREATE TABLE my_iot_from_table (
emp_id
, dept_id
, name
, date_of_birth
, date_of_hire
, monthly_salary
, position
, extension
, office_location
, CONSTRAINT my_iot_from_table_pk PRIMARY KEY (emp_id)
)
ORGANIZATION INDEX
OVERFLOW TABLESPACE users
AS
SELECT * FROM emp
/
相关文章推荐
- Scripts:创建password profile例子example_create_profile_password_parameters.sql
- Scripts:创建物化视图例子example_create_materialized_view.sql
- Scripts:创建resource profile例子example_create_profile_resource_parameters.sql
- odi接口抽取数据报错提示Create Unique Index on flow table创建唯一索引失败解决方法
- odi接口抽取数据报错提示Create Unique Index on flow table创建唯一索引失败解决方法
- 索引组织表(index organized table, IOT)
- mysql5.5基础 show create table...\G 查看创建表时候用的SQL语句
- create table new_table as select ...from old_table ... 创建表后,依附于表的约束、键值、索引都不存在
- impdp create index parallel-数据泵并行创建索引
- Can't create table #sql-2e4_14.frm' (errno: 150)--创建外键时发生的错误
- 11G Concept 第三章翻译 Indexes and Index-Organized Tables(索引和索引组织表)
- sql create table index
- SQL---DDL---创建表CREATE TABLE语句总结
- SQL2012 重新组织和新生成索引sp_RefreshIndex
- SQL CREATE TABLE(创建数据库表)
- 创建外键的时候出错,错误码: 1005 Can't create table 'test_message.#sql-dd0_4' (errno: 150)
- MySQL创建外键约束的报错Error : Can't create table '#sql-534_185' (errno: 150)
- mysql建立索引的优缺点|创建索引alter或create索引分类(PRIMARY KEY,UNIQUE KEY,FULLTEXT,INDEX)作用查看索引show index from table
- 索引组织表(Index Organizied Table)
- mysql创建外键约束报错【Bug Fix】Error : Can't create table '#sql-534_185' (errno: 150)