表分类:
1.普通堆表
2.全局临时表
3.分区表
4.索引组织表(index organized table ,IOT)
5.簇表
全局临时表:
基于会话的全局临时表:on commit preserve rows
基于事务的全局临时表:on commit delete rows 默认
**
表复制
复制表结构
CREATE TABLE FIXF_SZH AS SELECT * FROM fixf_svr_szh WHERE 1=2;
相同表结构复制数据
INSERT INTO FIXF_SZH SELECT * FROM FIXF_SVR_SZH;
复制表结构和数据
CREATE TABLE FIXF_SZH AS SELECT * FROM fixf_svr_szh
全局临时表
基于会话全局临时表
create global temporary table t_tmp_session (dept number,salary number) on commit preserve rows;
基于事务全局临时表
create global temporary table t_tmp_transaction (dept number,salary number) on commit delete rows;
修改表
ALTER TABLE employees READ WRITE;
ALTER TABLE employees READ ONLY;
修改列
alter table Student rename name to StuName;修改字段名
alter table Student modify (id varchar2(64));修改字段类型
ALTER TABLE table_name ADD column_2 VARCHAR2(44) DEFAULT '';添加列
ALTER TABLE table_name DROP COLUMN column_name;删除列