Represents a very important data object in the Oracle database, but also the main object, today, began to learn the management of the table! One: Table data type 1: Character type char : string with fixed character length (fast query speed) vachar2 : Variable length string field (save space) 2: Numeric type number (5,2) Front integer, After decimal 3: Date type date The default format is determined by the Nls_date_format parameter 4:lob type blob: Store music, video, Image and other binary files Clob: Character format of large object 5:rowid data type pseudo-column type, the physical address of the data record two: Table Operation 1: Create TABLE Create table table_name (Id number (10) NOT NULL          &NBSP, ...); Draw a table create table table_name as select * from table_name1;2: Add Field alter Table table_name add (Id number (10)); 3: Delete Field alter table table_name drop ( NAME1,NAME2); 4: Modify field Alter table table_name modify cloumn_name cloumn_property5: Rename table alter table table_old_name to new_name;6: Alter tablespace and Storage parameters Alter table table_name MOVE TABLESPACE TABLESPACE_NAME; Alter table table_name pctfree 25 pctused 45 setting Table free space use Method 7: Delete Table drop table Table_name[cascade constraints] (if the table has a constraint relationship, you must add the following parameter) 8: Modify table State to read only alter table table_name read only; Query Status select table_name,read_only from user_table where table_name= ' table_name '; three: Table parameter 1: Storing parameters Storage (initial 256k) setting when creating a table (if you know how large the table is, you can set the size first, This avoids fragmentation) four: completeness and constraint of the table not null non-empty Constraint book_pk primary key (book) Create a book field PRIMARY KEY constraint First name is book_pkalter table table_name drop book_pk; Delete primary key unique uniqueness constraint allow null foreign key constraint foreign key name foreign key (name_id) references table_name2 (column) ; disable constraint alter table table_name disable constraint constraint name delete constraint Alter table table_ name drop constraint Constraint name
This article is from the "8424270" blog, please be sure to keep this source http://8434270.blog.51cto.com/8424270/1762789
Oracle Data Table Objects