ºìÁªLinuxÃÅ»§
Linux°ïÖú

Êý¾Ý¿âÎïÀíÉè¼Æ¾­Ñé̸

·¢²¼Ê±¼ä:2005-12-27 20:22:16À´Ô´:ºìÁª×÷Õß:CMK
¸ÅÊö
ÎÒÃÇÎÞÂÛʹÓÃÄÄÖÖÊý¾Ý¿â£¬ÎÞÂÛÔõÑùÉè¼ÆÊý¾Ý¿â£¬ÎÒÏ붼»á×ñ´ÓÒ»¸öÔ­Ôò£ºÊý¾Ý°²È«ÐÔºÍÐÔÄܸßЧÕâÁ½¸öÖ÷Òª·½Ã棬µ«ÊǹØÓÚÕâÁ½¸ö·½ÃæµÄ»°ÌâÌ«¶à£¬ÔÚÕâÀï¾Í²»Ò»Ò»³ÂÊö£¬ÎÒÖ»ÊÇ´ÓÊý¾Ý¿âÎïÀí·Ö²¼Éè¼Æ·½ÃæºÍ´ó¼ÒÒ»Æð¼òµ¥µÄ̽ÌÖһϡ£ÒòΪÊý¾Ý¿âÁ¼ºÃµÄÎïÀí·Ö²¼Éè¼ÆÒ²ÊǶÔÊý¾Ý°²È«ÐÔºÍÐÔÄܸßЧӰÏì±È½Ï´ó, ¾ÍÏóÎÒÃÇÔÚ½¨´ó¥֮ǰһ¶¨ÒªÏÈ´òºÃµØ»ùÒ»Ñù¡£
?ʵÖÐÎÒÃÇÔÚÓ¦Óø÷ÖÖ²»Í¬Êý¾Ý¿âµÄʱºò£¬ÍùÍù»áºöÂÔÊý¾Ý¿âµÄÎïÀí²¼¾Ö£¬Ö»ÓÐÔÚÊý¾Ý¿âÐÔÄÜÓöµ½ÎÊÌâµÄʱºò²ÅÈ¥¿¼ÂÇ£¬µ«ÕâÊǵò»³¥Ê§µÄ£¬ÕâÑùÒ»À´²»½ö»áµ¼ÖÂÓëÉè¼ÆÏà¹ØµÄÎÊÌâ³öÏÖ£¬¶øÇÒ»áÓ°ÏìÐÔÄܵĵ÷ÕûЧ¹û£¬ËùÒÔÎÒÃÇÔÚ´´½¨Êý¾Ý¿â֮ǰÏȽøÐй滮Êý¾Ý¿âµÄÎïÀí²¼¾ÖÒ²ÊǺܱØÒªµÄ£¬ÕâÒ²·ûºÏÈËÃdz£ËµµÄ¡±Ä¥µ¶²»Îó¿³²ñ¹¤¡±µÄµÀÀí¡£ÏÂÃæÎÒ¾ÍÒÔOracleΪÀý´ÓÓÅ»¯²Ù×÷ϵͳ¡¢´ÅÅ̲¼¾ÖÓÅ»¯ºÍÅäÖá¢Êý¾Ý¿â³õʼ»¯²ÎÊýµÄÑ¡Ôñ¡¢ÉèÖú͹ÜÀíÄÚ´æ¡¢ÉèÖú͹ÜÀíCPU¡¢ÉèÖú͹ÜÀí±í¿Õ¼ä¡¢ÉèÖú͹ÜÀí»Ø¹ö¶Î¡¢ÉèÖú͹ÜÀíÁª»úÖØ×öÈÕÖ¾¡¢ÉèÖú͹ÜÀí¹éµµÖØ×öÈÕÖ¾¡¢ÉèÖú͹ÜÀí¿ØÖÆÎļþµÈ¼¸¸ö·½Ãæ×÷ÒÔ³ÂÊö¡£

Ò». ÓÅ»¯²Ù×÷ϵͳ
ΪÁË»ñµÃ×î¼ÑµÄ·þÎñÆ÷ÐÔÄÜ, ¶Ô²Ù×÷ϵͳµÄÓÅ»¯Ò²ÊǺܱØÒªµÄ, ÒòΪ²Ù×÷ϵͳÐÔÄÜÎÊÌâͨ³£»áÉæ¼°µ½½ø³Ì¹ÜÀí¡¢ÄÚ´æ¹ÜÀí¡¢µ÷¶ÈµÈ£¬ËùÒÔÓû§ÐèҪȷ±£ÓÐ×ã¹»µÄI/O´ø¿í¡¢CPUµÄ´¦ÀíÄÜÁ¦¡¢½»»»¿Õ¼äÀ´¾¡¿ÉÄܵĽµµÍϵͳʱ¼ä¡£Èç¹ûÓ¦ÓóÌÐòÔÚ»º³åÇø³öÏÖ¹ý¶àµÄ¡±Ã¦¡±µÈ´ý, ÄÇôϵͳµ÷ÓõĽø³Ì½«»áÔö¼Ó, ËäÈ»¿ÉÒÔͨ¹ýÓÅ»¯SQLÓï¾äµÈ·½·¨À´½µµÍµ÷ÓõÄÊýÄ¿£¬µ«ÊÇÕâÒ²ÊÇÖβ¡²»ÖθùµÄ¡£Óû§¿ÉÒÔÆô¶¯OracleµÄ³õʼ»¯²ÎÊýtimed_statisticsÀ´Ôö¼Óϵͳµ÷ÓõÄÊýÄ¿, ·´Ö®Èç¹û¹Ø±Õ´Ë²ÎÊý,ÄÇôϵͳµ÷ÓõÄÊýÄ¿Ò²»á¼õÉÙ¡£²Ù×÷ϵͳµÄ»º´æºÍOracle×Ô¼ºµÄ»º´æ¹ÜÀíÊDz»Ïà³åÍ»µÄ, ËäÈ»ËüÄÜÏûºÄÒ»¶¨µÄ×ÊÔ´, µ«ÊÇËü¶ÔÐÔÄÜ»¹ÊÇÓÐÒ»¶¨ºÃ´¦µÄ, ÒòΪһ°ãËùÓÐÊý¾Ý¿âµÄI/OÐèҪͨ¹ýϵͳÎļþ»º´æÀ´·ÃÎÊÎļþ´æ´¢Æ÷¡£
OracleµÄ²Ù×÷¿ÉÄÜ»áÓõ½Ðí¶àµÄ½ø³Ì(ÓеÄϵͳ½ÐÏß³Ì), ËùÒÔÓû§Ó¦¸ÃÈ·±£ËùÓÐOracleµÄ½ø³Ì¡¢ºǫ́½ø³Ì¡¢Óû§½ø³Ì¾ßÓÐÏàͬµÄÓÅÏȼ¶, ·ñÔò¾Í»á²úÉú¶ñ»¯µÄÏÖÏó, µ¼Ö¸ßÓÅÏȼ¶µÄ½ø³ÌµÈ´ýµÍÓÅÏȼ¶µÄ½ø³Ì´¦ÀíÍê±ÏÊͷųöCPU×ÊÔ´ºóÔÙ´¦Àí, ¸ü²»Äܽ«OracleµÄºǫ́½ø³Ì°ó¶¨µ½CPUÖÐ, ÕâÑùÒ»À´Ò²»áµ¼Ö±»°ó¶¨µÄ½ø³Ì±»CPU×ÊÔ´¶öËÀ¡£
±È½ÏºÃµÄÊÇÓÐЩ²Ù×÷ϵͳÌṩÓвÙ×÷ϵͳ×ÊÔ´¹ÜÀíÆ÷(Operating System Resource Manager), ͨ¹ýËü¿ÉÒÔ¶Ôϵͳ×ÊÔ´·ÃÎÊ»®·ÖÓÅÏȼ¶À´½µµÍ·åÖµ¸ºÔØģʽµÄÓ°Ï죬À´ÊµÏÖ¶àÖÖ¹ÜÀí²ßÂԺͷ½·¨£¬¿ØÖÆÓû§×ÊÔ´µÄ·ÃÎÊ£¬ÏÞÖÆÓû§×ÊÔ´µÄ¿ÉÏûºÄÁ¿¡£

