Beruflich Dokumente
Kultur Dokumente
Add column
Drop column
Alter table employee drop column phone; (Cannot drop all the columns)
keeping 1m)
Views:
Dba_unused_col_tab
Dba_segments
Dba_extents
Dba_objects
Dba_tables
Partition tables:
Range partition:
Create table emp_part(empno number,ename varchar2(20) )
Partition by range (empno)
(partition part1 values less than (250)
tablespace tbs1 storage( .. .. ),
partition part2 values less than (500)
tablespace tbs2 storage( .. .. ),
partition part3 values less than (750)
Add a partition:
Split a partition:
Alter table emp_part
split partition part4
at (2000) into partition part4a, partition part4b);
Moving a partition:
Truncating a partition:
Alter table emp_part
truncate partition part3;
Dropping a partition:
Alter table emp_part
drop partition part3;
Select:
Select * from emp_part partition(part2);
Hash partition:
varchar2(20),deptno number )
tbs1,
tbs2,
tbs3),
tbs5,
tbs6,
tbs7));
Add partition:
Rename partition:
Select partition:
Select * from comp_part subpartition(part2_sub2);
VIEWS:
USER_TABLES
USER_PART_TABLES
USER_TAB_PARTITIONS
USER_TAB_SUBPARTIONS
organization index
tablespace index_tbs
pctthreshold 50
including address
overflow tablespace of_tbs;
Cluster table:
1. Create cluster
Create cluster emp_clust(deptno number(5))
Tablespace data_clust
Storage(....)
Pctfree 10
Pctused 40
Initrans 2
Maxtrans 255;
2. Create index
Create index emp_clust_idx
On cluster emp_clust
Tablespace idx;
3. Create tables
Create table dept(deptno number(5), dname varchar2(50))
Cluster emp_clust(deptno);
Create table emp(eno number(5), ename varchar2(30), deptno number(5))
Cluster emp_clust(deptno);
Drop cluster:
Temporary table:
Transaction specific table:
Create global temporary table glob_tab (empno number(4) )
On commit delete rows;
Indexes:
Creating Index: