OracleÖвéѯ±íµÄ´óСºÍ±í¿Õ¼äµÄ´óС
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/cosio/archive/2009/03/11/3978747.aspx
ÓÐÁ½ÖÖº¬ÒåµÄ±í´óС¡£Ò»ÖÖÊÇ·ÖÅä¸øÒ»¸ö±íµÄÎïÀí¿Õ¼äÊýÁ¿£¬¶ø²»¹Ü¿Õ¼äÊÇ·ñ±»Ê¹Ó᣿ÉÒÔÕâÑù²éѯ»ñµÃ×Ö½ÚÊý£º
select segment_name, bytes
from user_segments
where segment_type = 'TABLE';
»òÕß
Select Segment_Name,Sum(bytes)/1024/1024 from User_Extents Group By Segment_Name
ÁíÒ»ÖÖ±íʵ¼ÊʹÓõĿռ䡣ÕâÑù²éѯ£º
analyze table emp compute statistics;
select num_rows * avg_row_len
from user_tables
where table_name = 'EMP';
²é¿´Ã¿¸ö±í¿Õ¼äµÄ´óС
Select Tablespace_Name,Sum(bytes)/1024/1024 from Dba_Segments Group By Tablespace_Name
1.²é¿´Ê£Óà±í¿Õ¼ä´óС
SELECT tablespace_name ±í¿Õ¼ä,sum(blocks*8192/1000000) Ê£Óà¿Õ¼äM from dba_free_space GROUP BY tablespace_name;
2.¼ì²éϵͳÖÐËùÓбí¿Õ¼ä×ÜÌå¿Õ¼ä
select b.name,sum(a.bytes/1000000)×Ü¿Õ¼ä from v$datafile a,v$tablespace b where a.ts#=b.ts# group by b.name;
¡¡¡¡1¡¢²é¿´OracleÊý¾Ý¿âÖбí¿Õ¼äÐÅÏ¢µÄ¹¤¾ß·½·¨£º
¡¡¡¡Ê¹ÓÃoracle enterprise manager console¹¤¾ß£¬ÕâÊÇoracleµÄ¿Í»§¶Ë¹¤¾ß£¬µ±°²×°oracle·þÎñÆ÷»ò¿Í»§¶Ëʱ»á×Ô¶¯°²×°´Ë¹¤¾ß£¬ÔÚwindows²Ù×÷ϵͳÉÏÍê³Éoracle°²×°ºó£¬Í¨¹ýÏÂÃæµÄ·½·¨µÇ¼¸Ã¹¤¾ß£º¿ªÊ¼²Ëµ¥——³ÌÐò——Oracle-OraHome92——Enterprise Manager Console(µ¥»÷)——oracle enterprise manager consoleµÇ¼——Ñ¡Ôñ‘¶ÀÁ¢Æô¶¯’µ¥Ñ¡¿ò——‘È·¶¨’ —— ‘oracle enterprise manager console£¬¶ÀÁ¢’ ——Ñ¡ÔñÒªµÇ¼µÄ‘ʵÀýÃû’ ——µ¯³ö‘Êý¾Ý¿âÁ¬½ÓÐÅÏ¢’ ——ÊäÈë’Óû§Ãû/¿ÚÁî’ (Ò»°ãʹÓÃsysÓû§)£¬’Á¬½ÓÉí·Ý’Ñ¡ÔñÑ¡ÔñSYSDBA——‘È·¶¨’£¬ÕâʱÒѾ³É¹¦µÇ¼¸Ã¹¤¾ß£¬Ñ¡Ôñ‘´æ´¢’ ——±í¿Õ¼ä£¬»á¿´µ½ÈçϵĽçÃ棬¸Ã½çÃæÏÔʾÁ˱í¿Õ¼äÃû³Æ£¬±í¿Õ¼äÀàÐÍ£¬Çø¹ÜÀíÀàÐÍ£¬ÒÔ”ÕהΪµ¥Î»µÄ±í¿Õ¼ä´óС£¬ÒÑʹÓõıí¿Õ¼ä´óС¼°±í¿Õ¼äÀûÓÃÂÊ¡£
¡¡¡¡Í¼1 ±í¿Õ¼ä´óС¼°Ê¹ÓÃÂÊ
¡¡¡¡2¡¢²é¿´OracleÊý¾Ý¿âÖбí¿Õ¼äÐÅÏ¢µÄÃüÁî·½·¨£º
¡¡¡¡Í¨¹ý²éѯÊý¾Ý¿âϵÍ
Ïà¹ØÎĵµ£º
²é¿´Ëø±í½ø³ÌSQLÓï¾ä1£º
select sess.sid,
sess.serial#,
lo.oracle_username,
lo.os_user_name,
ao.object_name,
lo.locked_mode
from v$locked_object lo,
dba_ ......
author£ºskate
time£º2010-05-25
OracleÊý¾Ý¿â¹ÜÀí½Å±¾ËµÃ÷
Oracle ÖеÄÊý¾Ý×ÖµäÊÇÊý¾Ý¿âÖеķdz£ÖØÒªµÄÒ»²¿·Ö£¬ÌṩÁËÏà¹ØÊý¾Ý¿âµÄÐÅÏ¢£¬ËüÊÇËùÓÐOracleÓû§£¨´ÓÓ¦ÓõÄ×îÖÕÓû§¡¢Ó¦ÓõÄÉè¼Æ¿ª·¢Õßµ½Êý¾Ý¿â¹ÜÀíÔ±£©µÄ·Ç³£ÖØÒªµÄÐÅÏ¢À´Ô´¡£Êý¾Ý×ÖµäµÄ´´½¨£¬ÊÇÔÚOracleÊý¾Ý¿â´´½¨Íê±Ïºó£¬ÔËÐÐһЩÏà¹ØµÄÊý¾Ý¿â¹ÜÀí½Å±¾À´Íê ......
Òª´´½¨Á½¸öÎļþ
1: runBatch.bat
2: sql.txt
runBatch.bat ÄÚÈÝÈçÏ£º
sqlplus username/password @sql.txt
pause
sql.txtÄÚÈÝÈçÏ£º
spool sql.log
create table t1(cname char(20));
insert into t1(cname) values('test');
select * from t1;
spool off
exit
Ë«»÷runBatch.bat¾Í¿ÉÒÔÅúÁ¿Ö´ÐÐsql.txtÖÐ ......
×Ö·ûº¯Êý
ÏÂÃæÊÇOracleÖ§³ÖµÄ×Ö·ûº¯ÊýºÍËüÃǵÄMicrosoft SQL ServerµÈ¼Ûº¯Êý¡£
º¯Êý Oracle Microsoft SQL¡¡Server
°Ñ×Ö·ûת»»ÎªASCII :ASCII ASCII
×Ö´®Á¬½Ó: CONCAT --------------(expression + expression)
°ÑASCIIת»»Îª×Ö·û CHR, CHAR
·µ»Ø×Ö·û´®ÖеĿªÊ¼×Ö·û£¨×óÆ𣩠INSTR ,---------------CHARINDEX
......
½ñÌìÅöµ½Ò»¸öÎÊÌ⣬ͨ¹ýÒ»¸öSQLÓï¾ä²éѯʱ£¬³öÈçÏÂÎÊÌ⣺
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "WMSYS.WM_CONCAT_IMPL", line 30
ÎÊÌâ³öÏÖÔÚͨ¹ýWMSYS. ......