¶þ£®´ÅÅ̲¼¾ÖÓÅ»¯ºÍÅäÖÃ
ÔÚ´ó¶àÊý²úÆ·Êý¾Ý¿âÓ¦ÓÃÖУ¬Êý¾Ý¿âÎļþÒ»°ã¶¼·ÅÔÚ´ÅÅÌÉÏ£¬Òò´Ë´ÅÅ̵ÄÁ¼ºÃʹÓúͲ¼¾ÖÒ²ÊǺÜÖØÒªµÄ¡£´ÅÅ̲¼¾ÖµÄÄ¿±êÊÇ£º´ÅÅÌÐÔÄÜÊDz»ÄÜ×谭ʵÏÖÊý¾Ý¿âÐÔÄÜ£¬Êý¾Ý¿â´ÅÅ̱ØÐëרÓÃÓÚÊý¾Ý¿âÎļþ£¬·ñÔò·ÇÊý¾Ý¿â½«»áÓ°Ïìµ½¸ÃÊý¾Ý¿â,ÇÒÕâÖÖÓ°ÏìÊDz»¿ÉÔ¤²âµÄ; ϵͳӲ¼þºÍ¾µÏñ±ØÐëÂú×ã»Ö¸´ºÍÐÔÄܵÄÒªÇó£¬Êý¾ÝÎļþ´óСºÍI/O²»Äܳ¬¹ý´ÅÅ̵ĴóСºÍI/O£¬Êý¾Ý¿âÒ»¶¨ÊÇ¿ÉÒÔ»Ö¸´µÄ£¬±ØÐëʹºǫ́½ø³ÌÖ®¼äµÄ¾ºÕù×îС»¯¡£Ôڹ滮ӲÅÌÅäÖÃʱҲҪעÒ⣺Ê×ÏÈËùÓõĴÅÅÌÈÝÁ¿£¬ÓÐʱÓöà¸öÈÝÁ¿Ð¡µÄ´ÅÅ̱ÈÓÃÒ»¸ö´óµÄ´ÅÅÌЧ¹û¸üºÃ£¬ÒòΪ¿ÉÒÔ½øÐиü¸ß¼¶µÄ²¢ÐÐI/O²Ù×÷; Æä´Î´ÅÅ̵ÄËٶȣ¬È練Ӧʱ¼äºÍÑ°µÀʱ¼ä¶¼½«Ó°ÏìI/OµÄÐÔÄÜ, ¿ÉÒÔ¿¼ÂÇʹÓúÏÊʵÄÎļþϵͳ×÷ΪÊý¾ÝÎļþ; ÔÙÕßʹÓúÏÊʵÄRAID¡£
RAID(Redundant Arrays of Inexpensive Disks)Á®¼ÛÈßÓàÕóÁпÉÒÔ¸ÄÉÆÊý¾ÝµÄ¿É¿¿ÐÔ£¬¶øI/OµÄÐÔÄÜÓÖÈ¡¾öÓÚRAIDÅäÖõķ½Ê½£ºRAID1¿ÉÒÔÌṩ±È½ÏºÃµÄ¿É¿¿ÐԺͽϿìµÄ¶ÁÈ¡Ëٶȣ¬µ«Ð´µÄ´ú¼Û±È½Ï´ó£¬ËùÒÔ²»ÊʺÏƵ·±Ð´µÄÓ¦Óã»RAID0+1ÔÚÔ­RAID1µÄ»ù´¡É϶ÁÈ¡µÄËٶȸü¿ì£¬ËùÒÔÕâÒ²ÊÇ´ó¼Ò³£»áÑ¡ÔñµÄ·½Ê½£»RAID5¿ÉÒÔÌṩ±È½ÏºÃµÄ¿É¿¿ÐÔ£¬ÓÐ˳ÐòµÄ¶Á²Ù×÷±È½ÏÊʺÏÕâÖÖ·½Ê½£¬µ«ÐÔÄÜ»áÊܵ½Ó°Ï죬¶ÔÓÚд²Ù×÷Ƶ·±µÄÓ¦ÓÃÒ²²»ÊʺÏÕâÖÖ¡£¶ÔÓÚ¸ÃÑ¡ÔñÄÇÖÖ·½Ê½²»ÄÜÒ»¸Å¶øÂÛ£¬Òª¸ù¾Ý¾ßÌåµÄÇé¿ö¶ø¶¨¡£
ÓÐЩӦÓÃÈí¼þÏÈÌìÐÔÊܵ½´ÅÅ̵ÄI/OÏÞÖÆ, ËùÒÔÔÚÉè¼ÆµÄʱºòÓ¦¾¡Á¿Ê¹OracleµÄÐÔÄܲ»ÊÜI/OµÄÏÞÖÆ, ËùÒÔÔÚÉè¼ÆÒ»¸öI/OϵͳʱҪ¿¼ÂÇÒÔϵÄÊý¾Ý¿âÐèÒª: ´æ´¢´ÅÅ̵Ä×îС×Ö½Ú; ¿ÉÓÃÐÔ, Èç24X7, 9X5; ÐÔÄÜÈçI/OµÄÊä³öºÍÏìӦʱ¼ä¡£¾ö¶¨OracleÎļþµÄI/Oͳ¼ÆÐÅÏ¢¿ÉÒÔÀ´²éѯÏÂÁÐ: ÎïÀí¶ÁÊýÁ¿(V$filestat.phyrds)¡¢ÎïÀíдÊýÁ¿(V$filestat.phywrites)¡¢Æ½¾ùʱ¼ä, I/O=ÎïÀí¶Á+ÎïÀíд¡£¶øI/OµÄƽ¾ùÊýÁ¿=(ÎïÀí¶Á+ÎïÀíд)/¹²ÓÃÃëÊý), ¹À¼ÆÕâ¸öÊý¾Ý¶ÔÓÚÐÂϵͳÊÇÓÐÓõÄ, ¿ÉÒÔ²éѯ³öÐÂÓ¦ÓóÌÐòµÄI/OÐèÇóÓëϵͳµÄI/OÄÜÁ¦ÊÇ·ñÆ¥ÅäÒԱ㼰ʱµ÷Õû¡£

