¡¡¡¡ORACLE10g°æ±¾ÍƳöʱ£¬ÎªÁ˼ò»¯RACÖд洢¶ËµÄÅäÖã¬ORACLEÐÂÍƳöÁËASM(Automatic Storage Management --×Ô¶¯´æ´¢¹ÜÀí)ÌØÐÔ£¬¸ÃÌØÐÔÓµÓÐÒ×¹ÜÀí£¬¸ß×Ô¶¯ÐÔ£¬²¢ÇÒ£¬ÓµÓкųƳ¬Ô½ÂãÉ豸IOÐÔÄÜ¡£Éý¼¶µ½11gR2°æ±¾ºó£¬ÓÖ±»ÕýÃûΪ´«ËµÖеÄASMFS£¬ÕâҲ˵Ã÷ÁËORACLE¶ÔÕâÒ»ÌØÐÔµÄÖØÊӳ̶ȡ£

¡¡¡¡Òò´Ë´Ó½ñÌìÆð£¬Èý˼¾ö¶¨»¨¸öÈý¶þ·ÖÖÓʱ¼ä£¬¸ú´óѧһ¿éѧѧ¹ØÓÚASMµÄÄǵã¶ùʶù£¬Áí×¢£¬±¾ÎIJÙ×÷µÄÊý¾Ý¿â°æ±¾Îª10gR2¡£

1¡¢About ASM ʵÀý

¡¡¡¡ASM ʵÀýÓë ORACLE ʵÀý²î²»¶à£¬¶¼ÊÇ ÓÉ sga ºÍÒ»¶Ñºǫ́½ø³Ì×é³É£¬´Ó¹¦ÄÜÉÏÀ´¿´£¬Çø±ðÔÚÓÚoracleʵÀý¹ÜÀíµÄÊÇÊý¾Ý¿â£¬¶øasmʵÀýÖ»ÊǹÜÀíasmÅÌÕó¡£

