oracle鏁版嵁搴?/span>鐨勬潈闄?a class="keylink" href="http://www.2cto.com/os/" target="_blank">绯荤粺鍒嗕负绯荤粺鏉冮檺涓庡璞℃潈闄愩€傜郴缁熸潈闄? database system privilege )鍙互璁╃敤鎴锋墽琛岀壒瀹氱殑鍛戒护闆嗐€備緥濡傦紝create table鏉冮檺鍏佽鐢ㄦ埛鍒涘缓琛紝grant any privilege 鏉冮檺鍏佽鐢ㄦ埛鎺堜簣浠讳綍绯荤粺鏉冮檺銆傚璞℃潈闄? database object privilege )鍙互璁╃敤鎴疯兘澶熷鍚勪釜瀵硅薄杩涜鏌愪簺鎿嶄綔銆備緥濡俤elete鏉冮檺鍏佽鐢ㄦ埛鍒犻櫎琛ㄦ垨瑙嗗浘鐨勮锛宻elect鏉冮檺鍏佽鐢ㄦ埛閫氳繃select浠庤〃銆佽鍥俱€佸簭鍒?sequences)鎴栧揩鐓?snapshots)涓煡璇俊鎭€?/p>
聽 銆€銆€姣忎釜oracle鐢ㄦ埛閮芥湁涓€涓悕瀛楀拰鍙d护,骞舵嫢鏈変竴浜涚敱鍏跺垱寤虹殑琛ㄣ€佽鍥惧拰鍏朵粬璧勬簮銆俹racle瑙掕壊(role)灏辨槸涓€缁勬潈闄?privilege)(鎴栬€呮槸姣忎釜鐢ㄦ埛鏍规嵁鍏剁姸鎬佸拰鏉′欢鎵€闇€鐨勮闂被鍨?銆傜敤鎴峰彲浠ョ粰瑙掕壊鎺堜簣鎴栬祴浜堟寚瀹氱殑鏉冮檺锛岀劧鍚庡皢瑙掕壊璧嬬粰鐩稿簲鐨勭敤鎴枫€備竴涓敤鎴蜂篃鍙互鐩存帴缁欏叾浠栫敤鎴锋巿鏉?/p>
聽聽聽聽聽聽 涓€銆佸垱寤虹敤鎴?/p>
聽聽聽聽聽聽 oracle鍐呴儴鏈変袱涓缓濂界殑鐢ㄦ埛锛歴ystem鍜宻ys銆傜敤鎴峰彲鐩存帴鐧诲綍鍒皊ystem鐢ㄦ埛浠ュ垱寤哄叾浠栫敤鎴凤紝鍥犱负system鍏锋湁鍒涘缓鍒?鐨勭敤鎴风殑 鏉冮檺銆?鍦ㄥ畨瑁卭racle鏃讹紝鐢ㄦ埛鎴栫郴缁熺鐞嗗憳棣栧厛鍙互涓鸿嚜宸卞缓绔嬩竴涓敤鎴枫€備緥 濡?锛?/p>
聽 Sql浠g爜聽 聽聽聽聽聽聽 鍒涘缓鐢ㄦ埛锛?/p>
聽聽聽聽聽聽 create user cmis identified by聽 "cmis";聽聽 聽 銆€ 淇敼鍙d护锛?/p>
聽聽聽聽聽聽聽 alter user cmis identified by "cmis2008";聽 銆€銆€闄や簡alter user鍛戒护浠ュ锛岀敤鎴疯繕鍙互浣跨敤password鍛戒护銆傚鏋滀娇鐢╬assword鍛戒护锛岀敤鎴疯緭鍏ョ殑鏂板彛浠ゅ皢涓嶅湪灞忓箷涓婃樉绀恒€傛湁dba鐗规潈鐨勭敤鎴峰彲浠ラ€氳繃password鍛戒护鏀瑰彉浠讳綍鍏朵粬鐢ㄦ埛鐨勫彛浠?鍏朵粬鐢ㄦ埛鍙兘鏀瑰彉鑷繁鐨勫彛浠ゃ€?/p>
聽 銆€銆€褰撶敤鎴疯緭鍏assword鍛戒护鏃讹紝绯荤粺灏嗘彁绀虹敤鎴疯緭鍏ユ棫鍙d护鍜屾柊鍙d护锛屽涓嬫墍绀猴細 聽 銆€銆€password 聽聽 銆€changing password for cmis 聽聽聽聽聽聽 old password:cmis2008 聽聽聽聽聽聽 new password:cmis 聽聽聽聽聽聽 retype new password: 聽聽聽聽聽聽 褰撴垚鍔熷湴淇敼浜嗗彛浠ゆ椂锛岀敤鎴蜂細寰楀埌濡備笅鐨勫弽棣堬細 聽聽聽聽聽聽 password changed 聽 銆€銆€浜?銆佸垹闄ょ敤鎴?/p>
聽 銆€銆€鍒犻櫎鐢ㄦ埛锛屽彲浠ヤ娇鐢╠rop user鍛戒护锛屽涓嬫墍绀猴細 聽 銆€銆€drop user cmis; 聽 銆€銆€濡傛灉鐢ㄦ埛鎷ユ湁瀵硅薄锛屽垯涓嶈兘鐩存帴鍒犻櫎锛屽惁鍒欏皢杩斿洖涓€涓敊璇€笺€傛寚瀹氬叧閿瓧cascade锛屽彲鍒犻櫎鐢ㄦ埛鎵€鏈夌殑瀵硅薄锛岀劧鍚庡啀鍒犻櫎鐢ㄦ埛銆備笅闈㈢殑渚嬪瓙鐢ㄦ潵鍒犻櫎鐢ㄦ埛涓庡叾瀵硅薄锛?/p>
聽 銆€銆€drop user cmis cascade; 聽 銆€銆€涓?銆?绉嶆爣鍑嗚鑹?/p>
聽 銆€銆€qracle涓轰簡鍏煎浠ュ墠鐨勭増鏈紝鎻愪緵浜嗕笁绉嶆爣鍑嗙殑瑙掕壊(role)锛歝onnect銆乺esource鍜宒ba銆?/p>
聽 銆€銆€1. connect role(杩炴帴瑙掕壊) 聽 銆€銆€涓存椂鐢ㄦ埛锛岀壒鍒槸閭d簺涓嶉渶瑕佸缓琛ㄧ殑鐢ㄦ埛锛岄€氬父鍙祴浜堜粬浠琧onnect role銆俢onnect鏄娇鐢╫racle鐨勭畝鍗曟潈闄愶紝杩欑鏉冮檺鍙湁鍦ㄥ鍏朵粬鐢ㄦ埛鐨勮〃鏈夎闂潈鏃讹紝鍖呮嫭select銆乮nsert銆乽pdate鍜宒elete绛夛紝鎵嶄細鍙樺緱鏈夋剰涔夈€傛嫢鏈塩onnect role鐨勭敤鎴蜂笉鑳藉鍒涘缓琛ㄣ€佽鍥俱€佸簭鍒?sequence)銆佺皣(cluster)銆佸悓涔夎瘝(synonym )銆佷細璇?session)鍜屼笌鍏朵粬鏁版嵁搴撶殑閾?link)銆?/p>
聽 銆€銆€2. resource role(璧勬簮瑙掕壊) 聽 銆€銆€鏇村彲闈犲拰姝e紡鐨勬暟鎹簱鐢ㄦ埛鍙互鎺堜簣resource role銆俽esource鎻愪緵缁欑敤鎴峰彟澶栫殑鏉冮檺浠ュ垱寤轰粬浠嚜宸辩殑琛ㄣ€佸簭鍒椼€佽繃绋?procedure)銆佽Е鍙戝櫒(trigger)銆佺储寮?index)鍜岀皣(cluster)銆?/p>
聽 銆€銆€3. dba role(鏁版嵁搴撶鐞嗗憳瑙掕壊) 聽 銆€銆€dba role鎷ユ湁鎵€鏈夌殑绯荤粺鏉冮檺----鍖呮嫭鏃犻檺鍒剁殑绌洪棿闄愰鍜岀粰鍏朵粬鐢ㄦ埛鎺堜簣鍚勭鏉冮檺鐨勮兘鍔涖€俿ystem鐢眃ba鐢ㄦ埛鎷ユ湁銆備笅闈粙缁嶄竴浜沝ba缁忓父浣跨敤鐨勫吀鍨嬫潈闄愩€?/p>
聽 銆€銆€(1)grant(鎺堟潈)鍛戒护 聽 銆€銆€涓嬮潰瀵瑰垰鎵嶅垱寤虹殑鐢ㄦ埛cmis 鎺堟潈锛屽懡浠ゅ涓嬶細 聽 銆€銆€grant connect, resource to cmis; 聽 銆€銆€(2)revoke(鎾ゆ秷)鏉冮檺 聽 銆€銆€宸叉巿浜堢殑鏉冮檺鍙互鎾ゆ秷銆備緥濡傛挙娑?1)涓殑鎺堟潈锛屽懡浠ゅ涓嬶細 聽 銆€銆€revoke connect, resource from cmis; 聽 銆€銆€涓€涓叿鏈塪ba瑙掕壊鐨勭敤鎴峰彲浠ユ挙娑堜换浣曞埆鐨勭敤鎴风敋鑷冲埆鐨刣ba鐨刢onnect銆乺esource 鍜宒ba鐨勫叾浠栨潈闄愩€傚綋鐒讹紝杩欐牱鏄緢鍗遍櫓鐨勶紝鍥犳锛岄櫎闈炵湡姝i渶瑕侊紝dba鏉冮檺涓嶅簲闅忎究鎺堜簣閭d簺涓嶆槸寰堥噸瑕佺殑涓€鑸敤鎴枫€?鎾ゆ秷涓€涓敤鎴风殑鎵€鏈夋潈闄愶紝骞朵笉鎰忓懗鐫€浠巓racle涓垹闄や簡杩欎釜鐢ㄦ埛锛?涔熶笉浼氱牬鍧忕敤鎴峰垱寤虹殑浠讳綍琛?鍙槸绠€鍗曠姝㈠叾瀵硅繖浜涜〃鐨勮闂€傚叾浠栬璁块棶杩欎簺琛ㄧ殑鐢ㄦ埛鍙互璞′互鍓嶉偅鏍峰湴璁块棶杩欎簺琛ㄣ€?/p>
聽 銆€銆€鍥涖€佸垱寤鸿鑹?/p>
聽 銆€銆€闄や簡鍓嶉潰璁插埌鐨勪笁绉嶇郴缁熻鑹?---connect銆乺esource鍜宒ba锛岀敤鎴疯繕鍙互鍦╫racle鍒涘缓鑷繁鐨剅ole銆傜敤鎴峰垱寤虹殑role鍙互鐢辫〃鎴栫郴缁熸潈闄愭垨涓よ€呯殑缁勫悎鏋勬垚銆備负浜嗗垱寤簉ole锛岀敤鎴峰繀椤诲叿鏈塩reate role绯荤粺鏉冮檺銆備笅闈㈢粰鍑轰竴涓猚reate role鍛戒护鐨勫疄渚嬶細 聽 銆€銆€create role student; 聽 銆€銆€杩欐潯鍛戒护鍒涘缓浜嗕竴涓悕涓簊tudent鐨剅ole銆?/p>
聽 銆€銆€涓€鏃﹀垱寤轰簡涓€涓猺ole锛岀敤鎴峰氨鍙互缁欎粬鎺堟潈銆傜粰role鎺堟潈鐨刧rant鍛戒护鐨勮娉曚笌瀵瑰鐢ㄦ埛鐨勮娉曠浉鍚屻€傚湪缁檙ole鎺堟潈鏃讹紝鍦╣rant鍛戒护鐨則o瀛愬彞涓浣跨敤role鐨勫悕绉帮紝濡備笅鎵€绀猴細 聽 銆€銆€grant select on class to student; 聽