Èý£®´´½¨Êý¾Ý¿â³õʼ»¯²ÎÊýµÄÑ¡Ôñ
¹ÜÀíÊý¾Ý¿âµÄµÚÒ»½×¶Î¾ÍÊdzõʼ»¯Êý¾Ý¿âµÄ´´½¨£¬¾¡¹Ü¿ÉÒÔÔÚÊý¾Ý¿â´´½¨ºÃÒÔºóÔÙÀ´µ÷ÕûÐÔÄÜ£¬µ«ÊÇÓÐЩ²ÎÊýÊDz»ÄÜÐ޸ĵĻòºÜÄÑÐ޸ģ¬±ÈÈ磺 Db_block_size¡¢Db_name¡¢Db_domain¡¢Compatible¡¢Nls_language¡¢ Nls_characterset¡¢Nls_nchar_characterset¡£
Db_block_size²ÎÊý¾ö¶¨OracleÊý¾Ý¿â¿éµÄ´óС£¬Ò»°ã¿ÉÒÔÑ¡ÔñµÄ·¶Î§ÊÇ2K¡¢4K¡¢8K¡¢16K¡¢32K£¬Ê¹ÓÃÏÂÒ»¸ö½Ï´óÖµÊý¾Ý¿â¿é´óСµÄЧ¹ûÒ»°ã¿ÉÒÔ¼¯ÖвéѯÖÐÐÔÄÜÌá¸ß50%¡£µ«ÊÇ°´³£¹æÀ´Ëµ¶ÔÓÚÒ»°ã·þÎñÆ÷²»Ìᳫ°ÑÕâ¸öÖµÉèµÄºÜ´ó£¬Ð¡ÐÍ»ú³ýÍ⣬ÒòΪÕâÑùÒ»À´Êý¾Ý¿â¿éÖн«»áÓиü¶àµÄÐУ¬ÔÚÊý¾Ý¿âά»¤Æڼ䷢Éú¿é¼¶¾ºÕùµÄ¿ÉÄÜÐԱȽϴ󣬱ÜÃâÕâÖÖ¾ºÕùµÄ°ì·¨ÊÇÔÚ±í¼¶ºÍË÷Òý¼¶Ôö´óFreelists¡¢maxtransºÍinitrans µÄÉèÖÃÖµ£¬Í¨³£FreelistsÉèÖÃΪ´óÓÚ4»á´øÀ´¸ü¶àµÄºÃ´¦¡£
Db_name¸Ã²ÎÊýÖ¸¶¨Ò»¸öÊý¾Ý¿â±êʶ·û£¬Ò»°ãÔÚCreate DatabaseÖÐÖ¸¶¨µÄÃû³Æ£¬¸Ä²ÎÊýÊÇ¿ÉÑ¡µÄ£¨ÔÚOracle9iʵʱӦÓü¯ÈºÊ±ÊDZØÑ¡µÄ£¬¶à¸öʵÀýÓÐÏàͬµÄ²ÎÊýÖµ£©£¬µ«Êǽ¨ÒéÔÚCreate Database֮ǰÉèÖÃËü£¬Èç¹û²»Ö¸¶¨ÔòÒª³öÏÖÔÚStartup»òAlter Database mountÃüÁîÖС£
Db_domain¸Ã²ÎÊýÖ¸¶¨È«¾ÖÊý¾Ý¿âÃûµÄÀ©Õ¹²¿·Ö£¬ÔÚOracle9iʵʱӦÓü¯ÈºÊ±ÊDZØÑ¡µÄ£¬¶à¸öʵÀýÓÐÏàͬµÄ²ÎÊýÖµ¡£
Compatible¸Ã²ÎÊýÖ¸¶¨Oracle·þÎñÆ÷ά»¤°æ±¾µÄ¼æÈÝÐÔ£¬±£Ö¤ÓëÔçÆڵİ汾ÏòϼæÈݵÄʱºòÔÊÐíÓû§Ê¹ÓÃеİ汾£¬ÔÚOracle9iʵʱӦÓü¯ÈºÊ±ÊDZØÑ¡µÄ£¬¶à¸öʵÀýÓÐÏàͬµÄ²ÎÊýÖµ¡£
Nls_languageºÍNls_characterset¼°Nls_nchar_charactersetÈý¸ö²ÎÊýÊÇÊý¾Ý¿âµÄ×Ö·û¼¯²ÎÊý£¬ÔÚÊý¾Ý¿â´´½¨Íê³ÉºóÒ»°ãÒ²²»Äܸıä»òºÜÄѸı䣬ËùÒÔÔÚ´´½¨Êý¾Ý¿âµÄʱºòÒªÏÈÉèÖúá£

