1.表授权给用户
grant select ,insert ,update,delete on tablename to username;
2.创建索引
create index [index_name] on [table_name]( "column_name ") ;
--删除
delete index index_name;
3.创建同义词
CREATE PUBLIC SYNONYM table_name for user.table_name;
--删除同义词
drop public synonym table_name;
--查看所有同义词
select * from dba_synonyms ;
4.创建序列
create sequence seq
increment by 1
start with 1
maxvalue 999999999;
--得到序列的SQL语句
select seq.nextval from dual;
--删除序列的SQL
DROP SEQUENCE seq;
5.创建视图
CREATE OR REPLACE VIEW dept_sum_v
(name,minsal,maxsal,avgsal)
AS
SELECT d.dname,min(e.sal),max(e.sal),avg(e.sal)
FROM emp e,dept d
WHERE e.deptno=d.deptno
GROUP BY d.dname;
6.查看用户对象或角色权限
SELECT * FROM DBA_TAB_PRIVS;