sql ²é±í¿Õ¼äÓï¾ä
SELECT UPPER(F.TABLESPACE_NAME) "±í¿Õ¼äÃû",
D.TOT_GROOTTE_MB "±í¿Õ¼ä´óС(M)",
D.TOT_GROOTTE_MB - F.TOTAL_BYTES "ÒÑʹÓÿռä(M)",
TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,
2),
'990.99') "ʹÓñÈ",
F.TOTAL_BYTES "¿ÕÏпռä(M)",
F.MAX_BYTES "×î´ó¿é(M)"
from (SELECT TABLESPACE_NAME,
ROUND(SUM(BYTES) / (1024 * 1024), 2) TOTAL_BYTES,
ROUND(MAX(BYTES) / (1024 * 1024), 2) MAX_BYTES
from SYS.DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) F,
(SELECT DD.TABLESPACE_NAME,
ROUND(SUM(DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB
from SYS.DBA_DATA_FILES DD
GROUP BY DD.TABLESPACE_NAME) D
WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME
ORDER BY 4 DESC
Ïà¹ØÎĵµ£º
£¨1£©ÕûºÏ¼òµ¥,ÎÞ¹ØÁªµÄÊý¾Ý¿â·ÃÎÊ£º
¡¡¡¡Èç¹ûÄãÓм¸¸ö¼òµ¥µÄÊý¾Ý¿â²éѯÓï¾ä,Äã¿ÉÒÔ°ÑËüÃÇÕûºÏµ½Ò»¸ö²éѯÖÐ(¼´Ê¹ËüÃÇÖ®¼äûÓйØϵ)
£¨2£©É¾³ýÖظ´¼Ç¼£º
¡¡¡¡×î¸ßЧµÄɾ³ýÖظ´¼Ç¼·½·¨ ( ÒòΪʹÓÃÁËROWID)Àý×Ó£º
¡¡¡¡DELETE from EMP E WHERE E.ROWID > (SELECT MIN(X.ROWID)
¡¡¡¡from EMP X WHERE X.EMP_NO = E.EM ......
SQLÓï·¨ÓëÃüÁî
SELECT Óï¾ä
SELECT[predicate]{*|table.*|[table.]field [,[table.]field2[,...]]} [AS alias1
[,alias2[,...]]]
from tableexpression [,...][IN externaldatabase]
[WHERE...]
[GROUP BY...]
[HAVING...]
[ORDER BY...]
[WITH OWNERACCESS OPTION]
SELECT Óï¾ä°üÀ¨ÏÂÃ漸¸ö²¿·Ö
predicate
......
ת×Ô£ºhttp://book.csdn.net/bookfiles/235/10023510864.shtml
ÔÚʵ¼ÊSQLÓ¦ÓÃÖУ¬¾³£ÐèÒª½øÐзÖ×é¾ÛºÏ£¬¼´½«²éѯ¶ÔÏó°´Ò»¶¨Ìõ¼þ·Ö×飬Ȼºó¶Ôÿһ¸ö×é½øÐоۺϷÖÎö¡£
GROUP BY×Ӿ䴴½¨·Ö×é
´´½¨·Ö×éÊÇͨ¹ýGROUP BY×Ó¾äʵÏֵġ£ÓëWHERE×Ӿ䲻ͬ£¬GROUP BY×Ó¾äÓÃÓÚ¹éÄÉÐÅÏ¢ÀàÐÍ£¬ÒÔ»ã×ÜÏà¹ØÊý¾Ý¡£¶øΪʲôҪʹÓÃGROUP BY ......
sqlÓï¾ä²éѯ
±í½á¹¹ÊÇÕâÑù£º
ID ÐÕÃû ÐÔ±ð
1 ÕÅÈý ÄÐ
2 ÍõËÄ ÄÐ
3 ÀöÀö Å®
4 ÕÅÈý ÄÐ
5 ÕÔÁø ÄÐ
6 ¸ß½à ÄÐ
7 ......
ÉÁ»Ø
1 ÌØÕ÷
ÉÁ»ØÊý¾Ý¿âÖ»ÊÇÂß¼Êý¾ÝÔâµ½ÆÆ»µÊ±µÄÊֶΡ£
ÉÁ»ØÊý¾Ý¿âÈÕÖ¾±ØÐëÔÚÊý¾Ý¿â»Ö¸´ÇøÖд´½¨¡£
ÉÁ»ØÈÕÖ¾²»ÐèÒª¹éµµ£¬²»ÄÜÓÃÓÚÎïÀí»Ö¸´¡£
Ö´ÐÐÉÁ»ØÊý¾Ý¿â²Ù×÷ʱ£¬±³¾°½ø³ÌRVWR¾ÍÆô¶¯ÁË¡£
2 ʹÓÃÉÁ»ØÊý¾Ý¿â
3ÖÖ¹¤¾ß£¬SQL*Plus£¬RMAN£¬OEM¡£
£¨1£©ÒªÇó
ΪÁËʹÓÃÉÁ»ØÊý¾Ý¿â£¬Êý¾Ý¿â±ØÐë´¦Óڹ鵵ÈÕ־ģʽ¡ ......