oracle 命令分析2

2021-08-02 20:51:11 字數 1712 閱讀 9620

1.給id欄位新增32位字元預設值:alter table sys_role_light  modify id default sys_guid();

修改使用者在users表空間的空間儲存大小2m或無限

3.獲取序列當前值 :

select dept_id_seq.currval from dual;

4.刪除序列

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

刪除索引:drop index emp_ix;

.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 許可權。

oracle 分析函式2

rank,dense rank,row number row number 12345 row number函式返回乙個唯一的值,當碰到相同資料時,排名按照記錄集中記錄的順序依次遞增。dense rank 12223 dense rank函式返回乙個唯一的值,除非當碰到相同資料時,此時所有相同資料的...

Oracle分析函式學習筆記2

環境 windows 2000 server oracle8.1.7 sql plus 目的 以oracle自帶的scott模式為測試環境,主要通過試驗體會分析函式的用法。2.rank dense rank 的使用 原表資訊 sql break on deptno skip 1 為效果更明顯,把不同...

db2死鎖分析相關命令

檢視資料庫管理器級別快照資訊 db2 get monitor switches db2 update monitor switches using lock on statement on create event monitor mymonitor for deadlocks,statements...