語(yǔ)法如下:
Create user xok Identified By fucku; //創(chuàng)建用戶
GRANT SELECT ANY DICTIONARY TO xok; //授予所有字典的查詢權(quán)限
GRANT SELECT ANY SEQUENCE TO xok; //授予所有序列的查詢權(quán)限
GRANT SELECT ANY TABLE TO xok; //授予所有表的查詢權(quán)限
GRANT CREATE SESSION TO xok; //授予創(chuàng)建會(huì)話
GRANT SELECT ANY VIEW TO xok; //授予所有視圖的查詢權(quán)限
#——
其實(shí)只要給用戶賦予create session, select any table兩個(gè)系統(tǒng)權(quán)限,該用戶就能查詢其他schema下表和視圖
grant create session to username;
grant select any table to username;
但是這樣授權(quán)后,sys下的對(duì)象還是不能select的,因?yàn)閟ys是數(shù)據(jù)字典的擁有者,要select sys下的對(duì)象,需要select any dictionary的權(quán)限
grant select any dictionary to username;