-- 创建表空间
-- 真实存在的 所以要指定存储路径
-- 分配存储大小
create tablespace tp_a datafile 'D:\OracleTablespace\tp_a01.dbf' size 60M;
-- 删除
drop tablespace tp_a including contents;
-- 赋予权限
grant connect,resource to text1;
-- 赋予具体实体的操作权限
grant all on scott.student to text1
-- 创建序列 序列是独立存在的 需先操作nextval
-- currval 当前序列
-- nextval 下一个序列
select seq_a.currval from dual;
-- 序列添加到表新增数据中
insert into student values(seq_a.nextval,'小黑',22,'男');-- 同义词 syn
select * from s;
-- 索引
-- 主键索引是主键自带的
-- 唯一索引
create unique index index_u_age on teacher(tname);
--反向键索引
create index index_u_age on student(sid) reverse;
-- 创建位图索引
create bitmap index index_u_age on student(sid);
-- 针对函数建立索引
create index index_u_age on student(UPPER(sid));
-- 删除索引
drop index index_u_age;