ËÄ£®ÉèÖú͹ÜÀíÄÚ´æ
OracleʹÓù²ÏíÄÚ´æÀ´¹ÜÀíÆäÄÚ´æºÍÎļþ½á¹¹£¬Oracle³£Ê¹ÓõÄÄÚ´æ½á¹¹ÈçÏ£º
ϵͳȫ¾ÖÇø£¨System Global Area£¬SGA£©£¬SGAËæ×Ų»Í¬µÄ»·¾³¶ø²»Í¬£¬Ã»ÓÐÒ»ÖÖÆÕͨµÄ×î¼Ñ·½°¸£¬ÎÒÃÇÔÚÉèÖÃËüֱǰҪÏÈ¿¼ÂÇÒÔϵļ¸¸ö·½Ã棺ÎïÀíÄÚ´æ¶à´ó£»²Ù×÷ϵͳÊÇÄÇÖÖ¼°Õ¼¶à´óµÄÄڴ棬Êý¾Ý¿âϵͳÊÇÎļþϵͳ»¹ÊÇÂãÉ豸£»Êý¾Ý¿âÔËÐеÄģʽ¡£SGA°üÀ¨£ºFixed size¡¢Variable size¡¢Database Buffers¡¢Redo Buffers¡£SGAÕ¼ÓÐÎïÀíÄÚ´æµÄ±ÈÀýûÓÐÑϸñµÄ¹æ¶¨£¬Ö»ÄÜ×ñ´ÓÒ»°ãµÄ¹æÔò£ºSGAÕ¼¾ÝÎïÀíÄÚ´æµÄ40%--60%×óÓÒ¡£Èç¹ûͨ¹ýÖ±¹ÛµÄ¹«Ê½»¯À´±í´ïÔòΪ£ºOSʹÓÃÄÚ´æ+SGA+²¢·¢½ø³ÌÊý*£¨Sort_area_size+Hash_area_size+2M£©<0.7RAM,Õâ¸ö¹«Ê½Ò²Ö»ÊDzο¼£¬²»±Ø¾ÐÓÚ´Ë£¬Êµ¼ÊÇé¿ö¿ÉÒÔ×ÔÓÉ·¢»Ó¡£³õʼ»¯²ÎÊýÎļþÖеÄһЩ²ÎÊý¶ÔSGAµÄ´óСÓоö¶¨ÐÔµÄÓ°Ïì¡£²ÎÊýDb_block_Buffers£¨SGAÖд洢Çø¸ßËÙ»º´æµÄ»º³åÇøÊýÄ¿£©£¬²ÎÊýShared_pool_size£¨·ÖÅä¸ø¹²ÏíSQLÇøµÄ×Ö½ÚÊý£©£¬ÊÇSGA´óСµÄÖ÷ÒªÓ°ÏìÕß¡£Database Buffers ²ÎÊýÊÇSGA´óСºÍÊý¾Ý¿âÐÔÄܵÄ×îÖØÒªµÄ¾ö¶¨ÒòËØ¡£¸ÃÖµ½Ï¸ß£¬¿ÉÒÔÌá¸ßϵͳµÄÃüÖÐÂÊ£¬¼õÉÙI/O¡£Ã¿¸ö»º³åÇøµÄ´óСµÈÓÚ²ÎÊýDb_block_sizeµÄ´óС¡£OracleÊý¾Ý¿â¿éÒÔ×Ö½Ú±íʾ´óС¡£Oracle SGAÇø¹²Ïí³Ø²¿·ÖÓÉ¿â¸ßËÙ»º´æ¡¢×Öµä¸ßËÙ»º´æ¼°ÆäËûһЩÓû§ºÍ·þÎñÆ÷»á»°ÐÅÏ¢×é³É£¬¹²Ïí³ØÊÇ×î´óµÄÏûºÄ³É·Ö¡£µ÷ÕûSGAÇø¸÷¸ö½á¹¹µÄ´óС£¬¿ÉÒÔ¼«´óµØÌá¸ßϵͳµÄÐÔÄÜ¡£
Êý¾Ý¿é»º³å»º´æÇø£¨Data block buffers cache£©£¬Data buffersÔÚ8iÖÐÊÇDb_block_buffers*Db_block_size£¬9iÖÐÓÃDb_cache_sizeÀ´´úÌæÕâ¸ö²ÎÊý¡£ÔÚÄÚ´æµÄÅäÖÃÖаѱðµÄ²ÎÊýÉèÖÃÍê³Éºó£¬Ó¦¸Ã°ÑÄܸøµÄ¶¼¸øData buffers¡£Oracle ÔÚÔËÐÐÆÚ¼äÏòÊý¾Ý¿â¸ßËÙ»º´æ¶ÁдÊý¾Ý£¬¸ßËÙ»º´æÃüÖбíʾÐÅÏ¢ÒÑÔÚÄÚ´æÖУ¬¸ßËÙ»º´æʧ°ÜÒâζ×ÅOracle±ØÐè½øÐдÅÅÌI/O¡£±£³Ö¸ßËÙ»º´æʧ°ÜÂÊ×îСµÄ¹Ø¼üÊÇÈ·±£¸ßËÙ»º´æµÄ´óС¡£Oracle8iÖгõʼ»¯²ÎÊýDb_block_buffers¿ØÖÆÊý¾Ý¿â»º³åÇø¸ßËÙ»º´æµÄ´óС¡£¿Éͨ¹ý²éѯV$sysstat ÃüÖÐÂÊ£¬ÒÔÈ·¶¨ÊÇ·ñÓ¦µ±Ôö¼ÓDb_block_buffersµÄÖµ¡£
¡¡¡¡SELECT name,value FROM V$sysstat
¡¡¡¡WHERE name in (¡¯dbblock gets¡¯,¡¯consistent gets¡¯,¡¯physical reads¡¯);
ͨ¹ý²éѯ½á¹ûÃüÖÐÂÊ=1-physical reads/(dbblock gets+consistent gets) Èç¹ûÃüÖÐÂÊ<0.6¡«0.7£¬ÔòÓ¦Ôö´óDb_block_buffers¡£
×ֵ仺´æÇø£¨Dictionary CACHE£©£¬Êý¾Ý×ֵ仺´æÇøµÄ´óСÓÉÊý¾Ý¿âÄÚ²¿¹ÜÀí£¬´óСÓɲÎÊýShared_pool_sizeÀ´ÉèÖá£Êý¾Ý×Öµä¸ßËÙ»º´æ°üÀ¨ÁËÓйØÊý¾Ý¿âµÄ½á¹¹¡¢Óû§¡¢ÊµÌåÐÅÏ¢µÈ¡£Êý¾Ý×ÖµäµÄÃüÖÐÂʶÔϵͳÓкܴóµÄÓ°Ïì¡£ÃüÖÐÂʵļÆËãÖУ¬getmisses ±íʾʧ°Ü´ÎÊý£¬gets±íʾ³É¹¦´ÎÊý¡£²éѯV$ROWCACHE±í£º
¡¡¡¡SELECT (1-(SUM(getmisses)/(SUM(gets)+SUM(getmisses))))*100
¡¡¡¡FROM V$rowcache;
Èç¹û¸ÃÖµ>90%£¬ËµÃ÷ÃüÖÐÂʺÏÊÊ¡£·ñÔò£¬Ó¦Ôö´ó¹²Ïí³ØµÄ´óС¡£
ÖØ×öÈÕÖ¾»º³åÇø£¨Read log buffer£©,ÏÂÃ潫ÓгÂÊö£¬Ôڴ˾Ͳ»×ö˵Ã÷¡£
SQL¹²Ïí³Ø£¨Shared pool size£©£¬¸Ã¹²Ïí³Ø°üÀ¨°üÀ¨Ö´Ðмƻ®¼°Õë¶ÔÊý¾Ý¿âÖ´ÐÐSQLÓï¾äµÄÓï·¨·ÖÎöÓõģ¬ÔÚµÚ¶þ´ÎÔËÐÐÏàͬµÄSQLÓï¾äʱ¿ÉÓÃSQLÖеÄÓï·¨·ÖÎöÀ´¼Ó¿ìÖ´ÐÐËٶȡ£Èç¹ûËü̫С£¬Óï¾ä»áÁ¬Ðø²»¶ÏµØÔÙ×°Èëµ½¿â»º´æÇø£¬´Ó¶øÓ°ÏìÐÔÄÜ¡£¿ÉÒÔͨ¹ýAlter systemÃüÁîÀ´Ð޸Ĵ˲ÎÊý£¬9IÒÔºóµÄ°æ±¾¿ÉÒÔ¶¯Ì¬µØÐÞ¸ÄÆä´óС¡£
´ó³Ø£¨Large pool size£©£¬ÊÇÒ»¸ö¿ÉÑ¡µÄÄÚ´æÇø¡£Èç¹ûÑ¡Ôñ¿É¶ÔÊý¾Ý¿âÏ󱸷Ý/»Ö¸´ÕâЩ´óµÄ²Ù×÷Ìá¸ßÐÔÄÜ¡£Èç¹û²»Ñ¡Ôñ´Ë²ÎÊý£¬Ôòϵͳ»áʹÓù²Ïí³Ø¡£
JAVA³Ø£¨Java pool size£©£¬ÓÉÆäÃû×Ö¶øÑÔ¿ÉÖª£¬ÊÇΪÂú×ãJAVAÃüÁîÓï·¨·ÖÎöµÄÐèÇó¡£ÔÚUNIXϵͳÖÐÈç¹ûÇø×éµÄ´óСΪ4MB£¬ÔòĬÈÏ´óСӦ¸ÃΪ24M£¬Èç¹ûÇø×é´óСΪ 16MB£¬ÔòĬÈÏ´óСΪ32M¡£Èç¹ûÊý¾Ý¿âûÓÐʹÓÃJAVA£¬Ôò±£³ÖÔÚ10M--20M×ã¹»¡£
¶à»º³åÇø³Ø£¨Multiple buffer pools£©£¬¿ÉÒÔʹÓö໺³åÇø³Ø°Ñ´óÊý¾Ý¼¯ÓëÓ¦ÓõÄÊ£Óಿ·Ö·Ö¿ª£¬ÒÔ¼õÉÙËüÃÇÕù¶á»º´æÇøÄÚÏàͬ×ÊÔ´µÄ¿ÉÄÜÐÔ£¬´´½¨Ê±ÐèÒªÔÚ³õʼ»¯²ÎÊýÖÐÉ趨Æä´óС¡£
³ÌÐòÈ«¾ÖÇø£¨Program global area£¬PGA£©ÊÇOracleµÄÒ»¸ö˽ÓеÄÄÚ´æÇø£¬9iÒÔºóµÄ°æ±¾ÖУ¬Èç¹ûWorkarea_size_policy=auto£¬ÔòËùÓеĻỰ¹²ÓÃÒ»¿éÄڴ棬¸ÃÄÚ´æÔÚ²ÎÊýPga_aggregate_targetÉèÖã¬ËüµÄÒ»¸öºÃµÄ³õʼÉèÖÃÊÇ£º¶ÔÓÚÒ»¸öOLTPϵͳ Pga_aggregate_target=£¨totalL_mem*80%£©*20%£»¶ÔÓÚÒ»¸öDSSϵͳPga_aggregate_target= £¨total_mem*80%£©*50%¡£ÕâÀïµÄtotal_memÊÇÎïÀíÄÚ´æ¡£ÔÚµ÷ÕûPga_aggregate_target²ÎÊýʱ£¬ÏÂÃæµÄ¼¸¸ö¶¯Ì¬ÊÓͼ»áÓаïÖúµÄ£ºV$sysstatºÍV$sesstat£»V$sql_workarea_active£»V$pgastat£»V$ sql_workarea£» V$process¡£

