<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Decode360's Blog

    業(yè)精于勤而荒于嬉 QQ:150355677 MSN:decode360@hotmail.com

      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 ::  :: 管理 ::
      397 隨筆 :: 33 文章 :: 29 評(píng)論 :: 0 Trackbacks
    Oracle ASM介紹
    ?
    ??? Oracle 10g在安裝的時(shí)候必須要選擇的一個(gè)文件存儲(chǔ)方式的選項(xiàng),可以選擇“文件系統(tǒng)”、“ASM”、“裸設(shè)備”。其中ASM現(xiàn)在已經(jīng)越來(lái)越多的應(yīng)用到實(shí)踐中。ASM的時(shí)候,可以使Oracle脫離OS文件系統(tǒng)的約束,使得對(duì)文件管理時(shí)更加方便,同時(shí)也改善了很多的硬件屬性。當(dāng)然,使用ASM需要專(zhuān)門(mén)配置、創(chuàng)建一個(gè)ASM磁盤(pán)組。下面找了些文章介紹一下,初步了解ASM。
    ?
    Oracle數(shù)據(jù)庫(kù)自動(dòng)存儲(chǔ)管理(ASM)

    ??? 關(guān)于ASM的討論很多,但是到底什么是ASM?ASM是一個(gè)有效的抽象層,使你的Oracle數(shù)據(jù)庫(kù)可以與叫做DiskGroups的抽象空間一起使用,而不是直接使用DataFiles。這帶來(lái)了很多好處,但是也要求學(xué)習(xí)一些新的概念、命令、使用和管理任務(wù)。所以在投入你的生產(chǎn)系統(tǒng)之前,看看它解決什么、管理什么,以及對(duì)它的正反面評(píng)價(jià)。
    ?
    ?
    為什么創(chuàng)建它?
    ?
      回答這個(gè)問(wèn)題的最好方式是直接追溯源頭,Bill Bridge——自動(dòng)存儲(chǔ)管理的最初架構(gòu)師。在Oracle Press標(biāo)題中的Oracle ASM,Bill提供了一個(gè)鏈接,他在那里討論了使用供應(yīng)商特定操作系統(tǒng)的文件系統(tǒng)來(lái)管理Oracle數(shù)據(jù)文件放置所遇到的問(wèn)題:
    ?
      1. 對(duì)于歸檔日志和備份,操作系統(tǒng)供應(yīng)商不提供共享磁盤(pán)文件系統(tǒng)。
      2. 邏輯卷管理器隱藏了文件的位置,使得很難管理磁盤(pán)I/O和提供良好的統(tǒng)計(jì)。
      3. 當(dāng)磁盤(pán)數(shù)超過(guò)100時(shí),現(xiàn)有的lvm不能工作得很好。
      4. 當(dāng)數(shù)據(jù)庫(kù)有1000以上的數(shù)據(jù)文件時(shí),操作系統(tǒng)和Oracle不能很好地處理數(shù)據(jù)庫(kù)。
      5. 當(dāng)有大量數(shù)據(jù)文件時(shí)命名就變得很困難了。
      6. 特性和文件系統(tǒng)限制隨操作系統(tǒng)的不同而不同。
      7. 操作系統(tǒng)級(jí)的用戶(hù)可以通過(guò)標(biāo)準(zhǔn)使用接觸到Oracle文件,而Oracle并不知道。
    ?
      所以,他通過(guò)建立Oracle自己的文件系統(tǒng)開(kāi)始解決這些問(wèn)題。他的目標(biāo)是提供這些特性:
    ?
      1. 與Oracle緊密集成,并與集群一起使用(并行服務(wù)器)。
      2. 自動(dòng)使用新的存儲(chǔ),作為磁盤(pán)單元或磁盤(pán)組來(lái)管理。
      3. 支持成千上萬(wàn)的磁盤(pán)。
      4. 文件不會(huì)名字,并會(huì)在操作系統(tǒng)中隱藏起來(lái)。
    ?
    ?
    誰(shuí)需要它?
    ?
      現(xiàn)在快速瀏覽一下上面那些問(wèn)題和解決方案會(huì)幫助你確定誰(shuí)需要ASM。起初,它是用來(lái)處理現(xiàn)在很大型的聯(lián)機(jī)數(shù)據(jù)庫(kù)。所以如果它包括你的商店,那么你可能已經(jīng)在關(guān)注它了,或者開(kāi)始執(zhí)行ASM。如果你的數(shù)據(jù)庫(kù)較小,數(shù)據(jù)文件也不多,那么你可能需要再一些理由使你考慮采用它。
    ?
      1. 你將要熟悉一些新技術(shù),并且應(yīng)該從在你的開(kāi)發(fā)環(huán)境中建立它開(kāi)始,并測(cè)試幾個(gè)月。
      2. 如果你想從你現(xiàn)有的磁盤(pán)子系統(tǒng)中獲得更高的性能,并獲得更好的統(tǒng)計(jì)用于預(yù)測(cè)磁盤(pán)I/O。
      3. 如果你正在使用RAC,那么就需要考慮ASM了。
    ?
    ?
    開(kāi)始
    ?
      ASM是由一個(gè)實(shí)例管理,非常類(lèi)似于Oracle數(shù)據(jù)庫(kù)。但是初始參數(shù)是非常有限的,而且啟動(dòng)過(guò)程也簡(jiǎn)單得多。
    ?
      a. 將你的ORACLE_SID設(shè)置為+ASM1
    ?
      b. 編輯init.ora

      # as opposed to RDBMS for a normal Oracle instance
      INSTANCE_TYPE=ASM
      # these names will be used in place of datafile names when you create tablespaces
      ASM_DISKGROUPS=SEAN, AARON
      processes=100
      # this parameter is platform specific and is the path to the raw disk device
      ASM_DISKSTRING='/dev/cciss/c0d0p1'
      # on 11g you should use diagnostic_dest instead of these
      background_dump_dest=/opt/oracle/admin/+ASM/bdump'
      core_dump_dest=/opt/oracle/admin/+ASM/cdump'
      user_dump_dest=/opt/oracle/admin/+ASM/udump'
    ?
      c. 啟動(dòng)ASM實(shí)例
    ?
      $ sqlplus / as sysdba
      SQL> startup

      d. 創(chuàng)建磁盤(pán)組
    ?
      SQL> create diskgroup SEAN disk '/dev/cciss/c0d0p1';
    ?
      e. 檢查表空間的創(chuàng)建
    ?
      你可能會(huì)猜測(cè),創(chuàng)建一個(gè)表空間會(huì)有輕微的改變。默認(rèn)方法如下所示:
    ?
      SQL> create tablespace sean_space datafile '+SEAN' size 1GB;
    ?
      不過(guò)想一下這個(gè)很好的特性。如果在你的數(shù)據(jù)庫(kù)中init.ora文件你設(shè)置參數(shù)為:
    ?
    ??? db_create_file_dest=+SEAN
    ?
      那么你可以這樣做:
    ?
      SQL> create tablespace sean_space;
    ?
      然后讓Oracle做其余的工作。在這兩種情形下,你將發(fā)現(xiàn)在v$datafile中列出的文件路徑是和抽象的+SEAN 磁盤(pán)組有關(guān),而不是與一個(gè)實(shí)際的操作系統(tǒng)數(shù)據(jù)文件。
    ?
      f. 更多的
    ?
      當(dāng)然簡(jiǎn)化文件名稱(chēng)和表空間的創(chuàng)建只是ASM可以為你做的工作的冰山一角。它還可以提供一個(gè)冗余級(jí)別。
    ?
      在數(shù)據(jù)庫(kù)方面,外部冗余能力主要是當(dāng)你在硬件級(jí)別(RAID)上或Oracle可以看到的其它外部方法中具有冗余。換句話(huà)說(shuō),如果asm_diskstring設(shè)備是它們自己的邏輯,隱藏物理磁盤(pán)于一些冗余的硬件層后面,那么你就會(huì)有外部冗余能力。
    ?
      但是,如果你沒(méi)有這個(gè)冗余能力,那么ASM可以提供。你可以指定冗余、失敗組和一組其它的選項(xiàng)來(lái)防止損失一個(gè)或多個(gè)磁盤(pán)、控制器或甚至是整個(gè)SAM失效。ASM還提供了在磁盤(pán)組中均勻分布的I/O。因?yàn)锳SM很好的了解背后發(fā)生了什么,所以O(shè)racle可以自動(dòng)的為你提供I/O到磁盤(pán)的一個(gè)更好的平衡。
    ?
    ?
    使用ASM遇到的挑戰(zhàn)
    ?
      ASM當(dāng)然是一個(gè)具有很大潛能的強(qiáng)大技術(shù)。但是對(duì)于每一個(gè)技術(shù)解決方案,都會(huì)有很多的挑戰(zhàn)。對(duì)于ASM,它潛在地破壞了Unix系統(tǒng)管理組和數(shù)據(jù)庫(kù)/數(shù)據(jù)庫(kù)管理員組間力量的普通平衡。以前的組管理磁盤(pán)、硬件和操作系統(tǒng)級(jí)別,使數(shù)據(jù)庫(kù)管理員與它們協(xié)作獲取新的資源。這將在某種程度上挑戰(zhàn)這個(gè)平衡,而這會(huì)引起一些來(lái)自于這個(gè)組的阻力。
    ?
      最后,應(yīng)該是業(yè)務(wù)需求促使了它的采用。還要注意到ASM仍然是處于企業(yè)計(jì)算認(rèn)識(shí)階段,相對(duì)還比較新。有一些供應(yīng)商他們的核心業(yè)務(wù)已經(jīng)放在邏輯空間管理器/文件系統(tǒng)空間中很多年了。一般來(lái)說(shuō),對(duì)于軟件系統(tǒng)和可靠性來(lái)說(shuō)成熟是很重要的。
    ?
    ?
    總結(jié)
    ?
      ASM很強(qiáng)大,它為目前部署的不斷發(fā)展的大型數(shù)據(jù)庫(kù)系統(tǒng)提供了解決方案。它還可以為較小數(shù)據(jù)庫(kù)安裝或者那些使用集群的數(shù)據(jù)庫(kù)提供解決方案。如同對(duì)于任何新技術(shù)一樣,評(píng)估、測(cè)試,然后更多的測(cè)試。
    ?
    ?
    ?
    ?
    再轉(zhuǎn)一篇ASM的配置文章
    ********************************************************************************************
    ?
    配置Oracle 10g ASM磁盤(pán)

    總結(jié)一下ASM的磁盤(pán)創(chuàng)建過(guò)程
    此次實(shí)驗(yàn)是基于CentOS 4.6系統(tǒng)的實(shí)驗(yàn),
    ?
    1.首先,我需要在Oracle的網(wǎng)站上download的一些ASM的lib包
    http://www.oracle.com/technology/tech/linux/asmlib/install.html
    因?yàn)樽约簩?shí)驗(yàn)的環(huán)境是基于Linux的,而且是RHEL AS 4所以會(huì)根據(jù)當(dāng)前的kernel和OS的版本下載三個(gè)包
    分別是:
    oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm
    oracleasmlib-2.0.2-1.i386.rpm
    oracleasm-support-2.0.3-1.i386.rpm
    ?
    2.之后可以通過(guò)RPM的軟件對(duì)他們分別進(jìn)行安裝
    [root@orahost01 ASM]# rpm -Uvh oracleasm-support-2.0.3-1.i386.rpm
    Preparing...??????????????? ########################################### [100%]
    ?? 1:oracleasm-support????? ########################################### [100%]
    [root@orahost01 ASM]# rpm -Uvh oracleasm-2.6.9-67.EL-2.0.3-1.i686.rpm
    Preparing...??????????????? ########################################### [100%]
    ?? 1:oracleasm-2.6.9-67.EL? ########################################### [100%]
    [root@orahost01 ASM]# rpm -Uvn oracleasmlib-2.0.2-1.i386.rpm
    -Uvn: unknown option
    [root@orahost01 ASM]# rpm -Uvh oracleasmlib-2.0.2-1.i386.rpm
    Preparing...??????????????? ########################################### [100%]
    ?? 1:oracleasmlib?????????? ########################################### [100%]
    并且創(chuàng)建相應(yīng)的Oracle用戶(hù)和組
    [root@orahost01 ASM]# groupadd oinstall
    [root@orahost01 ASM]# groupadd dba
    [root@orahost01 ASM]# mkdir -p /opt/oracle/product
    [root@orahost01 ASM]# mkdir -p /home/oracle
    [root@orahost01 ASM]# useradd -g oinstall -G dba -d /home/oracle oracle
    [root@orahost01 ASM]# passwd oracle
    Changing password for user oracle.
    New UNIX password:
    BAD PASSWORD: it is based on a dictionary word
    Retype new UNIX password:
    passwd: all authentication tokens updated successfully.
    [root@orahost01 ASM]# id oracle
    uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba)
    [root@orahost01 ASM]# chown -R oracle:oinstall /opt/oracle
    [root@orahost01 ASM]# cd /home
    [root@orahost01 home]# chown -R oracle:oinstall oracle
    ?
    3.配置ASM的庫(kù)文件
    [root@orahost01 home]#/etc/init.d/oracleasm configure
    Configuring the Oracle ASM library driver.
    ?
    This will configure the on-boot properties of the Oracle ASM library
    driver.? The following questions will determine whether the driver is
    loaded on boot and what permissions it will have.? The current values
    will be shown in brackets ('[]').? Hitting <ENTER> without typing an
    answer will keep that current value.? Ctrl-C will abort.
    ?
    Default user to own the driver interface []: oracle
    Default group to own the driver interface []: dba
    Start Oracle ASM library driver on boot (y/n) [n]: y
    Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
    Writing Oracle ASM library driver configuration: [? OK? ]
    Creating /dev/oracleasm mount point: [? OK? ]
    Loading module "oracleasm": [? OK? ]
    Mounting ASMlib driver filesystem: [? OK? ]
    Scanning system for ASM disks: [? OK? ]
    ?
    以上操作會(huì)加載和ASM相關(guān)的一些.o的驅(qū)動(dòng).并且mount上asm的文件系統(tǒng)
    ?
    4.如何disable和enable ASM

    [root@orahost01 home]#/etc/init.d/oracleasm disable
    Writing Oracle ASM library driver configuration: [? OK? ]
    Unmounting ASMlib driver filesystem: [? OK? ]
    Unloading module "oracleasm": [? OK? ]
    [root@orahost01 home]#/etc/init.d/oracleasm enable
    Writing Oracle ASM library driver configuration: [? OK? ]
    Loading module "oracleasm": [? OK? ]
    Mounting ASMlib driver filesystem: [? OK? ]
    Scanning system for ASM disks: [? OK? ]
    ?
    5.創(chuàng)建ASM磁盤(pán)

    首先先將一些磁盤(pán)(4塊)插入我們的Server
    之后
    [root@orahost01 home]# /etc/init.d/oracleasm createdisk myVol1 /dev/sdb
    Marking disk "/dev/sdb" as an ASM disk: asmtool: Device "/dev/sdb" is not a partition
    [FAILED]
    這里出現(xiàn)錯(cuò)誤的原因是由于我們還沒(méi)有對(duì)/dev/sdb這個(gè)設(shè)備文件所加載的磁盤(pán)進(jìn)行分區(qū),而且sdb也不是一個(gè)partition
    因此我們先對(duì)sdb磁盤(pán)進(jìn)行分區(qū)
    [root@orahost01 dev]#fdisk sdb
    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
    Building a new DOS disklabel. Changes will remain in memory only,
    until you decide to write them. After that, of course, the previous
    content won't be recoverable.
    ?
    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
    ?
    Command (m for help): m
    Command action
    ?? a?? toggle a bootable flag
    ?? b?? edit bsd disklabel
    ?? c?? toggle the dos compatibility flag
    ?? d?? delete a partition
    ?? l?? list known partition types
    ?? m?? print this menu
    ?? n?? add a new partition
    ?? o?? create a new empty DOS partition table
    ?? p?? print the partition table
    ?? q?? quit without saving changes
    ?? s?? create a new empty Sun disklabel
    ?? t?? change a partition's system id
    ?? u?? change display/entry units
    ?? v?? verify the partition table
    ?? w?? write table to disk and exit
    ?? x?? extra functionality (experts only)
    ?
    Command (m for help): n
    Command action
    ?? e?? extended
    ?? p?? primary partition (1-4)
    p
    Partition number (1-4): 1
    First cylinder (1-130, default 1):
    Using default value 1
    Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
    Using default value 130
    ?
    Command (m for help):w
    The partition table has been altered!
    ?
    Calling ioctl() to re-read partition table.
    Syncing disks.
    ?
    這個(gè)時(shí)候系統(tǒng)中會(huì)出現(xiàn)一個(gè)sdb1這個(gè)設(shè)備文件
    ?
    之后我們繼續(xù)對(duì)sdc,sdd,sde以上面同樣的方法來(lái)進(jìn)行分區(qū)。
    ------------------------------------------------------
    重新創(chuàng)建ASM磁盤(pán)
    [root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol1 /dev/sdb1
    Marking disk "/dev/sdb1" as an ASM disk: [? OK? ]
    [root@orahost01 dev]# /etc/init.d/oracleasm listdisks
    MYVOL1
    [root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol2 /dev/sdc1
    Marking disk "/dev/sdc1" as an ASM disk: [? OK? ]
    [root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol3 /dev/sde1
    Marking disk "/dev/sde1" as an ASM disk: [? OK? ]
    [root@orahost01 dev]# /etc/init.d/oracleasm createdisk myVol4 /dev/sdd1
    Marking disk "/dev/sdd1" as an ASM disk: [? OK? ]
    [root@orahost01 dev]#/etc/init.d/oracleasm listdisks
    MYVOL1
    MYVOL2
    MYVOL3
    MYVOL4
    ?
    需要注意的是如果是在RAC環(huán)境中呢,如果在一個(gè)節(jié)點(diǎn)添加了ASM磁盤(pán),在其他節(jié)點(diǎn)上要用過(guò)scandisks命令來(lái)獲得這種變化。
    如:
    [root@orahost01 dev]#/etc/init.d/oracleasm scandisks
    Scanning system for ASM disks: [? OK? ]
    ?
    就此ASM環(huán)境的物理基礎(chǔ)就已經(jīng)搭建成功.
    ?
    其他OS類(lèi)似于此,很簡(jiǎn)單,只要按照這個(gè)思路走就可以了:)
    ?
    ********************************************************************************************
    ?
    ?
    posted on 2009-07-16 23:05 decode360 閱讀(1470) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): 07.Oracle
    主站蜘蛛池模板: 在线亚洲高清揄拍自拍一品区| 亚洲欧洲精品成人久久曰影片| 最近最新高清免费中文字幕| 久久精品成人免费网站| 国产精品玖玖美女张开腿让男人桶爽免费看| 日韩视频在线精品视频免费观看 | 亚洲欧洲综合在线| 中文字幕亚洲综合久久2| 亚洲免费精彩视频在线观看| 香蕉视频在线观看亚洲| 亚洲第一页在线观看| 亚洲国产成AV人天堂无码| 亚洲人成人77777在线播放| 亚洲va乱码一区二区三区| 中文日韩亚洲欧美制服| 国产成人精品日本亚洲语音| 一级黄色毛片免费看| 你是我的城池营垒免费观看完整版| 国产色爽免费无码视频| 少妇无码一区二区三区免费| 国产精品成人观看视频免费| 成人男女网18免费视频| 波多野结衣视频在线免费观看| 亚洲人成无码www久久久| 亚洲精品国产精品乱码在线观看| 亚洲成AV人片在线观看ww| 亚洲色图综合网站| 亚洲久热无码av中文字幕| 七次郎成人免费线路视频| 污视频在线免费观看| 久久WWW免费人成人片| 五月婷婷亚洲综合| 欧美日韩国产免费一区二区三区 | 精品久久久久久国产免费了| 国产精品区免费视频| 欧美a级在线现免费观看| 亚洲精品老司机在线观看| 久久亚洲精品国产精品| 亚洲一卡2卡三卡4卡无卡下载| 人禽伦免费交视频播放| 777成影片免费观看|