oracle数据库基本知识

-- 创建表空间
-- 表空间真实存在 所以要指定路径 
-- 分配存储大小

create tablespace tp_first datafile 'D:\OracleTablespace\tp_first01.dbf' size 60M;

-- 删除

drop tablespace tp_first including contents;

--赋予权限

grant connect,resource to test1; 

--赋予具体实体的操作权限

grant all on scott.student to test1;

-- 创建序列 是独立存在的
-- currval 当前序列 nextval下一个序列

select seq_a.nextval from dual;

-- 同义词 syn
可以简化表名称,并且使用

-- Create sequence 
create sequence SEQ_A
minvalue 1 //最小值
maxvalue 1000 //最大值
start with 41 //起始位置
increment by 1 //增量
cache 20
cycle;

-- 索引 一定要建立在大数据量的基础上才有用 
--主键索引 唯一索引 反向键索引 位图索引 大写函数索引
-- 主键索引是主键自带的
-- 唯一索引

create unique index index_u_age on student(sage);


--反向键索引

create index index_u_age on student(sage) reverse;


--创建位图索引

create bitmap index index_u_age on student(sage);


-- 针对函数建立索引

create index index_u_age on student(upper(sid));


--删除索引

drop index index_u_age;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值