Oracle ASM Ïê½â
ASM:Automatic Storage Management, ÊÇOracle Ö÷ÍƵÄÒ»ÖÖÃæÏòOracleµÄ´æ´¢½â¾ö·½°¸£¬ ASM ºÍ RDBMS ·Ç³£ÏàËÆ£¬ASM Ò²ÊÇÓÉʵÀýºÍÎļþ×é³É£¬ Ò²¿ÉÒÔͨ¹ýsqlplus ¹¤¾ßÀ´Î¬»¤¡£
1. ASM ʵÀýÓÉSGA ºÍºǫ́½ø³Ì×é³É¡£
1.1 SGA ×é³É:
ASM ʵÀýµÄSGA°üÀ¨Buffer Cache£¬ Share Pool£¬ Large PoolµÈ¡£ ÐèҪעÒâµÄÊÇShare Pool£¬ ÒòΪExtent Map Òª·ÅÔÚÕⲿ·ÖµÄÄÚ´æÖУ¬ÐèÒª¸ü¾ßÊý¾ÝÁ¿À´¹À¼ÆExtent Map µÄ´óС×öÏàÓ¦µÄµ÷Õû¡£
Extent Map µÄ´óС¿ÉÒÔ¸ù¾ÝËùÓÐÎļþ´óСµÄºÍÀ´¹ÀË㣬ʹÓÃÏÂÃæµÄÓï¾äÀ´¼ÆËãËùÓÐÎļþºÍ£º
Select sum(bytes)/(1024*1024*1024) from v$datafile;
Select sum(bytes)/(1024*1024*1024) from v$logfile a, v$log b where a.Group#=b.Group#;
Select sum(bytes)/(1024*1024*1024) from v$tempfile where status='online';
Õâ3¸ösum µÄ×ܺͶÔÓ¦×ÅÊý¾Ý¿â´æ·ÅASMÖÐËùÓÐÎļþ´óС×ܺͣ¬ ¶ÔÓÚʹÓÃExternal Redundancy µÄ´ÅÅÌ×飬 ÿ100G ÐèÒª1MB µÄExtent Map£¬ ¸ù¾ÝÕâ¸ö±ÈÀý¼ÆËãExtent Map ËùÐèÒªµÄ¿Õ¼ä£¬ÔÚ¼ÓÉ϶îÍâµÄ2MB¾Í¿ÉÒÔÁË¡£ ÔÚʵ¼Ê¹¤×÷ÖÐÒ»°ã²»ÐèÒª¿¼ÂÇASM SGAµÄÅäÖ㬠ʹÓÃOracle ÌṩµÄȱʡֵ¾Í¿ÉÒÔÁË¡£
1.2 ºǫ́½ø³Ì
ASM ʵÀý±ÈRDBMS ʵÀý¶à2¸ö½ø³Ì£º RBAL ºÍ ABRn¡£
RBAL£º Õâ¸ö½ø³ÌÒ²½ÐRebalancer½ø³Ì£¬ ¸ºÔð¹æ»®ASM ´ÅÅÌ×éµÄReblance»î¶¯¡£
ABRn£ºÊÇRBAL½ø³ÌµÄ×Ó½ø³Ì£¬Õâ¸ö½ø³ÌÔÚÊýÁ¿ÉÏ¿ÉÒÔÓжà¸ö£¬ n´Ó1~9£¬ Õâ×é½ø³Ì¸ºÔðÕæÕý
Ïà¹ØÎĵµ£º
¸ãoracle¶¼»á¾³£Åöµ½rowid£¬±¾ÎÄÊDZÊÕ߸ù¾ÝÍøÉϸ÷λµÄÎÄÕ£¬¼ÓÉÏ×Ô¼ºÑ§Ï°ÖеÄÌå»á£¬×ܽá¶ø³É¡£
Ò».rowid¼ò½é
rowid¾ÍÊÇΨһ±êÖ¾¼Ç¼ÎïÀíλÖõÄÒ»¸öid£¬ÔÚoracle 8°æ±¾ÒÔÇ°£¬rowidÓÉfile#+block#+row#×é³É£¬Õ¼ÓÃ6¸öbytesµÄ¿Õ¼ä£¬10 bit µÄ file# ......
²»´íµÄ×ÊÁÏ,ת¹ýÀ´,·½±ãÈÕºó²é¿´Ê¹ÓÃ!!!
--¼à¿ØË÷ÒýÊÇ·ñʹÓÃ
alter index &index_name monitoring usage;
alter index &index_name nomonitoring usage;
select * from v$object_usage where index_name =
&index_name;
--ÇóÊý¾ÝÎļþµÄI/O·Ö²¼
select
df.name,phyrds,phywrts,phyblkrd,phyblkwrt,sin ......
SQLµÄÓÅ»¯Ó¦¸Ã´Ó5¸ö·½Ãæ½øÐе÷Õû£º
1.È¥µô²»±ØÒªµÄ´óÐͱíµÄÈ«±íɨÃè
2.»º´æСÐͱíµÄÈ«±íɨÃè
3.¼ìÑéÓÅ»¯Ë÷ÒýµÄʹÓÃ
4.¼ìÑéÓÅ»¯µÄÁ¬½Ó¼¼Êõ
5.¾¡¿ÉÄܼõÉÙÖ´Ðмƻ®µÄCost
SQLÓï¾ä£º
ÊǶÔÊý¾Ý¿â(Êý¾Ý)½øÐвÙ×÷µÄΩһ;¾¶£»
ÏûºÄÁË70%~90%µÄÊý¾Ý¿â×ÊÔ´£»¶ÀÁ¢ÓÚ³ÌÐòÉè¼ÆÂß¼£¬Ïà¶ÔÓÚ¶Ô³ÌÐòÔ´´úÂëµÄÓÅ»¯£¬¶ÔSQLÓï¾äµÄÓÅ»¯Ô ......
×î½ü·¢ÏÖÒ»¸öÎÊÌ⣬һ¸ö9iÅÜÔÚredhat5µÄ£¬¾ÓÈ» select sysdate from dual ³öÀ´µÄʱ¼äºÍʵ¼Êʱ¼ä²îÁ˼¸·ÖÖÓ£¬ÒòΪ»ùÓÚÕâ¸öoracleµÄϵͳʱ¼äÕýÈ·ÐÔ»¹ÊÇÓеãÒªÇóµÄ¡£ËùÒÔÖ»ÄÜ #date -s 2010-2-10 8:55:00 ÁË£¬ÔÙ#clock -w дÈëCOMS ×¢ÒâÐÞ¸Äʱ¼äµÃÔÚrootÏ¡£
ÔÚϵͳÆô¶¯Ê±£¬Linux²Ù×÷ϵͳ½«Ê±¼ä´ÓCMOSÖжÁµ½ÏµÍ³Ê ......
ÈÕ³£¿ª·¢»î¶¯ÖУ¬ÓÐʱºòÐèÒª¶ÔoracleÖ´Ðмƻ®½øÐмà¿Ø£¬ÒÔ´ËÀ´µ÷ÓųÌÐòºÍÊý¾Ý¿â·½ÃæµÄÐÔÄÜ¡£
³£Ó÷½·¨ÓÐÒÔϼ¸ÖÖ£º
Ò»¡¢Í¨¹ýPL/SQL Dev¹¤¾ß
1¡¢Ö±½ÓFile->New->Explain Plan Window£¬ÔÚ´°¿ÚÖÐÖ´ÐÐsql¿ÉÒԲ鿴¼Æ»®½á¹û¡£ÆäÖУ¬Cost±íʾcpuµÄÏûºÄ£¬µ¥Î»Îªn%£¬Cardinality±íʾִÐеÄÐÐÊý£¬µÈ¼ÛRow ......