oracle 表操作
表
1.create a table
sql> create table table_name (column datatype,column datatype]....)
sql> tablespace tablespace_name [pctfree integer] [pctused integer]
sql> [initrans integer] [maxtrans integer]sql> storage(initial 200k next 200k pctincrease 0 maxextents 50)
sql> [logging|nologging] [cache|nocache]
2.copy an existing table
sql> create table table_name [logging|nologging] as subquery
3.create temporary table
sql> create global temporary table xay_temp as select * from xay;
on commit preserve rows/on commit delete rows
4.pctfree = (average row size - initial row size) *100 /average row size
pctused = 100-pctfree- (average row size*100/available data space)
5.change storage and block utilization parameter
sql> alter table table_name pctfree=30 pctused=50 storage(next 500k minextents 2 maxextents 100);
6.manually allocating extents
sql> alter table table_name allocate extent(size 500k datafile 'c:/oracle/data.dbf');
7.move tablespace
sql> alter table employee move tablespace users;
8.deallocate of unused space
sql> alter table table_name deallocate unused [keep integer]
9.truncate a table
sql> truncate table table_name;
10.drop a table
sql> drop table table_name [cascade constraints];
11.drop a column
sql> alter table table_name drop column comments cascade constraints checkpoint 1000;
alter table table_name drop columns continue;
12.mark a column as unused
sql> alter table table_name set unused column comments cascade constraints;
alter table table_name drop unused columns checkpoint 1000;
alter table orders drop columns continue checkpoint 1000
data_dictionary : dba_unused_col_tabs
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/52450/viewspace-989967/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle truncate table recover(oracle 如何拯救誤操作truncate的表)Oracle
- Oracle切換undo表空間操作步驟Oracle
- Oracle 操作表結構基本語法及示例Oracle
- Servlet操作OracleServletOracle
- Oracle 集合操作Oracle
- oracle基本操作Oracle
- Oracle資料庫管理——表資料庫高水位及shrink操作Oracle資料庫
- Oracle建表Oracle
- Oracle 外部表Oracle
- oracle的表Oracle
- Oracle資料庫分割槽表SPLIT操作導致歸檔瘋漲Oracle資料庫
- Oracle通過scott使用者中的emp練習單表操作Oracle
- DBA ORACLE連線操作Oracle
- 表的操作
- CK表操作
- ORACLE 備份表Oracle
- Oracle表空間Oracle
- oracle 表空間Oracle
- oracle 表移動表空間Oracle
- Oracle表移動表空間Oracle
- oracle dg切換操作示例Oracle
- ORACLE透明加密安裝操作Oracle加密
- Oracle表 列欄位的增加、刪除、修改以及重新命名操作sqlOracleSQL
- orm單表操作ORM
- 05-表操作
- MySQL DDL操作表MySql
- oracle將表配置為分割槽表Oracle
- oracle 普通表-分割槽表改造流程Oracle
- Oracle OCP(20):建立表Oracle
- Oracle OCP(21):管理表Oracle
- ORACLE物件型別表Oracle物件型別
- 增加oracle表空間Oracle
- oracle壓縮表(二)Oracle
- oracle壓縮表(一)Oracle
- oracle temp 表空間Oracle
- Oracle 巢狀表(轉)Oracle巢狀
- oracle 的表壓縮Oracle
- Oracle Dataguard故障轉移(failover)操作OracleAI
- Oracle 重置密碼及基本操作Oracle密碼