Î壮ÉèÖú͹ÜÀíCPU
ÔÚÉèÖúͰ²×°Êý¾Ý¿âµÄ¹ý³ÌÖУ¬»ù±¾²»ÓöÔCPU×öʲôÅäÖõģ¬ÏµÍ³»á×Ô¶¯Ä¬Èϵģ¬µ«ÊÇÔÚ¹ÜÀí¹ý³ÌÖÐÎÒÃÇ¿ÉÒÔÀûÓòÙ×÷ϵͳ¼à¿Ø¹¤¾ßÀ´¼à¿ØCPUµÄ×´¿ö¡£ÀýÈçÔÚUNIXϵͳÖУ¬¿ÉÒÔÔËÐÐsar-uµÄ¹¤¾ßÀ´¼ì²éÕû¸öϵͳʹÓÃCPUµÄˮƽ¡£Æäͳ¼ÆÐÅÏ¢°üÀ¨£ºÓû§Ê±¼ä¡¢ÏµÍ³Ê±¼ä¡¢¿ÕÏÐʱ¼ä¡¢I/OµÈ´ýʱ¼ä¡£ÔÚÕý³£¹¤×÷¸ºÔصÄÇé¿öÏ£¬Èç¹û¿ÕÏÐʱ¼äºÍI/OµÈ´ýʱ¼ä½Ó½üÓÚ0»òÉÙÓÚ5%£¬ÄǾͱíʾCPUµÄʹÓôæÔÚÎÊÌâ¡£
¶ÔÓÚWindowsϵͳ¿ÉÒÔͨ¹ýÐÔÄܼàÊÓÆ÷£¨Performance monitor£©À´¼ì²éCPUµÄʹÓÃ×´¿ö¿ÉÒÔÌṩÒÔÏÂÐÅÏ¢£º´¦ÀíÆ÷ʱ¼ä¡¢Óû§Ê±¼ä¡¢ÌØȨʱ¼ä¡¢ÖжÏʱ¼ä¡¢DPCʱ¼ä¡£
Èç¹ûCPUµÄʹÓôæÔÚÎÊÌ⣬Ôò¿ÉÒÔͨ¹ýÒÔϵķ½Ê½À´½â¾ö£ºÓÅ»¯ÏµÍ³ºÍÊý¾Ý¿â£»Ôö¼ÓÓ²¼þµÄÄÜÁ¦£»¶ÔCPU×ÊÔ´·ÖÅä½øÐл®·ÖÓÅÏȼ¶£¬OracleÊý¾Ý¿â×ÊÔ´¹ÜÀíÆ÷£¨Database Resource Manager£©¸ºÔðÔÚÓû§ºÍÓ¦ÓóÌÐòÖ®¼ä·ÖÅäºÍ¹ÜÀíCPU×ÊÔ´¡£

Áù£®ÉèÖú͹ÜÀí±í¿Õ¼ä
Êý¾Ý¿âÎļþÖ®¼äµÄI/O¾ºÕùÊÇÊý¾Ý¿âÖ®´ó¼É, ËùÒÔ¶ÔÊý¾Ý¿â¹æ»®Ö®Ç°ÒªÏȶÔÊý¾ÝÎļþµÄI/O½øÐгõ²½µÄÆÀ¹À, ͨ³£Çé¿öÏÂ, Ó¦ÓõIJúÆ·Êý¾Ý¿â±íËùÔڵıí¿Õ¼ä»áºÜ»îÔ¾, Ë÷Òý±í¿Õ¼äºÍÊý¾Ý×ÖµäÖ®ÀàµÄ±í¿Õ¼äÒ²ºÜ»îÔ¾µÄ, ¶ÔÓÚÊÂÎï±È½ÏƵ·±µÄÓ¦ÓÃÖÐ, ÖØ×ö±í¿Õ¼äÒ²ºÜ»îÔ¾µÄ, ËùÒÔ¶Ô²»Í¬ÀàÐ͵ÄÊý¾Ý¿âÆäÊý¾ÝÎļþµÄI/O¾ºÕùÒ²»áÂÔÓв»Í¬µÄ, µ«ÊÇ»ù±¾ÉÏ»¹ÊÇ×ñ´ÓÒÔϵÄÔ­Ôò±È½ÏºÃ: Ó¦ÓõıíºÍË÷Òýͨ³£Ó¦¸Ã±»·ÖÅä»ò·ÖÇøµ½¶à¸ö±í¿Õ¼äÖÐ, ÒÔ½µµÍµ¥¸öÊý¾ÝÎļþµÄI/O, ×îºÃ°ÑÿһÖÖ¹¦ÄÜÏàͬµÄÇøÓò¶ÔÏó½¨Á¢µ¥¶ÀµÄ±í¿Õ¼ä; ûÓÐÀíÓɰѳýÊý¾Ý×Öµä±íºÍϵͳ»ØÍ˶ÎÍâµÄÆäËû¶«Î÷·Åµ½ÏµÍ³±í¿Õ¼äÖÐ, Òª°ÑÄÜÒƳöϵͳ±í¿Õ¼äµÄ¶ÔÏó¶¼ÒƳö; Ë÷Òý¶Î²»Ó¦¸ÃºÍÏà¹Ø±í·ÅÔÚͬһ±í¿Õ¼äÖÐ, ÒòΪËûÃÇÔÚÊý¾Ý¹ÜÀíºÍ²éѯʱ»á²úÉúºÜ¶àµÄ²¢·¢I/O; ÁÙʱ±í¿Õ¼äÊÇÓÃÒÔ´æ´¢´óÁ¿µÄÅÅÐò, ËùÒÔÆäËüµÄÓ¦ÓöÔÏóÊDz»ÄÜ·ÅÔÚÁÙʱ±í¿Õ¼ä¡£
ÒÔÉϽ²µÄÊÇÊý¾Ý¿âÎļþ·Ö²¼µÄÔ­Àí, Ô­Àí¹éÔ­Àí, ÊÂʵӦÓÃÖÐ, ÎÒÃÇ»¹ÊÇÒÔ¾­ÑéÀ´ÉèÖ÷ֲ¼±È½ÏºÃЩ, µ±È»ÔÚûÓо­Ñé֮ǰ»¹ÊDzο¼Ô­ÀíÒÔÖÂÓÚ²»»á×ßÍä·¡£
Êý¾Ý¿âºÍ±í¿Õ¼ä¿ÉÒÔÊÇÒ»¶Ô¶àµÄ¹Øϵ£¬±í¿Õ¼äºÍÊý¾ÝÎļþÒ²¿ÉÒÔÊÇÒ»¶Ô¶àµÄ¹Øϵ£¬Êý¾ÝÎļþºÍÊý¾Ý¶ÔÏóÒ²¿ÉÒÔÊÇÒ»¶Ô¶àµÄ¹Øϵ¡£µ±´´½¨Ò»¸öÊý¾Ý¶ÔÏó£¨Èç±í»òË÷Òý£©Ê±£¬¿ÉÒÔͨ¹ýĬÈÏÖµ»òÌØÊâÃüÁÆ丳ÓèÒ»¸ö±í¿Õ¼ä£¬ÕâÑù¾Í»áÔڸñí¿Õ¼äÖд´½¨Ò»¸ö¶Î£¨Segment£©À´´æ´¢Óë¸Ã¶ÔÏóÓйصÄÊý¾Ý¡£Ò»¸ö¶ÎÓÉһЩ³Æ×÷Çø¼ä£¨Extent£¬Ò»×éÁ¬ÐøµÄOracle¿é£©µÄÇø¶Î×é³É£¬Ò»µ«ÏÖÓеÄÇø¶Î²»ÄÜ´æ´¢Êý¾Ýʱ£¬Õâ¸ö¶Î¾ÍÒª»ñµÃÁíÒ»¸öÇø¼äÀ´Ö§³Ö½«Êý¾Ý²åÈëµ½¶ÔÏóÖС£Òò´ËÕâ¸ö¶ÎËùʹÓõĿռäÓÉËüµÄ²ÎÊý¾ö¶¨µÄ£¬ÕâЩ²ÎÊý¿ÉÒÔÔÚ´´½¨Ê±Ö¸¶¨£¬Ò²¿ÉÒÔÔÚÒÔºó¸ü¸Ä¡£ÈçÔÚCreate table£¬Create index£¬Create cluster£¬Create rollback segmentÃüÁîÖÐûÓÐÖ¸¶¨´æ´¢²ÎÊý£¬ÔòÊý¾Ý¿â»áĬÈÏËü´æ´¢ËùÔڵıí¿Õ¼äµÄ²ÎÊý£¬ÕâЩ²ÎÊýÓÐinitial£¬next£¬pctincrease£¬ maxextents£¬minextentsµÈ¡£ÔÚ´´½¨ºó²»ÄÜÐÞ¸ÄinitialºÍminextentsÖµ£¬Ã¿¸ö±í¿Õ¼äµÄ´æ´¢²ÎÊýĬÈÏÖµ¿ÉÒÔÔÚ Dba_tablespacesÊÓͼÖвéѯ³öÀ´¡£
´ÅÅÌI/OÊÇϵͳÐÔÄܵÄÆ¿¾±£¬½â¾öºÃ´ÅÅÌI/O£¬¿ÉÃ÷ÏÔÌá¸ßÐÔÄÜ¡£Í¨¹ý²éѯV$filestat¿ÉÒÔÖªµÀÿ¸öÎïÀíÎļþµÄʹÓÃƵÂÊ£¨phyrds±íʾÿ¸öÊý¾ÝÎļþ¶ÁµÄ´ÎÊý£¬phywrts±íʾÿ¸öÊý¾ÝÎļþдµÄ´ÎÊý£©
¡¡¡¡SELECT name,phyrds,phywrts FROM V$datafile df,V$filestat fs
¡¡¡¡WHERE df.file# =fs.file#;
¶ÔÓÚʹÓÃƵÂʽϸߵÄÎïÀíÎļþ,¿ÉÒÔ²ÉÓÃÒÔϲßÂÔ: ½«I/O¾¡¿ÉÄÜƽ¾ù·ÖÅäÔÚ¾¡¿ÉÄܶàµÄ´ÅÅÌÉÏ£»Îª±íºÍË÷Òý½¨Á¢²»Í¬µÄ±í¿Õ¼ä£»½«Êý¾ÝÎļþÓëÖØ×öÈÕÖ¾Îļþ·ÖÀëÔÚ²»Í¬µÄ´ÅÅÌÉÏ£»¼õÉÙ²»¾­Oracle serverµÄ´ÅÅÌI/O¡£
Èç¹û´ó¼ÒûÓо­ÑéµÄÇé¿öϲ»Ð¡ÐÄ°ÑÊý¾ÝÎļþ¹æ»®µÄ²»Ç¡µ±, ÒÔÖÂÓÚ²úÉúÁË´óÁ¿µÄI/O¾¹ÕùÏÖÏó, ÄÇô¾ÍÒª¸ù¾ÝÉÏÃæµÄÔ­ÔòÖØе÷ÕûÊý¾ÝÎļþµÄ·Ö²¼, ÒÔƽºâÊý¾ÝÎļþÖ®¼äµÄI/O¾¹Õù, ¾ßÌåÈçºÎÒƶ¯Êý¾ÝÎļþ, ¸÷ÖÖÊý¾Ý¿âµÄ·½·¨²»¾¡Ïàͬ, µ«ÊÇ»ù±¾µÄÔ­Àí»¹ÊÇÏàͬµÄ,ÏÂÃæÊÇÕë¶ÔOracle8iÈçºÎÒƶ¯Êý¾ÝÎļþµÄÁ½ÖÖ·½·¨µÄ¾ÙÀý(9iÂÔÓв»Í¬)£º
µÚÒ»ÖÖ·½·¨:(Alter database)
¹Ø±ÕÊý¾Ý¿â-Òƶ¯Êý¾Ý¿âÎļþ-×°Ôز¢¸ÄÃû-Æô¶¯

