Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ORACLE´¦ÀíÅÅÐò¿ÕÖµ

Ö÷Òª·½·¨ÊÇͨ¹ýʹÓÃCASE±í´ïʽÀ´“±ê¼Ç”Ò»¸öÖµÊÇ·ñΪNULL¡£ÕâÀï±ê¼ÇÓÐÁ½¸öÖµ£¬Ò»¸ö±íʾNULL£¬Ò»¸ö±íʾ·ÇNULL¡£ÕâÑù£¬Ö»ÒªÔÚORDER BY×Ó¾äÖÐÔö¼Ó±ê¼ÇÁУ¬±ã¿ÉÒÔºÜÈÝÒ׵ĿØÖÆ¿ÕÖµÊÇÅÅÔÚÇ°Ã滹ÊÇÅÅÔÚºóÃ棬¶ø²»»á±»¿ÕÖµËù¸ÉÈÅ¡£
SQL> select ename,sal,comm from emp;
ENAME SAL COMM
---------- ---------- ----------
SMITH 800
ALLEN 1600 300
WARD 1250 500
JONES 2975
MARTIN 1250 1400
BLAKE 2850
CLARK 2450
SCOTT 3000
KING 5000
TURNER 1500 0
ADAMS 1100
ENAME SAL COMM
---------- ---------- ----------
JAMES 950
FORD 3000
MILLER 1300
14 rows selected.

//·Ç¿ÕÖµ°´ÉýÐòÅÅÐò ¿ÕÖµÅÅ×îºó
SQL> select ename,sal,comm from
2 (
3 select ename,sal,comm,
4 case when comm is null then 0 else 1 end as is_null
5 from emp
6 ) x
7 order by is_null desc,comm
8 ;
ENAME SAL COMM
---------- ---------- ----------
TURNER 1500 0
ALLEN 1600 300
WARD 1250 500
MARTIN 1250 1400
SCOTT 3000
KING 5000
ADAMS 1100
JAMES 950
FORD 3000
MILLER 1300
BLAKE 2850
ENAME SAL COMM
---------- ---------- ----------
JONES 2975
SMITH 800
CLARK 2450
14 rows selected.

//·Ç¿ÕÖµ°´½µÐòÅÅÐò ¿ÕÖµÅÅ×îºó
SQL> select ename,sal,comm from
2 (
3 select ename,sal,comm,
4 case when comm is null then 0 else 1 end as is_null
5 from emp
6 ) x
7 order by is_null desc,comm desc
8 ;
ENAME SAL COMM
---------- ---------- ----------
MARTIN 1250 1400
WARD 1250 500
ALLEN 1600 300
TURNER 1500 0
SCOTT 3000
KIN


Ïà¹ØÎĵµ£º

oracle¸´Ï°£¨Ò»£© Ö®OracleÌåϵ½á¹¹

      ѧϰOracle DBAÒ²°ë¸ö¶àѧÆÚÁË£¬½ñÌìÃÍÈ»²Å·¢ÏÖ£¬Ô­À´ÎÒµÄÊ黹ÊǺÜеģ¬ÉϿβÙ×÷ʱºòÒ²Ö»ÊÇÖªµÀ´ó¸ÅÔõô×ö£¬µ«ÊÇÒªÕæµÄÈ«²¿×Ô¼º×ö£¬¶ø²»È¥·­Ê黹ÊÇÓÐÒ»¶¨µÄÄѶȵģ¬ËùÒÔÄØ£¬½ñÌ쿪ʼ½«DBA´ÓÍ·¸´Ï°Ò»±é£¬Í¬Ê±ÔÙ²Ù×÷Ò»±é¡£
      µÚÒ»Õ£¬Ñ§µÄÊÇOracleµÄÌåϵ½á¹¹£ ......

ORACLE RAC¹¤×÷Ô­Àí


