OracleÓû§¡¢È¨ÏÞ¡¢½ÇÉ«¹ÜÀí
OracleÓû§¡¢È¨ÏÞ¡¢½ÇÉ«¹ÜÀí
Oracle ȨÏÞÉèÖÃ
Ò»¡¢È¨ÏÞ·ÖÀࣺ
ϵͳȨÏÞ£ºÏµÍ³¹æ¶¨Óû§Ê¹ÓÃÊý¾Ý¿âµÄȨÏÞ¡££¨ÏµÍ³È¨ÏÞÊǶÔÓû§¶øÑÔ)¡£
ʵÌåȨÏÞ£ºÄ³ÖÖȨÏÞÓû§¶ÔÆäËüÓû§µÄ±í»òÊÓͼµÄ´æȡȨÏÞ¡££¨ÊÇÕë¶Ô±í»òÊÓͼ¶øÑԵģ©¡£
¶þ¡¢ÏµÍ³È¨ÏÞ¹ÜÀí£º
1¡¢ÏµÍ³È¨ÏÞ·ÖÀࣺ
DBA: ÓµÓÐÈ«²¿ÌØȨ£¬ÊÇϵͳ×î¸ßȨÏÞ£¬Ö»ÓÐDBA²Å¿ÉÒÔ´´½¨Êý¾Ý¿â½á¹¹¡£
RESOURCE:ÓµÓÐResourceȨÏÞµÄÓû§Ö»¿ÉÒÔ´´½¨ÊµÌ壬²»¿ÉÒÔ´´½¨Êý¾Ý¿â½á¹¹¡£
CONNECT:ÓµÓÐConnectȨÏÞµÄÓû§Ö»¿ÉÒԵǼOracle£¬²»¿ÉÒÔ´´½¨ÊµÌ壬²»¿ÉÒÔ´´½¨Êý¾Ý¿â½á¹¹¡£
¶ÔÓÚÆÕͨÓû§£ºÊÚÓèconnect, resourceȨÏÞ¡£
¶ÔÓÚDBA¹ÜÀíÓû§£ºÊÚÓèconnect£¬resource, dbaȨÏÞ¡£
2¡¢ÏµÍ³È¨ÏÞÊÚȨÃüÁ
[ϵͳȨÏÞÖ»ÄÜÓÉDBAÓû§ÊÚ³ö£ºsys, system(×ʼֻÄÜÊÇÕâÁ½¸öÓû§)]
ÊÚȨÃüÁSQL> grant connect, resource, dba to Óû§Ãû1 [,Óû§Ãû2]...;
[ÆÕͨÓû§Í¨¹ýÊÚȨ¿ÉÒÔ¾ßÓÐÓësystemÏàͬµÄÓû§È¨ÏÞ£¬µ«ÓÀÔ¶²»ÄÜ´ïµ½ÓësysÓû§ÏàͬµÄȨÏÞ£¬systemÓû§µÄȨÏÞÒ²¿ÉÒÔ±»»ØÊÕ¡£]
Àý£º
SQL> connect system/manager
SQL> Create user user50 identified by user50;
SQL> grant connect, resource to user50;
²éѯÓû§ÓµÓÐÄÄÀïȨÏÞ£º
SQL> select * from dba_role_privs;
SQL> select * from dba_sys_privs;
SQL> select * from role_sys_privs;
ɾ³ýÓû§£ºSQL> drop user Óû§Ãû cascade; //¼ÓÉÏcascadeÔò½«Óû§Á¬Í¬Æä´´½¨µÄ¶«Î÷È«²¿É¾³ý
3¡¢ÏµÍ³È¨ÏÞ´«µÝ£º
Ôö¼ÓWITH ADMIN OPTIONÑ¡ÏÔòµÃµ½µÄȨÏÞ¿ÉÒÔ´«µÝ¡£
SQL> grant connect, resorce to user50 with admin option; //¿ÉÒÔ´«µÝËù»ñȨÏÞ¡£
4¡¢ÏµÍ³È¨ÏÞ»ØÊÕ£ºÏµÍ³È¨ÏÞÖ»ÄÜÓÉDBAÓû§»ØÊÕ
ÃüÁSQL> Revoke connect, resource from user50;
˵Ã÷£º
1£©Èç¹ûʹÓÃWITH ADMIN OPTIONΪij¸öÓû§ÊÚÓèϵͳȨÏÞ£¬ÄÇô¶ÔÓÚ±»Õâ¸öÓû§ÊÚÓèÏàͬȨÏÞµÄËùÓÐÓû§À´Ëµ£¬È¡Ïû¸ÃÓû§µÄϵͳȨÏÞ²¢²»»á¼¶ÁªÈ¡ÏûÕâЩÓû§µÄÏàͬȨÏÞ¡£
2£©ÏµÍ³È¨ÏÞÎÞ¼¶Áª£¬¼´AÊÚÓèBȨÏÞ£¬BÊÚÓèCȨÏÞ£¬Èç¹ûAÊÕ»ØBµÄȨÏÞ£¬CµÄȨÏÞ²»ÊÜÓ°Ï죻ϵͳȨÏÞ¿ÉÒÔ¿çÓû§»ØÊÕ£¬¼´A¿ÉÒÔÖ±½ÓÊÕ»ØCÓû§µÄȨÏÞ¡£
Èý¡¢ÊµÌåȨÏÞ¹ÜÀí
1¡¢ÊµÌåȨÏÞ·ÖÀࣺselect, update, insert, alter, index, delete, all //all°üÀ¨ËùÓÐȨÏÞ
execute //Ö´Ðд洢¹ý³ÌȨÏÞ
user01:
SQL> grant select, update, insert on product to user02;
SQL> grant all o
Ïà¹ØÎĵµ£º
ÎÒÃÇ´ó¼Ò¶¼ÖªµÀÿ¸öOracleÊý¾Ý¿â¶¼»áÓÐÒ»¸ö»òÊǶà¸öÎïÀíµÄOracleÊý¾ÝÎļþ,Êý¾Ý¿âÐÅÏ¢(½á¹¹,Êý¾Ý)µÄÖ÷Òª×÷ÓÃÊÇÀ´±£´æÔÚÕâЩÏà¹ØµÄÊý¾ÝÎļþ,¶øÇÒÖ»ÓÐÕâЩÏà¹ØµÄÎļþOracle²ÅÄܹ»½âÊÍÓë¹ÜÀíÕâЩ´æ´¢.OracleÊý¾ÝÎļþ¾ßÓÐÒÔÏÂһЩÌØÐÔ:
1.Ò»¸öÊý¾ÝÎļþ½ö½ö¹ØÁªÒ»¸öÊý¾Ý¿â,OracleÊý¾ÝÎļþÓëÊý¾Ý¿âÖ®¼ä¶ÔÓ¦¹ØϵÊÇÒ»¶ÔÒ»¹Øϵ,µ±È»· ......
Oracle ÎÞ¼àÌý³ÌÐò
½üÈÕ±¾µØµÄOracleÊý¾Ý¿âÎÞ·¨Á¬½Ó£¬Å׳öÎÞ¼àÌý³ÌÐò´íÎó£¬baigoogleduһϣ¬×ܽáÁËÈçϽâ¾ö·½°¸£º
First£º
Ò»¡¢ÔËÐмàÌýÆ÷
¡¡¡¡ÔÚCMDÖÐÊäÈëÒÔÏÂÄÚÈÝ:
C:>lsnrctl
LSNRCTL for 32-bit Windows: Version 8.1.6.0.0 - Production on 14-3ÔÂ -2003 14:17
: ......
ÔÚ°²×°ÍêOracle 10gÖ®ºó£¬Ïë´ò¿ªsql*plusÀ´Ñ§Ï°£¬È»ºó°´ÕÕÊéÉϵIJ½ÖèÓÃscottÓû§À´Á¬½ÓÊý¾Ý¿â£¬¿ÉÊäÁ˺ü¸´Î¶¼Ìáʾһ¸ö´íÎó¡£
¡¡¡¡error£º the account is locked
¡¡¡¡È»ºóÉÏÍø²éÁËÒ»ÏÂÖ®ºó·¢ÏÖÕâ¸öÓû§±»Ëø¶¨ÁË£¬ÖÁÓÚËüΪʲô±»Ëø¶¨£¬¿ÉÄÜÊÇÏÂÃ漸¸öÔÒò¡£
¡¡¡¡1.³¢ÊÔ¶à´ÎµÇ¼δ³É¹¦.(¿ÉÄÜÃÜÂë²»ÕýÈ·)
¡¡¡¡2.´ËÓû§±»¹ ......