一 以需要被查詢的用戶登錄oracle(假如為A) B為要查詢A用戶下的表的用戶
二 執行查詢語句: select 'grant select on A.'|| tname ||' to B;' from tab;
以下為模擬結果:
- grant select on A.DEPT to B;
- grant select on A.EMP to B;
- grant select on A.BONUS to B;
- grant select on A.SALGRADE to B;
- grant select on A.AVGSAL to B;
- grant select on A.BOOK to B;
- grant select on A.TEST_INDEX to B;
- grant select on A.TB_EMPLOYEES to B;
...
三 將結果復制
四 登錄system用戶
五 打開sqlwindow ,粘貼,運行。
可以將select換成all就是這些表的所有權限都賦予給B