¡¡¡¡Í¨¹ýOracle EM»òDBCA¶¼¿ÉÒÔ¶Ôasm½øÐÐһЩÅäÖ㬲»¹ýÈý˼¾õ׏ÜÀíasmÀ¨»¡ÊµÀýµÄ×î¼Ñ¹¤¾ßÈÔÊÇsql*plus£¬ÔÚ½øÈësql*plusÇ°Ò²ÐèÒªÉèÖÃORACLE_SIDµÄ»·¾³±äÁ¿£¬¸Ã»·¾³±äÁ¿Í¨³£ÊÇ+ASM[node#] ¡£

¡¡¡¡ASM ʵÀýûÓÐÊý¾Ý×ÖµäÖ®ÀàµÄ¶«¶«´æ´¢Óû§ÏµÍ³£¬Òò´Ë×î³£¼ûµÄÁ¬½ÓÈÏÖ¤·½Ê½¾ÍÊDzÙ×÷ϵͳÈÏÖ¤as sysdba½øÈë(OSDBA×éµÄÓû§)¡£Èç¹ûÊÇͨ¹ýÔ¶³ÌÁ¬½ÓµÄ»°( ±ÈÈçÔ¶³Ìͨ¹ýtnsnames»òOEM¹ÜÀí)£¬Ò²¿ÉÒÔʹÓÃÃÜÔ¿Îļþ½øÐÐÑéÖ¤£¬¸ÃÃÜÔ¿ÎļþÖ±Êý¾Ý¿âµÄÃÜÔ¿ÎļþÔÚÃüÃû¹æÔò¼°Ê¹ÓùæÔòÉÏÍêȫһģһÑù¡£Èç¹ûʹÓÃdbca½¨¿âµÄ»°£¬Ä¬ÈϾͻᴴ½¨asmµÄÃÜÔ¿Îļþ£¬µ±È»Ò²¿ÉÒÔ×ÔÐÐÊÖ¶¯Í¨¹ýorapwdÃüÁî½øÐд´½¨£¬ÓëÊý¾Ý¿âµÄÃÜÔ¿ÎļþÓÐËù²»Í¬µÄÊÇ£¬asm µÄÃÜÔ¿Îļþ¶ÔÓ¦µÄÓû§Ö»ÓÐÒ»¸ö----sys¡£

    Ìáʾ£ºÊ²Ã´ÊÇ ASMLib £¡

    ¼´ASM support Library£¬ÊÇÓÉORACLEÌṩµÄ¼ò»¯¹ÜÀí²Ù×÷ϵͳ¹ÜÀíµÄAPI ¡£

1.1¡¢Æô¶¯ / ¹Ø±Õ ASM ʵÀý

¡¡¡¡ASM ʵÀýÓëDBʵÀý¸ß¶ÈÏàËÆ£¬Æô¶¯ºÍֹͣʵÀýµÄÃüÁîҲһģһÑù£¬¾ÍÆô¶¯À´Ëµ£¬Ò²Í¬ÑùÓµÓÐ NOMOUNT/MOUNT/OPEN /FORCE ¼¸ÖÖ״̬¡£

  • NOMOUNT £º½öÆô¶¯ÊµÀý£»
  • MOUNT ¡¢OPEN£ºÆô¶¯ÊµÀý²¢¼ÓÔØ´ÅÅÌ£¬×¢Òâ¼ÓÔصÄÊÇ´ÅÅÌ×é(Èç¹ûµ±Ç°Î´´´½¨»òÅäÖÃÈκδÅÅÌ×飬ÔòÌáʾ¾´¸æÐÅÏ¢)£¬OPENÑ¡Ïî¶ÔÓÚASMʵÀýÎÞÒâÒ壬µÈͬÓÚMOUNT¡£
  • FORCE £ºÏ൱ÓÚÏÈÖ´ÐÐshutdown abort£¬È»ºóÔÙstartup¡£

¡¡¡¡ÑÝʾÈçÏÂ(×¢Òâ±ðÍüÁËÏÈÉèÖòÙ×÷ϵͳ»·¾³±äÁ¿ORACLE_SID)£¬ÏÈÆô¶¯µ½NOMOUNT£º

    [oracle@jssdbn1 ~]$ export ORACLE_SID=+ASM1

    [oracle@jssdbn1 ~]$ sqlplus / as sysdba

    SQL*Plus: Release 10.2.0.4.0 - Production on Wed May 19 08:34:22 2010

    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

    Connected to an idle instance.

    SQL> startup nomount

    ASM instance started

    Total System Global Area  130023424 bytes

    Fixed Size                  2082208 bytes

    Variable Size             102775392 bytes

    ASM Cache                  25165824 bytes

    SQL> select name,state from v$asm_diskgroup;

    NAME                           STATE

    ------------------------------ -----------

    ASMDISK1                       DISMOUNTED

    ASMDISK2                       DISMOUNTED

    SQL> select instance_name,status from v$instance;

    INSTANCE_NAME    STATUS

    ---------------- ------------

    +ASM1            STARTED

¡¡¡¡¼ÓÔØ´ÅÅÌ×飬עÒ⣬²»ÊÇalter databaseÓ´£º

    SQL> alter diskgroup all mount;

    Diskgroup altered.

    SQL> select name,state from v$asm_diskgroup;

    NAME                           STATE

    ------------------------------ -----------

    ASMDISK1                       MOUNTED

    ASMDISK2                       MOUNTED

¡¡¡¡ÕâÑù£¬¸ÃASM¾Í¿ÉÒÔÌṩ´æ´¢·þÎñÁË¡£

¡¡¡¡Ìáʾһµã£¬ÔÚ10g°æ±¾ÖУ¬ASMÊÇÒÀÀµÓÚCSSÊØ»¤½ø³ÌµÄ£¬Òò´ËÔÚÆô¶¯ASM ʵÀýǰҪȷ±£cssÊØ»¤½ø³ÌÒѾ­Æô¶¯ ¡£ CSS(Cluster Synchronization Services) ÊØ»¤½ø³Ì ÓÃÀ´Î¬³ÖASM ¼°¿Í»§¶ËÊý¾Ý¿âʵÀý¼äµÄÒ»ÖÂÐÔ Í¬²½ £¬Èç¹ûÊÇͨ¹ýdbca½¨¿âµÄ»°£¬ÄÇôCSSÊØ»¤½ø³ÌĬÈϼ´»áÆô¶¯(¸úËæϵͳreboot)¡£

¡¡¡¡¼ì²écssÊØ»¤½ø³ÌÊÇ·ñÆô¶¯·Ç³£ ¼òµ¥ £¬Ö±½ÓʹÓÃcrsctl check cssd¼´¿É£¬Èç¹ûÆô¶¯µÄ»°»áÊÕµ½"CSS appears healthy"µÄ·µ»ØÏûÏ¢£¬ÀýÈ磺

    [oracle@jssdbn1 ~]$ crsctl check cssd

    CSS appears healthy

¡¡¡¡¹Ø±ÕASMʵÀý£¬¼òµ¥ÁË£¬NORMAL/IMMEDIATE/TRANSACTIONAL/ABORT¼¸¸öÑ¡ÏîµÄ¶¨ÒåÓë¹Ø±ÕÆÕͨÊý¾Ý¿âʵÀýÍêȫһģһÑù£¡ÀýÈ磺

    SQL> shutdown immediate

    ASM diskgroups dismounted

    ASM instance shutdown

1.2¡¢¹ØÓÚASMʵÀýµÄ³õʼ»¯²ÎÊý

¡¡¡¡ASM ʵÀýµÄ³õʼ»¯²ÎÊýÐÎʽÉÏÓëÊý¾Ý¿âµÄ³õʼ»¯²ÎÊýÏàͬ£¬Ò²·ÖspfileºÍpfile£¬²Ù×÷·½Ê½Ò²ÍêÈ«Ïàͬ£¬Ö»²»¹ý¾ßÌåµÄ²ÎÊý¼°²ÎÊýÖµÂÔÓвîÒ죬´ó¶àÊýÊý¾Ý¿âµÄ³õʼ»¯²ÎÊýÔÚÕâÀïÒ²Äܼûµ½£¬²¢ÇÒijЩ²ÎÊýÒâÒ嶼ÍêÈ«Ïàͬ£¬Í¬ÑùÒ²ÓÐһЩ²ÎÊýËäÈ»¼ûµ½ÁË£¬²»¹ý²¢²»ÐèÒªÉèÖã¬Õâ¸ö¿ÉÒÔÀí½â£¬±Ï¾¹asmÖ»ÓÐʵÀý£¬Ïà¶Ô±ÈÊý¾Ý¿âµÄ³õʼ»¯²ÎÊýÒª¼òµ¥µÄ¶àÁË£¬»¹ÓÐһЩ²ÎÊýÔòÊÇÊý¾Ý¿â³õʼ»¯²ÎÊýÖÐûÓеġ£±ÈÈçASM¿ªÍ·µÄÄǼ¸¸ö³õʼ»¯²ÎÊý£¬°³ÕùÈ¡°Ñ²îÒìµÄ²¿·Ö¶¼ÁгöÀ´Ð´Ã÷ÁË¡£

¡¡¡¡ASM ʵÀýÔÚÄÚ´æÕ¼ÓÃÕâ¿é»¹ÊDZȽÏÇáÁ¿¼¶µÄ£¬»ù±¾ÉÏÓиö100m¿Õ¼ä¾ÍºÜ³ä×ãÁË £¬Òò´ËÄÚ´æÕâ¿éÏà¹Ø²ÎÊý¾Í²»ËµÁË£¬ÏÂÃæ˵˵¼¸¸öASMʵÀýÌرðÐèÒªµÄ²ÎÊý¡