ORACLE RAC¹¤×÷Ô­Àí
ORACLE RAC¹¤×÷Ô­Àí
¡¡¡¡ÔÚÒ»¸öÓ¦Óû·¾³µ±ÖУ¬ËùÓеķþÎñÆ÷ʹÓú͹ÜÀíͬһ¸öÊý¾Ý¿â£¬Ä¿µÄÊÇΪÁË·Öɢÿһ̨·þÎñÆ÷µÄ¹¤×÷Á¿£¬Ó²¼þÉÏÖÁÉÙÐèÒªÁ½Ì¨ÒÔÉϵķþÎñÆ÷£¬¶øÇÒ»¹ÐèÒªÒ»¸ö¹²Ïí´æ´¢É豸¡£Í¬Ê±»¹ÐèÒªÁ½ÀàÈí¼þ£¬Ò»¸öÊǼ¯ÈºÈí¼þ£¬ÁíÍâÒ»¸ö¾ÍÊÇOracleÊý¾Ý¿âÖеÄRAC×é¼þ¡£Í¬Ê±ËùÓзþÎñÆ÷ÉϵÄOS¶¼Ó¦¸ÃÊÇÍ ......

ÈçºÎ²é¿´ºÍÇå³ýoracleÎÞÓõÄÁ¬½Ó½ø³Ì


DBAÒª¶¨Ê±¶ÔÊý¾Ý¿âµÄÁ¬½ÓÇé¿ö½øÐмì²é£¬¿´ÓëÊý¾Ý¿â½¨Á¢µÄ»á»°ÊýÄ¿ÊDz»ÊÇÕý³££¬Èç¹û½¨Á¢Á˹ý¶àµÄÁ¬½Ó£¬»áÏûºÄÊý¾Ý¿âµÄ×ÊÔ´¡£Í¬Ê±£¬¶ÔһЩ“¹ÒËÀ”µÄÁ¬½Ó£¬¿ÉÄÜ»áÐèÒªDBAÊÖ¹¤½øÐÐÇåÀí¡£
ÒÔϵÄSQLÓï¾äÁгöµ±Ç°Êý¾Ý¿â½¨Á¢µÄ»á»°Çé¿ö:
select sid,serial#,username,program,machine,status
from v$session; ......

½â¶ÁORACLEÊý¾Ý¿âµÄͳһÃüÃûÓë±àÂë¹æ·¶

1¡¢±àдĿµÄ
ʹÓÃͳһµÄÃüÃûºÍ±àÂë¹æ·¶£¬Ê¹Êý¾Ý¿âÃüÃû¼°±àÂë·ç¸ñ±ê×¼»¯£¬ÒÔ±ãÓÚÔĶÁ¡¢Àí½âºÍ¼Ì³Ð¡£
2¡¢ÊÊÓ÷¶Î§
±¾¹æ·¶ÊÊÓÃÓÚ¹«Ë¾·¶Î§ÄÚËùÓÐÒÔORACLE×÷Ϊºǫ́Êý¾Ý¿âµÄÓ¦ÓÃϵͳºÍÏîÄ¿¿ª·¢¹¤×÷¡£
3¡¢¶ÔÏóÃüÃû¹æ·¶
3.1 Êý¾Ý¿âºÍSID
Êý¾Ý¿âÃû¶¨ÒåΪϵͳÃû+Ä£¿éÃû
¡ï È«¾ÖÊý¾Ý¿âÃûºÍÀý³ÌSID ÃûÒªÇóÒ»ÖÂ
¡ï ÒòSID ......

ORACLE¶Ô×ÖĸºÍÊý×Ö»ìºÏµÄÊý¾ÝÅÅÐò

Ö÷ÒªÊÇͨ¹ýreplaceºÍtranslateÀ´ÊµÏÖ
SQL> create view v_tt
2 as
3 select ename||' '||deptno as data
4 from emp;
View created.
SQL> select * from v_tt;
DATA
---------------------------------------------------
SMITH 20
ALLEN 30
WARD 30
JONES 20
MARTIN 30
BLAKE 30
CLARK 10
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