oracle ÊÓƵ±Ê¼Ç2(CreateNewUser)
1.±¸·Ýscott
£¨1£©ÔÚCÅ̵ĸùĿ¼Ï´´½¨Ò»¸öÎļþ¼Ðtemp
£¨2£©ÔÚcmdÔÚ½øÈëÎļþ¼Ð£¬del *.* £¬É¾³ýËùÓÐÎļþ¡£
£¨3£©ÊäÈëexp
£¨4£©ÊäÈëÓû§ÃûºÍÃÜÂë:scott/tiger
£¨5£©¾Í»áÏÔʾ“ÊäÈëÊý×éÌáÈ¡»º³åÇø´óС”£¬ÔÚÕâÒ»²½Ö±½Ó»Ø³µ¾ÍÐÐÁË
£¨6£©ÏÔʾ“µ¼³öÎļþ£ºDXPDAT.DMP>”£¬ÕâÒ»²½Ò²Êǻسµ
£¨7£©Ñ¡Ôñµ¼³öÓû§£¨¾ÍÊǵ¼³öÓû§µÄËùÓÐÊý¾Ý£©»¹Êǵ¼³ö±í£¬Ä¬ÈϾÍÊǵ¼³öÓû§£¬ËùÒÔÖ±½Ó»Ø³µ
£¨8£©½ÓÏÂÀ´¾ÍÒ»Ö±»Ø³µµ½½áÊø
2.´´½¨ÐµÄÓû§
£¨1£©ÔÚsqlplusÔÚÖеǼscottÓû§
£¨2£©ÊäÈëcreate user kevin identified by liuchao default tablespace users quota 10M on users;£¬±íʾ´´½¨Óû§kevin,
ÃÜÂëkevin,¿Õ¼äΪ10M
£¨3£©Èç¹ûÏÔʾ“ȨÏÞ²»×㔣¬ÔòÊÚȨ£ºÊäÈë“conn sys/520419 as sysdba;”»Ø³µ£¬ÔÙÊäÈë“grant create user to scott;”»Ø³µ£»
ÊäÈë“conn scott/tiger”»Ø³µ£¬ÔÙÖظ´µÚ£¨2£©²½¡£
£¨4£©ÊÚȨgrant create session, create table, create view to kevin
Ïà¹ØÎĵµ£º
µÚ¾ÅÕÂ½Ú :´¥·¢Æ÷±àÂë
´¥·¢Æ÷ÊÇ´æ´¢ÔÚÊý¾Ý¿â´æÖÐÒþʽµÄÔËÐлòÕß±»´¥·¢µÄÒ»¶Î³ÌÐò£¬µ±Ä³Ð©Ê¼þ·¢Éú¡£Í¨³£Çé¿öÏ£¬´¥·¢Æ÷ÖÐÖ§³Ö¿ÉÖ´ÐеÄÒ»¶Îpl/sql´úÂë¿é£¬µ±Ò»¸öinsert,update,»òÕßdeleteÃüÃû·¢ÉúÔÚÒ»¸ö±í»òÕßÊÓͼÉϵÄʱºò¡£ÆäÒ²Ö§³ÖϵͳºÍÊý¾Ý¿â»òÕß·½°¸Ê¼þ.oracleÊý¾Ý¿âÒ²Ö§³Ö´¥·¢Æ÷Öк¬Ó ......
ÔÚOracleÖпÉÒÔ´´½¨×éºÏË÷Òý£¬¼´Í¬Ê±°üº¬Á½¸ö»òÁ½¸öÒÔÉÏÁеÄË÷Òý¡£ÔÚ×éºÏË÷ÒýµÄʹÓ÷½Ã棬OracleÓÐÒÔÏÂÌص㣺
1¡¢ µ±Ê¹ÓûùÓÚ¹æÔòµÄÓÅ»¯Æ÷£¨RBO£©Ê±£¬Ö»Óе±×éºÏË÷ÒýµÄÇ°µ¼ÁгöÏÖÔÚSQLÓï¾äµÄwhere×Ó¾äÖÐʱ£¬²Å»áʹÓõ½¸ÃË÷Òý£»
2¡¢ ÔÚʹÓÃOracle9i֮ǰµÄ»ùÓڳɱ¾µÄÓÅ»¯Æ÷£¨CBO£©Ê± ......
½ñÌìÔÚ¹äÂÛ̳µÄʱºò¿´µ½shiyiwanͬѧдÁËÒ»¸öºÜ¼òµ¥µÄÓï¾ä£¬¿ÉÊÇorder byºóÃæµÄÐÎʽȴ±È½ÏÐÂÓ±£¨¶ÔÓÚÎÒÀ´ËµÅ¶£©£¬ÒÔÇ°´ÓÀ´Ã»¿´¹ýÕâÖÖÓ÷¨£¬¾ÍÏë¼ÇÏÂÀ´£¬ÕýºÃ×ܽáÒ»ÏÂORDER BYµÄ֪ʶ¡£
1¡¢ORDER BY ÖйØÓÚNULLµÄ´¦Àí
ȱʡ´¦Àí£¬OracleÔÚOrder by ʱÈÏΪnullÊÇ×î´óÖµ£¬ËùÒÔÈç¹ûÊÇASCÉýÐòÔòÅÅÔÚ×îºó£¬DESC½µÐòÔòÅÅÔÚ×îÇ°¡£
......
ÊÕ¼¯µÄ¼¸ÌõÔÚoracleÖÐͨ¹ýconnect by priorÀ´ÊµÏֵݹé²éѯ
Start with...Connect By×Ó¾äµÝ¹é²éѯһ°ãÓÃÓÚÒ»¸ö±íά»¤Ê÷ÐνṹµÄÓ¦Óá£
´´½¨Ê¾Àý±í£º
CREATE TABLE TBL_TEST
(
ID NUMBER,
NAME VARCHAR2(100 BYTE),
PID NUMBER ......