您的位置:首页 > 数据库 > Oracle

oracle 命令分析2

2017-06-21 15:46 99 查看
 1.给id字段添加32位字符默认值:alter table sys_role_light  modify id default sys_guid();

   修改用户在users表空间的空间存储大小2m或无限

      altert user orcl quota 2m on users;      alter user orcl quota unlimited on users;

2.序列(sequence):可供多个用户产生唯一数据的数据库对象。主要用来提供主键值,将主键值装入内存可提高访问效率;

                               


                              

                               


                                     3.获取序列当前值 :

                                             select dept_id_seq.currval from dual;

                                     4.删除序列

                                            drop sequence dept_id_seq;

3.索引(index)

                              

                              


                           

                             创建索引:create index emp_ix on emp(empno,ename)   //在emp表上empno,ename列创建索引

                             删除索引:drop index emp_ix;

4.with grant option、revoke 和public 关键字

                             


                                .revoke connect from orcl;      //将orcl用户的connect角色权限收回

                                .revoke select on emp from orcl;   

1)、with admin option
with admin option的意思是被授予该权限的用户有权将某个权限(如create any table)授予其他用户或角色,取消是不级联的。
如授予A系统权限create session with admin option,然后A又把create session权限授予B,但管理员收回A的create session权限时,B依然拥有create session的权限。但管理员可以显式收回B create session的权限,即直接revoke
create session from B.

2)、with grant option
with grant option的意思是:权限赋予/取消是级联的,如将with
grant option用于对象授权时,被授予的用户也可把此对象权限授予其他用户或角色,不同的是但管理员收回用with grant option授权的用户对象权限时,权限会因传播而失效,如grant select on table with grant option to A,A用户把此权限授予B,但管理员收回A的权限时,B的权限也会失效,但管理员不可以直接收回B的SELECT ON TABLE 权限。

3.查看权限表

                            

                        


4.union、minus  关键字

                                     

                                    


                                   


5.exists 和 not exists 

                                  

                                


     
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: