create user lwt identified by 123456 grant create session to lwt grant create table to lwt grant create view to lwt
alter user jay quota 2m on users;
create role role1 grant create session to role1 grant create table to role1 grant create view to role1
create user tony identified by 123456 grant role1 to tony
grant select on scott.dept to lwt grant select on scott.dept to lwt with grant option
revoke create view from jay
drop user lwt cascade
alter user tony account lock alter user tony account unlock
索引是为了加速对表中数据行的检索而创建的一种分散的存储结构 -- 在oracle中,无需手动指定是否需要使用索引 -- 如果表不存在,索引被自动删除 -- 作用:优化查询速度 -- create index 索引名(idx_emp_ename) on table 表名(列名) -- 为emp表的ename列创建索引
1.大大加快数据的检索速度;
2.创建唯一性索引,保证数据库表中每一行数据的唯一性;
3.加速表和表之间的连接;
4.在使用分组和排序子句进行数据检索时,可以显著减少查询中分组和排序的时间。
1.索引需要占物理空间。
2.当对表中的数据进行增加、删除和修改的时候,索引也要动态的维护,降低了数据的维护速度。
在经常搜索的列上 -- 经常做连接的列、经常要做范围搜索的列,比如工资范围波动大、经常被排序的列、经常出现在where子句的列
不经常出现在搜索结果的列、只有很少的值的列、数据列的值太大、对于修改频率远高于查询频率的列