1> svrmgrl
2> connect internal
3> shutdown
4> exit
5> mv /u/product/oradata/foxmold/user01.dbf /db3/oradata
6> svrmgrl
7> connect internal
8> startup mount foxmold
9> alter database rename file
¡®/u/product/oradata/foxmold/user01.dbf¡¯ to
¡®/db3/oradata/user01.dbf¡¯
10> alter database open
µÚ¶þÖÖ·½·¨:(Alter tablespace)
¹Ø±ÕÊý¾Ý¿â-Òƶ¯Êý¾Ý¿âÎļþ-×°Ôز¢¸ÄÃû-Æô¶¯
1> svrmgrl
2> connect internal
3> shutdown
4> exit
5> mv /u/product/oradata/foxmold/user01.dbf /db3/oradata
6> svrmgrl
7> connect internal
10> alter database rename file
¡®/u/product/oradata/foxmold/user01.dbf¡¯ to
¡®/db3/oradata/user01.dbf¡¯
8> alter database open
ÉÏÃæµÄfoxmold´ú±íµ±Ç°µÄdatabase name¡£

Æߣ®ÉèÖú͹ÜÀí»Ø¹ö¶Î
»Ø¹ö¶ÎÒ»°ã¿ÉÒÔ´¦ÀíÈÎÒâ´óСµÄÊÂÎËùÒÔÒ²¾ÍÐèÒª´óС²»Í¬µÄ»Ø¹ö¶Î¡£»Ø¹ö¶ÎµÄ´óСÊÇͨ¹ý´´½¨»Ø¹ö¶Îʱָ¶¨´æ´¢×Ó¾äÀ´ÉèÖ㬵«Ò»°ã»á×ñ´ÓÏÂÃæÔ­Ôò£º
OLTPÊÂÎïÌØÕ÷ÓÐÐí¶à²¢·¢µÄÊÂÎÿ¸ö¿ÉÄÜÖ»ÐÞ¸ÄÉÙÁ¿µÄÊý¾Ý£¬¿ÉÒÔ½¨Á¢10KBµ½20KB´óСµÄ»Ø¹ö¶Î£¬Ã¿¸öÓÐ2µ½4µÄ·¶Î§£»¶ÔÓÚʱ¼äºÜ³¤µÄ²éѯΪÁËά»¤¶ÁÒ»ÖÂÐÔÓдóÁ¿µÄ»Ø¹öÐÅÏ¢£¬ËùÒÔÐèÒª½Ï´óµÄ»Ø¹ö¶Î£¬½¨Á¢»Ø¹ö¶ÎµÄ´óС×îºÃΪ×î´ó±íµÄ10%×óÓÒ£¨´ó¶àÊý²éѯֻӰÏìµ½±íÔ¼10%µÄÊý¾ÝÁ¿£©¡£ÉèÖûعö¶ÎµÄ´óС¿ÉÒÔͨ¹ýCreate rollback segmentºÍAlter rollback segmentÓï¾äÀ´ÊµÏÖ¡£Ò»°ãÇé¿öÏ£¬initial=next £¬ÉèÖÃOptimal²ÎÊýÀ´½ÚÔ¼¿Õ¼äµÄʹÓà £¬²»ÒªÉèÖÃmaxextentsΪunlimited£¬»Ø¹ö¶ÎÓ¦´´½¨ÔÚÒ»¸öÌض¨µÄ»Ø¹ö¶Î±í¿Õ¼äÄÚ ¡£
»Ø¹ö¶ÎµÄÄ¿±êÈÝÁ¿¿ÉÒÔÓô洢²ÎÊýOptimalÀ´¶¨Ò壬ËüÖ¸¶¨»Ø¹ö¶ÎÒªËõСµ½µÄ³ß´ç¡£Èç¹û·¢Ïֻعö¶ÎÓÉÓÚOptimalµÄÔµ¹Ê³ÖÐøµØÊÕËõ£¬ÄÇôºÜ¿ÉÄÜÊǻعö¶ÎÉèÖò»Ç¡µ±£¬ÕâÖÖ¿ÉÒÔͨ¹ý¶¯Ì¬ÐÔÊÓͼV$rollstatÀ´È·¶¨ÊÇ·ñÓÐÎÊÌ⣬È磺
SELECT substr(name,1,40) name,extents,resize,aveactive,aveshrink,
extends,shrink FROM V$rollname rn,V$rollstat rs WHERE rn.usn=rs.usn;
½á¹ûÈçÏ£º
name extents resize aveactive aveshrint extents shrinks
----- ------- ------ ------- -------- -------- --------
system 4 202876 0 0 0 0
csirsl 2 202876 55192 0 0 0
Èç¹ûƽ¾ù´óС½Ó½üÓÚOptimal£¬ÔòOptimalÕýÈ·£¬Èç¹ûextentsºÍshrinks¸ß£¬Ôò±ØÐëÔö¼ÓOptimalÖµ¡£ÔÚÉè¼ÆOptimalֵʱÈç¹ûÓг¤Ê±¼ä²éѯºÍÔËÐеÄÊÂÎÔòÓ¦¸Ã°ÑOptimalÉèÖôóЩ¡£
ʹÓûعö¶Î¿ÉÒÔ¸ÄÉÆϵͳÐÔÄÜ£¬¼õÉÙ¾ºÕù£¬»Ø¹ö¶ÎµÄ¶àÉÙÓ¦¸ÃÓÉÊý¾Ý¿âÖеIJ¢·¢ÊÂÎï¾ö¶¨£¬Ì«¶àµÄÊÂÎïʹÓÃÒ»¸ö»Ø¹ö¶Îʱ»á·¢Éú¾ºÕù£¬²é¿´¶¯Ì¬ÐÔÄܱíV$WAITSTAT¿ÉÒԲ鿴»Ø¹ö¶ÎÉÏÊÇ·ñÓоºÕù£º
SELECT class,count FROM V$waitstat WHERE class in(¡®undo header¡¯,¡¯undo block¡¯,¡¯system undo header¡¯,¡¯system undo block¡¯);
½á¹ûÈçÏ£º
CLASS COUNT
------------------------------- ---------------
system undo header 0
system undo block 0
undo header 0
undo block 0
È»ºó½«ÕâЩֵºÍÊý¾ÝÇëÇóµÄ×ÜÊýÏà±È½Ï¡£Êý¾ÝÇëÇóµÄ×ÜÊýµÈÓÚV$sysstatÖеÄdb buffer getsºÍconsistent getsÖ®ºÍ£¬²éѯÓï¾äΪ£º
SELECT sum(value) ¡®Data Requests¡¯ FROM V$systat where name in(¡®db block gets¡¯,¡¯consistent gets¡¯);
½á¹ûÈçÏ£º
Data Requests
---------------------------
5105
Èç¹ûÈκÎÒ»¸öclass/sum(value)>10%,ÄÇô¿¼ÂÇÔö¼Ó»ØÍ˶Ρ£»ØÍ˶εÄÊýÁ¿Ò»°ã°´ÈçϹæÂÉÉ趨£º
¡¡¡¡Óû§Êý¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ »ØÍ˶θöÊý
n<16¡¡¡¡¡¡¡¡¡¡ ¡¡¡¡¡¡¡¡¡¡¡¡4
1632<=n¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡n/4 µ«²»³¬¹ý50
¡¡¡¡ºÍ»Ø¹ö¶ÎÓйصIJÎÊý»¹ÓÐ: transactionsÖ¸³ö²¢·¢ÊÂÎïµÄÊýÁ¿;transcative_per_rollback_segmentÖ¸³öÿ¸ö»Ø¹ö¶ÎµÄÊÂÎïÊýÁ¿¡£
ʹÓÃset transactionÓï¾ä½«ÊÂÎï·ÖÅäµ½Êʵ±´óСµÄ»Ø¹ö¶ÎÃüÁîÈçÏ£º
set transcation use rollback segment RBS13£»
°Ñµ±Ç°µÄÊÂÎï·ÖÅäµ½»Ø¹ö¶ÎRBS13¡£

