ÃæÏò DBA µÄ Linux Shell ½Å±¾¼ò½é
DBA£ºLinux
ÃæÏò DBA µÄ Linux Shell ½Å±¾¼ò½é
×÷ÕߣºCasimir Saternos
ѧϰһЩÔÚ Linux ÉÏ°²×°¡¢ÔËÐкÍά»¤ Oracle Êý¾Ý¿âËùÐèµÄ»ù±¾ bash shell ½Å±¾¡£
±¾ÎÄÏà¹ØÏÂÔØ£º
ʾÀý½Å±¾
Oracle Êý¾Ý¿â 10g
2005 Äê 11 Ô·¢±í
´óÔ¼ 7 ÄêÇ°£¬Oracle ·¢²¼ÁË Linux ÉϵĵÚÒ»¸öÉÌÒµÊý¾Ý¿â¡£´ÓÄÇʱÆð£¬Oracle¡¢Red Hat ºÍ Novell/SUSE ¾Í²»¶ÏµØºÏ×÷¸ü¸Ä Linux Äںˣ¬´Ó¶øÌá¸ßÊý¾Ý¿âºÍÓ¦ÓóÌÐòµÄÐÔÄÜ¡£ÕýÒòΪÕâÑù£¬ÓÃÓÚ Linux µÄ Oracle Êý¾Ý¿â 10g ²Å°üº¬ÁËÓë²Ù×÷ϵͳ½ôÃÜÏà¹ØµÄÐí¶àÔöÇ¿¹¦ÄÜ¡£DBA ±ÈÒÔÍùÈκÎʱºò¸üÐèÒªÁ˽âºÍʹÓôËƽ̨À´ÔÚÆä¼àÊÓ϶Ôϵͳ½øÐÐ×î¼Ñ¹ÜÀí¡£
ÒÔÍù£¬ÏµÍ³¹ÜÀíÔ±Óë DBA Ö®¼äÔÚÖ°Ôð·½Ãæ´æÔÚ²î±ð¡£µ«Êµ¼ÊÉÏ£¬ÕâÖÖ²î±ðͨ³£²¢²»Ã÷ÏÔ¡£Ðí¶à IT ²¿ÃŹÍӶһЩ¿É½â¾öÊý¾Ý¿â¼¶ÒÔ¼°²Ù×÷ϵͳ¼¶ÎÊÌâµÄÔ±¹¤¡£µ±È»£¬Oracle Êý¾Ý¿â±¾ÉíʹÓòÙ×÷ϵͳ×ÊÔ´£¬²¢ÄÜÓëÆä»·¾³½ôÃܽ»»¥¡£
´ËÍ⣬Ðí¶àϵͳ¹ÜÀíÔ±ºÍ DBA ·¢ÏÖ½«Æ乤×÷Ïà¹ØµÄÈÎÎñ×Ô¶¯»¯ºÜÓбØÒª»ò±È½Ï·½±ã¡£Èí¼þ°²×°¡¢ÏµÍ³×ÊÔ´¼àÊÓÒÔ¼°ÏµÍ³¹ÜÀíÉ漰һЩÖظ´ºÍÈÝÒ׳ö´íµÄÈÎÎñ£¬¶ø×Ô¶¯¹ý³Ì¿ÉÒÔ±ÈÊÖ¶¯¹ý³Ì¸üºÃµØÍê³ÉÕâЩÈÎÎñ¡£
½«ÕâЩÈÎÎñ×Ô¶¯»¯µÄ·½·¨Ö®Ò»ÊÇ shell ½Å±¾¡£Shell ½Å±¾×Ô Linux ϵͳ°²×°Ö®³õ¾ÍÆð×ÅÖØÒª×÷Óá£Æô¶¯ºÍ¹Ø±Õϵͳʱ¾Í»áµ÷Óø÷Öֽű¾¡£Oracle ºÍÆäËûµÚÈý·½¹©Ó¦É̵ÄʵÓóÌÐòÒ²ÊÇͨ¹ý shell ½Å±¾¿Éµ÷Óõġ£ÓÉÓÚÕâЩ½Å±¾¿ÉÒÔ¿ìËÙ¿ª·¢£¬Òò´ËÀúÀ´¾ÍÓÃËüÃǹ¹½¨Ó¦ÓóÌÐòÔÐÍ¡£ÏµÍ³¹ÜÀíÔ±ÒÑÀûÓÃͨ¹ý shell ½Å±¾ÊµÏֵŦÄÜÌṩÕë¶ÔÆä¼àÊÓµÄϵͳµÄÌض¨ÒªÇóºÍÌØÕ÷¶¨ÖƵĽâ¾ö·½°¸ÁË¡£
ÔÚ±¾ÎÄÖУ¬ÎÒ½«½éÉÜ“bash”shell ½Å±¾¿ÉÒÔʵÏֵġ¢ÓëÔÚ Linux ƽ̨ÉÏ°²×°¡¢ÔËÐкÍά»¤ Oracle Êý¾Ý¿âÏà¹ØµÄ¹¦ÄÜ¡£×¢Ò⣬±¾ÎÄÊÊÓÃÓÚ Linux ½Å±¾³õѧÕß»ò¶Ô Linux Ïà¶ÔÄ°ÉúµÄ DBA£»¶Ô´ó¶àÊý¾Ñé·á¸»µÄ Linux ϵͳ¹ÜÀíÔ±Ôò²»ÊÊÓá£
Shell ½Å±¾ÊÇʲô£¿
shell ½Å±¾ÊÇÒ»¸ö°üº¬ÃüÁîÐòÁеÄÎı¾Îļþ¡£µ±ÔËÐÐÎļþ£¨»ò½Å±¾£©Ê±£¬½«Ö´ÐиÃÎļþÖаüº¬µÄÃüÁî¡£ÊõÓï shell ½öÖ¸Óë Linux ÄÚºËͨÐÅËùʹÓõÄÌض¨ÃüÁîÐÐÓû§½çÃ档ĿǰÓжà¸ö²»Í¬µÄ shell£¬ÆäÖаüÀ¨ C shell (csh)¡¢Korn shell (ksh)¡¢Bourne shell (sh) ºÍ Bourne-Again shell (bash)¡£shell ±¾Éí¾ÍÊÇÒ»¸ö´ÓÎļþ»òÖն˶ÁÈ¡ÃüÁî¡¢½âÊÍÕâЩÃüÁͨ³£Ö´ÐÐÆäËûÃüÁîµÄÃüÁî¡£Bourne-Again shell ºÏ²¢ÁËÉÏÊöÆäËû shell µÄÌØÐÔ£¬±¾ÎľÍʹÓøýű¾½øÐÐÑÝʾ¡£
½Å±¾ÎļþÖеĵÚÒ»ÐпÉÓÃÓÚÖ¸¶¨Ê¹ÓÃÄĸö shell À´ÔËÐиýű¾¡£ÒÔÏÂÊÇËùÓ
Ïà¹ØÎĵµ£º
ÕûÀíÁËһЩ³£ÓõÄLinuxÃüÁî
http://jythoner.javaeye.com/blog/290976
¹Ø¼ü×Ö: linux
1.²é¿´ÏµÍ³ÄÚºË
#uname -a
2.²é¿´cpuÐÅÏ¢
#cat /proc/cpuinfo
3.²é¿´ÄÚ´æʹÓÃÇé¿ö
#free -m
4.²é¿´Ó²ÅÌÊ£Óà¿Õ¼ä
#df -h
5.²é¿´Ä¿Â¼Õ¼Óÿռä
#du -hs Ŀ¼Ãû
6.²é¿´µ±Ç°ÓÐÄÄЩ½ø³Ì
#ps -A
7.²é¿´µ±Ç°½ø³ÌµÄʵ ......
Ðí¶à¸Õ½Ó´¥LinuxµÄÍøÂç¹ÜÀíÔ±·¢ÏÖ£¬ËûÃǺÜÄÑÓÉÖ¸Ïòµã»÷ʽµÄ°²È«ÅäÖýçÃæת»»µ½ÁíÒ»ÖÖ»ùÓڱ༸´ÔÓ¶øÄÑÒÔ×½ÃþµÄÎı¾ÎļþµÄ½çÃæ¡£±¾ÎÄÁгöÆßÌõ¹ÜÀíÔ±Äܹ»Ò²Ó¦¸Ã¿ÉÒÔ×öµ½µÄ²½Ö裬´Ó¶ø°ïÖúËûÃǽ¨Á¢¸ü¼Ó°²È«µÄLinux·þÎñÆ÷£¬²¢ÏÔÖø½µµÍËûÃÇËùÃæÁٵķçÏÕ¡£
ÇëÈκδóÐÍ»ú¹¹µÄÍøÂç¹ÜÀíÔ±¶ÔLinuxºÍÍøÂç²Ù×÷ϵͳ£¨ÈçWindows NT»òNo ......
1 ¡¢°²×°Ç°µÄ×¼±¸
1.1 ¼ì²éÓ²¼þ
ÎïÀíÄڴ棺 # grep MemTotal /proc/meminfo
½»»»¿Õ¼ä£º # grep SwapTotal /proc/meminfo
½»»»¿Õ¼äµÄ´óСÊǸù¾ÝÎïÀíÄÚ´æµÄ´óСÀ´ÉèÖõģ¬ÎïÀíÄÚ´æÉÙÓÚ 2G µÄÔò½»»»¿Õ¼äÉèΪÎïÀíÄÚ´æµÄÁ½±¶£¬ÎïÀíÄÚ´æ´óÓÚ 2G µÄÔò½»»»¿Õ¼äºÍÎïÀíÄÚ´æ´óСһÑù¡£Èç¹û²»·ûºÏÉÏÊö¹æ¶¨£¬ÄÇô¾ÍÐèÒªÖØÐÂÉèÖý ......
1¡¢Apache
¡¡¡¡ÔÚÈçÏÂÒ³ÃæÏÂÔØapacheµÄfor Linux µÄÔ´Âë°ü
¡¡¡¡http://www.apache.org/dist/httpd/;
¡¡¡¡´æÖÁ/home/xxĿ¼£¬xxÊÇ×Ô½¨Îļþ¼Ð£¬ÎÒ½¨ÁËÒ»¸öwjµÄÎļþ¼Ð¡£
¡¡¡¡ÃüÁîÁÐ±í£º
¡¡¡¡
cd /home/wj
¡¡¡¡tar -zxvf httpd-2.0.54.tar.gz
¡¡¡¡mv httpd-2.0.54 apache
¡¡¡¡cd apache
¡¡¡¡./configure --prefix=/u ......
ps -ef|grep tomcat ²é¿´ÕýÔÚÆô¶¯µÄÏß³Ì
cd .. ÍË»ØÉÏÒ»¼«
ls Áгöµ±Ç°Ä¿Â¼µÄÎļþ
kill -9 [Ï̺߳Å] ¹Ø±ÕÏß³Ì
su - root µÇ½Õ˺Å
ÔĶÁ(0)| ÆÀÂÛ(14)| ·ÖÏí(0) ½ÏÐÂһƪ:ת£º´øËÑË÷·ÖÒ³µÄgird ½Ï¾Éһƪ:·è×Ó ÆÀÂÛ| ÔÞ
ÖÜ˧ 2010-01-26 18:23
su - root µÇ½Õ˺Å
ÖÜ˧ 2010-01-26 19:53
......