¡¾×ª¡¿ORACLEÓû§Á¬½ÓµÄ¹ÜÀí
ÓÃϵͳ¹ÜÀíÔ±£¬²é¿´µ±Ç°Êý¾Ý¿âÓм¸¸öÓû§Á¬½Ó£º
SQL> select username,sid,serial# from v$session;
Èç¹ûҪͣij¸öÁ¬½ÓÓÃ
SQL> alter system kill session 'sid,serial#';
Èç¹ûÕâÃüÁî²»ÐÐ,ÕÒËüUNIXµÄ½ø³ÌÊý
SQL> select pro.spid from v$session ses,v$process pro where ses.sid=21 and ses.paddr=pro.addr;
˵Ã÷£º21ÊÇij¸öÁ¬½ÓµÄsidÊý
È»ºóÓà kill ÃüÁîɱ´Ë½ø³ÌºÅ¡£
Îå¡¢SQL*PLUSʹÓÃ
a¡¢½üÈëSQL*Plus
$sqlplus Óû§Ãû/ÃÜÂë
Í˳öSQL*Plus
SQL>exit
b¡¢ÔÚsqlplusϵõ½°ïÖúÐÅÏ¢
ÁгöÈ«²¿SQLÃüÁîºÍSQL*PlusÃüÁî
SQL>help
Áгöij¸öÌض¨µÄÃüÁîµÄÐÅÏ¢
SQL>help ÃüÁîÃû
c¡¢ÏÔʾ±í½á¹¹ÃüÁîDESCRIBE
SQL>DESC ±íÃû
d¡¢SQL*PlusÖеıà¼ÃüÁî
ÏÔʾSQL»º³åÇøÃüÁî
SQL>L
ÐÞ¸ÄSQLÃüÁî
Ê×ÏÈÒª½«´ý¸ÄÕýÐбäΪµ±Ç°ÐÐ
SQL>n
ÓÃCHANGEÃüÁîÐÞ¸ÄÄÚÈÝ
SQL>c/¾É/ÐÂ
ÖØÐÂÈ·ÈÏÊÇ·ñÒÑÕýÈ·
SQL>L
ʹÓÃINPUTÃüÁî¿ÉÒÔÔÚSQL»º³åÇøÖÐÔö¼ÓÒ»Ðлò¶àÐÐ
SQL>i
SQL>ÊäÈëÄÚÈÝ
e¡¢µ÷ÓÃÍⲿϵͳ±à¼Æ÷
SQL>edit ÎļþÃû
¿ÉÒÔʹÓÃDEFINEÃüÁîÉèÖÃϵͳ±äÁ¿EDITORÀ´¸Ä±äÎı¾±à¼Æ÷µÄÀàÐÍ£¬ÔÚlogin.sqlÎļþÖж¨ÒåÈçÏÂÒ»ÐÐ
DEFINE_EDITOR=vi
f¡¢ÔËÐÐÃüÁîÎļþ
SQL>START test
SQL>@test
³
Ïà¹ØÎĵµ£º
¸Ðл¶ÁÕß¿´¡¶Oracle´óÐÍÊý¾Ý¿âϵͳÔÚAIXUNIXÉϵÄʵսÏê½â¡·Õâ±¾Ê飬ÕâÀï»Ø´ðһЩ¶ÁÕßÓʼþÌá³öµÄÒ»¸ö½ÏΪ¹«¹²µÄÎÊÌ⣺ASMÓÐʲôÓã¿ÎªÊ²Ã´Óã¿ ASMÊÇOracle´Ó10g¿ªÊ¼ÌṩµÄÒ»ÖÖ´æ´¢¹ÜÀí¼¼Êõ£¬Ö¸µÄÊÇÒ»¸öÔÚÎïÀí¾í£¨»òÕß´ÅÅÌ·ÖÇø£©ÉÏÌرðΪOracleÊý¾ÝÎļþ¶ø´´½¨µÄ¡°×¨Óá±Îļþϵͳ¡£¸ÃÎļþϵͳÓÉOracleÄÚºËά ......
1.Oracleɾ³ýÖظ´¼Ç¼.
ɾ³ý±íÖжàÓàµÄÖظ´¼Ç¼£¬Öظ´¼Ç¼ÊǸù¾Ýµ¥¸ö×ֶΣ¨peopleId£©À´Åжϣ¬Ö»ÁôÓÐrowid×îСµÄ¼Ç¼.
delete from people
where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1)
and rowid not i ......
1.Êý¾Ý¿â¹éµµÄ£Ê½:
* ·Ç¹éµµÄ£Ê½:µ±Êý¾Ý¿âÊý¾ÝÖ»¶Á²»»á¸Ä±äʱ,Êý¾Ý²»»á¸Ä±ä,Êý¾Ý¿âÊʺÏÓ÷ǹ鵵ģʽ, ÕâÑùÌá¸ßÐÔÄÜ
&nb ......
ÔÚʹÓÃOracleÖÐʹÓÃRownum£¬»áÓÐЩÎó½â£¬ÏÖÕûÀíÏÂÍøÓÑÃǵÄÎÄÕ£¬Ï£ÍûÄÜÓÐËù°ïÖú£¬ºÇºÇ
¶ÔÓÚ Oracle µÄ rownum ÎÊÌ⣬ºÜ¶à×ÊÁ϶¼Ëµ²»Ö§³Ö>,>=,=,between...and£¬Ö»ÄÜÓÃÒÔÉÏ·ûºÅ(<¡¢<=¡¢!=)£¬²¢·Ç˵ÓÃ>,>=,=,between..and ʱ»áÌáʾSQLÓï·¨´íÎ󣬶øÊǾ³£ÊDz鲻³öÒ»Ìõ¼Ç¼À´£¬»¹»á³öÏÖËƺõÊÇĪÃûÆäÃîµÄ½á¹û ......