°Ë£®ÉèÖú͹ÜÀíÁª»úÖØ×öÈÕÖ¾
ÖØ×öÈÕÖ¾µÄ´óСҲÄÜÓ°ÏìÐÔÄÜ£¬ÒòΪÊý¾Ý¿âµÄдÈëºÍ¹éµµÈ¡¾öÓÚÖØ×öÈÕÖ¾µÄ´óС£¬Í¨³£Çé¿öÏ£¬¸ü´óµÄÖØ×öÈÕÖ¾Îļþ¿ÉÒÔÌṩºÃһЩµÄÐÔÄÜ£¬Ð¡µÄÄÜÔö¼Ó¼ì²éµãµÄ»î¶¯ºÍ½µµÍƵÂÊ¡£
²»¿ÉÄÜΪһ¸öÖØ×öÈÕÖ¾ÎļþÌṩÌض¨´óСµÄ½¨Ò飬ÖØ×öÈÕÖ¾ÎļþÔÚ¼¸°ÙÕ××Ö½Úµ½¼¸GB×Ö½Ú¶¼±»ÈÏΪÊǺÏÀíµÄ£¬¸ù¾Ýϵͳ²úÉúµÄÁª»úÖØ×öÊýÁ¿¾ö¶¨ÈÕÖ¾ÎļþµÄ´óС£¬Ò»°ãÇé¿öÏÂÓ¦±£³ÖÔÚÔ¼20·ÖÖÓ½»»»ÈÕÖ¾ÎļþÒ»´Î¡£
Èç¹û·¢ÉúÖØ×öÈÕÖ¾»º³åÇø¾ºÕù£¬¶ÔÊý¾Ý¿âµÄÐÔÄÜÓ°ÏìÒ²½«ÊǺܴóµÄ¡£ÎªÁ˼õÉÙÖØ×öÈÕÖ¾»º³åÇø¾ºÕù£¬ÎÒÃÇ¿ÉÒÔͨ¹ý²éѯV$sysstat±íÅж¨redo log Îļþ»º³åÇøÊÇ·ñ×ã¹»¡£
¡¡¡¡SELECT name,value FROM V$sysstat WHERE name=¡¯redo log space request¡®;
¡¡¡¡´Ë´¦valueµÄÖµÓ¦½Ó½üÓÚ0£¬·ñÔò£¬Ó¦Ôö´ó³õʼ»¯²ÎÊýÎļþµÄLog_buffersµÄÖµ
ÖØ×öÈÕÖ¾Îļþ±»´´½¨ºó´óС²»Äܱ»¸Ä±ä£¬µ«ÊÇ¿ÉÒÔÔö¼Óеġ¢¸ü´óµÄÎļþ£¬²¢ÇÒÔ­À´µÄÎļþÄܱ»É¾³ý¡£¾ßÌåµÄʵÏÖ·½·¨ÈçÏ£º
1£®¼ÙÉèÏÖÓÐÈý¸öÈÕÖ¾×飬ÿ¸ö×éÄÚÓÐÒ»¸ö³ÉÔ±£¬Ã¿¸ö³ÉÔ±µÄ´óСΪ1MB£¬ÏÖÔÚÏë°Ñ´ËÈý¸öÈÕÖ¾×éµÄ³ÉÔ±´óС¶¼¸ÄΪ20MB¡£
2£®´´½¨ÐµÄÈÕ־Ⱥ×é
alter database add logfile group4(¡®d:\oradb\redo04.log¡¯) size 2048k;
alter database add logfile group5(¡®d:\oradb\redo05.log¡¯) size 2048k;
3. Çл»µ±Ç°ÈÕÖ¾µ½ÐµÄÈÕÖ¾×é
alter system switch logfile£»
alter system switch logfile£»
4£®É¾³ý¾ÉµÄÈÕÖ¾
alter database drop logfile group 1£»
alter database drop logfile group 2£»
alter database drop logfile group 3£»
5£®µ½²Ù×÷ϵͳÏÂɾ³ýÔ­¾ÉµÄÈÕÖ¾Îļþ×é1£¬2£¬3ÖеÄÎļþ¡£
6£®Öؽ¨ÈÕÖ¾×é1£¬2£¬3
alter database add logfile group 1 ('d:\oradb\redo01_1.log') size 20M;
alter database add logfile group 2 ('d:\oradb\redo02_1.log') size 20M;
alter database add logfile group 3 ('d:\oradb\redo03_1.log') size 20M;
7£®Çл»ÈÕÖ¾×é
alter system switch logfile£»
alter system switch logfile£»
alter system switch logfile£»
8£®É¾³ýÖмä¹ý¶ÉµÄÈÕÖ¾×é4£¬5
alter database drop logfile group 4£»
alter database drop logfile group 5£»
9£®µ½²Ù×÷ϵͳÏÂɾ³ý¹ý¶ÉÈÕÖ¾Îļþ×é4£¬5ÖеÄÎļþ¡£
10£®±¸·Ýµ±Ç°×îеĿØÖÆÎļþ
SQL>connect internal
SQL>alter database backup controlfile to trace resetlogs;
Áª»úÖØ×öÈÕÖ¾ÎļþÒ²ÊÇ¿ÉÒÔÒƶ¯µÄ£¬¾ßÌåµÄ·½·¨ÊÇ£ºÊ×ÏȹرÕÊý¾Ý¿â£¬Òƶ¯Áª»úÖØ×öÈÕÖ¾Îļþ£¬È»ºó°²×°Êý¾Ý¿â£¬Ê¹ÓÃalter databaseÃüÁî֪ͨÊý¾Ý¿âÁª»úÖØ×öÈÕÖ¾ÎļþµÄÐÂλÖá£È»ºó¾Í¿ÉÒÔÓÃÐÂλÖÃÉϵÄÈÕÖ¾Îļþ´ò¿ªÊµÀý¡£

