10.12.21oracle

  今天有些失落,因为可能真是犯了那个什么碎了

 

 

 不过有些事情还是得去做,明天考oracle。。

 

 

为表增加一个字段

 

 

alter table a add address varchar2(10);

 

 

删除表的一个字段

 

 

alter table a drop column address;

alter table a drop column (address,id);删除多个字段。

 

 

设置字段不可用

 

 

alter table a set unused (address);

 

 

查看数据库中不可以用的字段

 

 

select * from user_unused_col_tabs;

 

 

 alter table a drop unused column;删除不可用的字段。

 

 

调整表的参数

 

 

alter table t
pctfree 10
pctused 20;

 

 

 

移动表a到表空间user01_tbs


alter table a move
tablespace user01_tbs
storage(initial 10k
next 12k
pctincrease 10
maxextents unlimited);

 

手动分配存储空间,并且表大小有next参数设置,
 alter table a allocate extent;

 

 

为表手动分配一个10k的新盘区

alter table a allocate extent (size 10k);

 

 

 为表分配一个指定位置的盘区


alter table a allocate extent(size 1m
datafile 'E:/oracle/mytablespace/user_tbs.dbf');

 

创建一个表并指定表空间

create table 商品信息(商品编号 number,商品名称 varchar2(10),price number)
tablespace user01_tbs;

 

 

创建反向索引


create index merch_reverse_index
on 商品信息(商品编号) reverse
pctfree 30
tablespace user01_tbs;

 

 

创建基于函数的索引


create index function_index
on 商品信息(商品编号)
tablespace user01_tbs;

当用该列作为查询条件的时候,可以加快查询的速度。

 

 

为表增加一个主键

alter table spxx
add constraint pk_class_id
primary key (spno);

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值