oracle学习笔记(5)

序列
create sequence seq_test
start with 20
increment by -1
maxvalue 20
minvalue 0
cycle
order
cache 2;

select seq_test.nextval from dual;
alter sequence seq_next nocycle|increment by -4;
drop sequence seq_next;

索引
create [unique] [bitmap] index idx_emp on emp (empno [, ename]) [reverse];
drop index idx_emp;

同义词
create synonym all_exp for exp; --专用同义词
create public synonym emp for scott.emp; --公用同义词
drop [public] synonym emp;

用户管理
[create|alter] user username identified by password;
select * from all_users;
[grant|revoke] create [session|table|sequence|procedure] to user
对象权限:select,insert,update,delete,alter,index,reference,execute

角色
create role role_name;
grant select on tablename to role_name;
grant role_name to user;
alter user user_name default role none;

你可能感兴趣的:(oracle,cache)