¾Å£®ÉèÖú͹ÜÀí¹éµµÖØ×öÈÕÖ¾
µ±OracleÒÔarchivelogģʽÔËÐÐʱ,Êý¾Ý¿âÔÚÿ¸öÁª»úÖØ×öÈÕÖ¾ÎļþдÂúºó,¶ÔËü½øÐп½±´,ͨ³£ÊÇдÈë´ÅÅÌ,Ò²¿ÉÒÔдÈë±ðµÄÉ豸,µ«ÕâÐèÒªÈËΪµÄ¸ÉÔ¤µÄ¡£archºǫִ́Ðй鵵¹¦ÄÜ£¬Èç¹ûÓдóÁ¿Æµ·±µÄÊÂÎïµÄʱºò£¬»á²úÉúÖØ×öÈÕÖ¾Îļþ´ÅÅÌ·½ÃæµÄ¾ºÕù£¬±ÜÃâÕâÖÖ¾ºÕùµÄ·½Ê½Êǽ«Áª»úÖØ×öÈÕÖ¾Îļþ·Ö²¼µ½¶à¸ö´ÅÅÌÉÏ¡£ÎªÁËÌá¸ß¹éµµµÄÐÔÄÜ£¬¿ÉÒÔ´´½¨¾ßÓжà¸ö³ÉÔ±µÄÁª»úÖØ×öÈÕÖ¾Îļþ×飬µ«ÊDZØÐ뿼Âǵ½Ã¿¸öÉ豸µÄI/O¡£
¹éµµÖØ×öÈÕÖ¾Îļþ²»Ó¦Óësystem¡¢rbs¡¢data¡¢temp¡¢indexes±í¿Õ¼äµÈ´æ´¢ÔÚͬһ¸öÉ豸ÖУ¬¸ü²»ÄÜÓëÈκεÄÁª»úÖØ×öÈÕÖ¾Îļþ´æ´¢ÔÚͬһ¸öÉ豸ÖУ¬ÒÔÃâ·¢Éú´ÅÅ̵ľºÕù¡£
¹éµµÖØ×öÈÕÖ¾Îļþ±¸·ÝÖ®ºóÊÇ¿ÉÒÔɾ³ý»òÒÆ×ßµÄ,·ñÔò»áÕ¼¾Ý±È½Ï´óµÄ¿Õ¼äÓ°ÏìÓ²ÅÌʹÓúͽµµÍϵͳµÄÐÔÄÜ¡£

Ê®£®ÉèÖú͹ÜÀí¿ØÖÆÎļþ
¿ØÖÆÎļþµÄλÖÃÔÚʵÀý³õʼ»¯²ÎÊýÎļþÖÐÖ¸¶¨µÄ£¬ÈôÒªÒƶ¯¿ØÖÆÎļþ£¬±ØÐëÏȹرÕÊý¾Ý¿âʵÀý£¬Òƶ¯¿ØÖÆÎļþ£¬±à¼­³õʼ»¯²ÎÊýÎļþ£¬È»ºóÖØÐÂÆô¶¯¸ÃʵÀý¡£
ÏÂÃæ¾ÍÒÔOracle8iΪÀý˵Ã÷ÈçºÎÒƶ¯¿ØÖÆÎļþ:
OSΪLinux,DatabaseΪOracle8i¡£
1. ²éѯµ±Ç°Êý¾Ý¿âµÄ¿ØÖÆÎļþµÄλÖÃ
SELECT * FROM v$controlfile;
2. °Ñ¿ØÖÆÎļþ/u/oradata/foxmold/control01.ctl
ÒƵ½/db4/oradata/Ŀ¼Ï¡£
3. svrmgrl
4. connect internal
5. shutdown
6. exit
7. cp /u/oradata/foxmold/control01.ctl /db4/oradata/control01.ctl
8. chmod 660 /db4/oradata/control01.ctl
9. initsid.ora control_files=¡­
10. startup mount foxmold
ÉÏÃæµÄfoxmold´ú±íµ±Ç°µÄdatabase name¡£

ʮһ£®×ܽá
ÒÔÉÏÊÇÕë¶ÔOracleÊý¾Ý¿âÀ´¶ÔÊý¾Ý¿âÎïÀíÉè¼Æ×÷ÒÔ¼òµ¥³ÂÊö, Õë¶Ô¸÷ÖÖ²»Í¬µÄÊý¾Ý¿â¿ÉÄÜ»áÂÔÓв»Í¬, µ«ÊÇÕûÌå˼Ï뻹ÊÇÒ»Öµġ£
ÒÔÉÏдµÄÄÑÃâÓв»µ±Ö®´¦, »¶Ó­´ó¼ÒÅúÆÀÖ¸Õý!
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