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

Mysql Innodb ÒýÇæÓÅ»¯(


²ÎÊýƪ
×÷/ÒëÕߣºÎâ±þÎý£¬À´Ô´£ºhttp://imysql.cn¡¡£¦¡¡http://imysql.cn/blog/3208¡¡×ªÔØÇë×¢Ã÷×÷/ÒëÕߺͳö´¦£¬²¢ÇÒ²»ÄÜÓÃÓÚÉÌÒµÓÃ;£¬Î¥Õ߱ؾ¿¡£
 
½éÉÜ£º
¡¡¡¡InnoDB¸øMySQLÌṩÁ˾ßÓÐÌá½»£¬»Ø¹öºÍ±ÀÀ£»Ö¸´ÄÜÁ¦µÄÊÂÎñ°²È«£¨ACID¼æÈÝ£©´æ´¢ÒýÇæ¡£InnoDBËø¶¨ÔÚÐм¶²¢ÇÒÒ²ÔÚSELECTÓï¾äÌṩһ¸öOracle·ç¸ñÒ»ÖµķÇËø¶¨¶Á¡£ÕâЩÌØÉ«Ôö¼ÓÁ˶àÓû§²¿ÊðºÍÐÔÄÜ¡£Ã»ÓÐÔÚInnoDBÖÐÀ©´óËø¶¨µÄÐèÒª£¬ÒòΪÔÚInnoDBÖÐÐм¶Ëø¶¨ÊʺϷdz£Ð¡µÄ¿Õ¼ä¡£InnoDBÒ²Ö§³ÖFOREIGN KEYÇ¿ÖÆ¡£ÔÚSQL²éѯÖУ¬Äã¿ÉÒÔ×ÔÓɵؽ«InnoDBÀàÐ͵ıíÓëÆäËüMySQLµÄ±íµÄÀàÐÍ»ìºÏÆðÀ´£¬ÉõÖÁÔÚͬһ¸ö²éѯÖÐÒ²¿ÉÒÔ»ìºÏ¡£
¡¡Innodb µÄ´´Ê¼ÈË£ºHeikki Tuuri
¡¡Heikki TuuriÔڣɣî£î£ï£ä£âµÄ£Â£õ£çÉçÇøÀïÒ²ÊǺܻîÔ¾µÄ£¬Èç¹ûÓöµ½£Â£õ£çÒ²¿ÉÒÔÖ±½ÓÌáµ½ÉçÇø£¬µÃµ½×÷ÕߵĽâ´ð¡£
ΪʲôҪѧϰ£É£î£î£ï£ä£âµÄµ÷ÓÅ£º
¡¡¡¡Ä¿Ç°À´Ëµ£ºInnoDBÊÇΪMysql´¦Àí¾Þ´óÊý¾ÝÁ¿Ê±µÄ×î´óÐÔÄÜÉè¼Æ¡£ËüµÄCPUЧÂÊ¿ÉÄÜÊÇÈκÎÆäËü»ùÓÚ´ÅÅ̵ĹØϵÊý¾Ý¿âÒýÇæËù²»ÄÜÆ¥µÐµÄ¡£ÔÚÊý¾ÝÁ¿´óµÄÍøÕ¾»òÊÇÓ¦ÓÃÖÐInnodbÊDZ¶ÊÜÇàíùµÄ¡£
¡¡¡¡ÁíÒ»·½Ã棬ÔÚÊý¾Ý¿âµÄ¸´ÖƲÙ×÷ÖÐInnodbÒ²ÊÇÄܱ£Ö¤masterºÍslaveÊý¾ÝÒ»ÖÂÓÐÒ»¶¨µÄ×÷Óá£
²ÎÊýµ÷ÓÅÄÚÈÝ£º
¡¡¡¡1. ÄÚ´æÀûÓ÷½Ãæ
¡¡¡¡2. ÈÕÖµ¿ØÖÆ·½Ãæ
¡¡¡¡3.¡¡ÎļþIO·ÖÅ䣬¿Õ¼äÕ¼Ó÷½Ãæ
¡¡¡¡4. ÆäËüÏà¹Ø²ÎÊý
£±.ÄÚ´æÀûÓ÷½Ã棺
Ê×ÏȽéÉÜÒ»¸öInnodb×îÖØÒªµÄ²ÎÊý£º
innodb_buffer_pool_size
¡¡¡¡Õâ¸ö²ÎÊýºÍMyISAMµÄkey_buffer_sizeÓÐÏàËÆÖ®´¦£¬µ«Ò²ÊÇÓвî±ðµÄ¡£Õâ¸ö²ÎÊýÖ÷Òª»º´æinnodb±íµÄË÷Òý£¬Êý¾Ý£¬²åÈëÊý¾ÝʱµÄ»º³å¡£ÎªInnodb¼ÓËÙÓÅ»¯Ê×Òª²ÎÊý¡£
¡¡¡¡¸Ã²ÎÊý·ÖÅäÄÚ´æµÄÔ­Ôò£ºÕâ¸ö²ÎÊýĬÈÏ·ÖÅäÖ»ÓÐ8M£¬¿ÉÒÔ˵ÊǷdz£Ð¡µÄÒ»¸öÖµ¡£Èç¹ûÊÇÒ»¸öרÓãģ·þÎñÆ÷£¬ÄÇôËû¿ÉÒÔÕ¼µ½ÄÚ´æµÄ70%-80%¡£Õâ¸ö²ÎÊý²»Äܶ¯Ì¬¸ü¸Ä£¬ËùÒÔ·ÖÅäÐè¶à¿¼ÂÇ¡£·ÖÅä¹ý´ó£¬»áʹSwapÕ¼Óùý¶à£¬ÖÂʹMysqlµÄ²éѯÌØÂý¡£Èç¹ûÄãµÄÊý¾Ý±È½ÏС£¬ÄÇô¿É·ÖÅäÊÇÄãµÄÊý¾Ý´óС£«£±£°£¥×óÓÒ×öΪÕâ¸ö²ÎÊýµÄÖµ¡£ÀýÈ磺Êý¾Ý´óСΪ£µ£°£Í,ÄÇô¸øÕâ¸öÖµ·ÖÅäinnodb_buffer_pool_size£½£¶£´£Í
ÉèÖ÷½·¨£º
innodb_buffer_pool_size=4G
Õâ¸ö²ÎÊý·ÖÅäÖµµÄʹÓÃÇé¿ö¿ÉÒÔ¸ù¾Ýshow innodb status\G;ÖеÄ
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 4668764894;
ȥȷÈÏʹÓÃÇé¿ö¡£
µÚ¶þ¸ö£º
innodb_additional_mem_pool£º
×÷ÓãºÓÃÀ´´æ·ÅInnodbµÄÄÚ²¿Ä¿Â¼
Õâ¸öÖµ²»Ó÷ÖÅ


Ïà¹ØÎĵµ£º

mysql×Ö·û¼¯Ð£Ñé¹æÔò

                                                   ......

mysqlÊý¾Ý¿âģʽÐÅÏ¢ÌáÈ¡

´Ë³ÌÐòʵÏÖ½«mysqlÊý¾Ý¿âµÄģʽÐÅϢչʾ³öÀ´¡£ÏÂÃæÎÒ¼òÒªµØ˵Ã÷һϡ£
1.Ê÷ÐνṹµÄʵÏÖ¡£
 SimplePanel pl=new SimplePanel();
private void buildFrameLayout(){
try{ pane = getContentPane();
//¹Ø±ÕÃæ°å
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//BorderLayout²¼¾Ö¹ÜÀíÆ÷
JPanel ......

MySQLÊý¾Ý¿â±¸·ÝºÍ»¹Ô­µÄ³£ÓÃÃüÁî


±¸·ÝMySQLÊý¾Ý¿âµÄÃüÁî
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ
±¸·ÝMySQLÊý¾Ý¿âΪ´øɾ³ý±íµÄ¸ñʽ£¬Äܹ»Èøñ¸·Ý¸²¸ÇÒÑÓÐÊý¾Ý¿â¶ø²»ÐèÒªÊÖ¶¯É¾³ýÔ­ÓÐÊý¾Ý¿â¡£
mysqldump -–add-drop-table -uusername -ppassword databasename > bac ......

ͨ¹ý·ÖÇø£¨Partition£©ÌáÉýMySQLÐÔÄÜ

½ñÌìÕâô¼¤¶¯ÓÖÏëдÎÄÕµÄÔ­ÒòÊÇMySQL5.1µÄ·¢²¼´øÀ´ÁËÉè¼Æ³¬Ç¿¶¯Á¦Êý¾Ý¿âµÄÇ¿ÓÐÁ¦µÄÎäÆ÷£¬ÈκÎMySQLµÄDBA¶¼Ó¦¸Ã¾¡¿ìѧϰ²¢Ê¹ÓÃËü¡£ÎÒ¾õµÃÈç¹û­ÄܺܺõÎʹÓÃÕâ¸ö5.1°æ´øÀ´µÄÐÂÌØÐÔ£¬DBA¿ÉÒÔʹ×Ô¼º¹ÜÀíµÄVLDB£¨²»ÖªµÀʲôÊÇVLDB£¿¸æËßÄ㣬ÊǺôóºÃ´óµÄÊý¾Ý¿âµÄÒâ˼£¬Very Large DB£©»òÊý¾Ý²Ö¿âÆæ¼£°ãµÄ»ñµÃ¾Þ´óµÄÐÔÄÜÌáÉý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