Oracle±íÖ»¶ÁȨÏÞµÄÊÚȨÓë×÷·Ï²Ù×÷°ì·¨
OracleÊý¾Ý¿â×÷ΪһÖÖÇ¿Ê¢µÄÆóÒµ¼¶¹ØϵÐÍÊý¾Ý¿âÖÎÀíϵͳ£¬ÌṩÁ˸»ºñµÄȨÏÞÖÎÀí¹¦Ð§¡£ÔÚÏÖʵӦÓÃÖУ¬ÓÐʱÐèҪΪÌض¨Óû§»ò½ÇÉ«ÊÚÓèÖ»¶ÁȨÏÞ£¬ÒÔ±£»¤Ãô¸ÐÊý¾Ý²»±»ÒâÍâÐ޸ġ£±¾ÎĽ«ÏÈÈÝOracleÊý¾Ý¿âÖÐÔõÑù¶Ô±í¾ÙÐÐÖ»¶ÁȨÏÞµÄÊÚȨÓë×÷·Ï²Ù×÷£¬Í¬Ê±ÌṩÏêϸµÄ´úÂëʾÀý¡£
1. ÊÚȨֻ¶ÁȨÏÞ
£¨1£©ÎªÓû§ÊÚÓèÖ»¶ÁȨÏÞ
ÔÚOracleÊý¾Ý¿âÖУ¬¿ÉÒÔͨ¹ýGRANTÓï¾äΪÌض¨Óû§ÊÚÓèÖ»¶ÁȨÏÞ¡£
ʾÀý´úÂëÈçÏ£º
GRANT SELECT ON table_name TO user_name;
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬table_nameΪҪÊÚÓèȨÏ޵ıíÃû£¬user_nameΪҪÊÚÓèȨÏÞµÄÓû§Ãû¡£
£¨2£©Îª½ÇÉ«ÊÚÓèÖ»¶ÁȨÏÞ
ÈôÊÇÐèҪΪһ¸ö½ÇÉ«ÊÚÓèÖ»¶ÁȨÏÞ£¬¿ÉÒÔͨ¹ýGRANTÓï¾äΪ½ÇÉ«ÊÚÓèȨÏÞ£¬²¢½«½ÇÉ«¸¶Óë¸øÓû§¡£
ʾÀý´úÂëÈçÏ£º
GRANT SELECT ON table_name TO role_name; GRANT role_name TO user_name;
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬table_nameΪҪÊÚÓèȨÏ޵ıíÃû£¬role_nameΪҪÊÚÓèȨÏ޵ĽÇÉ«Ãû£¬user_nameΪҪ½«½ÇÉ«¸¶ÓëµÄÓû§Ãû¡£
2. ×÷·ÏÖ»¶ÁȨÏÞ
£¨1£©×÷·ÏÓû§µÄÖ»¶ÁȨÏÞ
ÏëÒª×÷·ÏÓû§µÄÖ»¶ÁȨÏÞ£¬¿ÉÒÔͨ¹ýREVOKEÓï¾äʵÏÖ¡£
ʾÀý´úÂëÈçÏ£º
REVOKE SELECT ON table_name FROM user_name;
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬table_nameΪҪ×÷·ÏȨÏ޵ıíÃû£¬user_nameΪҪ×÷·ÏȨÏÞµÄÓû§Ãû¡£
£¨2£©×÷·Ï½ÇÉ«µÄÖ»¶ÁȨÏÞ
ÈôÊÇÐèÒª×÷·ÏÒ»¸ö½ÇÉ«µÄÖ»¶ÁȨÏÞ£¬¿ÉÒÔͨ¹ýREVOKEÓï¾äÀ´ÊµÏÖ¡£
ʾÀý´úÂëÈçÏ£º
REVOKE SELECT ON table_name FROM role_name;
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬table_nameΪҪ×÷·ÏȨÏ޵ıíÃû£¬role_nameΪҪ×÷·ÏȨÏ޵ĽÇÉ«Ãû¡£
ͨ¹ýÒÔÉÏ°ì·¨£¬¿ÉÒÔʵÏÖ¶ÔOracleÊý¾Ý¿âÖбíµÄÖ»¶ÁȨÏÞµÄÊÚȨÓë×÷·Ï²Ù×÷¡£ÕâÑù¿ÉÒÔÓÐÓõر£»¤Êý¾ÝµÄÍêÕûÐÔºÍÇå¾²ÐÔ£¬È·±£Ãô¸ÐÊý¾Ý²»±»Îó²Ù×÷»òÀÄÓá£ÔÚÏÖʵӦÓÃÖУ¬Æ¾Ö¤ÏêϸµÄȨÏÞÖÎÀíÐèÇ󣬿ÉÒÔÎÞаÔËÓÃÒÔÉϲÙ×÷°ì·¨£¬²¢Æ¾Ö¤ÇéÐξÙÐÐÊʵ±µ÷½âºÍÀ©Õ¹¡£
ÒÔÉϾÍÊÇOracle±íÖ»¶ÁȨÏÞµÄÊÚȨÓë×÷·Ï²Ù×÷°ì·¨µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