admin管理员组

文章数量:1794759

oracle数据库基本知识

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;

本文标签: 基本知识数据库oracle