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

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

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

    總結(jié)一下ASM的磁盤創(chuàng)建過程
    此次實驗是基于CentOS 4.6系統(tǒng)的實驗,
    ?
    1.首先,我需要在Oracle的網(wǎng)站上download的一些ASM的lib包
    http://www.oracle.com/technology/tech/linux/asmlib/install.html
    因為自己實驗的環(huán)境是基于Linux的,而且是RHEL AS 4所以會根據(jù)當(dāng)前的kernel和OS的版本下載三個包
    分別是:
    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.之后可以通過RPM的軟件對他們分別進(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用戶和組
    [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的庫文件
    [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? ]
    ?
    以上操作會加載和ASM相關(guān)的一些.o的驅(qū)動.并且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磁盤

    首先先將一些磁盤(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)錯誤的原因是由于我們還沒有對/dev/sdb這個設(shè)備文件所加載的磁盤進(jìn)行分區(qū),而且sdb也不是一個partition
    因此我們先對sdb磁盤進(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.
    ?
    這個時候系統(tǒng)中會出現(xiàn)一個sdb1這個設(shè)備文件
    ?
    之后我們繼續(xù)對sdc,sdd,sde以上面同樣的方法來進(jìn)行分區(qū)。
    ------------------------------------------------------
    重新創(chuàng)建ASM磁盤
    [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)境中呢,如果在一個節(jié)點添加了ASM磁盤,在其他節(jié)點上要用過scandisks命令來獲得這種變化。
    如:
    [root@orahost01 dev]#/etc/init.d/oracleasm scandisks
    Scanning system for ASM disks: [? OK? ]
    ?
    就此ASM環(huán)境的物理基礎(chǔ)就已經(jīng)搭建成功.
    ?
    其他OS類似于此,很簡單,只要按照這個思路走就可以了:)
    ?
    ********************************************************************************************
    ?
    ?
    posted on 2009-07-16 23:05 decode360 閱讀(1469) 評論(0)  編輯  收藏 所屬分類: 07.Oracle
    主站蜘蛛池模板: 久久久久亚洲AV无码专区体验| 亚洲AV无码精品蜜桃| 国产精品白浆在线观看免费| 亚洲人成毛片线播放| 亚洲国产精品成人AV无码久久综合影院| 精品免费久久久久国产一区 | 国产成人亚洲综合一区| 国产小视频免费观看| 久久久精品午夜免费不卡| 亚洲日韩久久综合中文字幕| 中文字幕精品无码亚洲字 | 日韩视频在线精品视频免费观看| 亚洲av无码无线在线观看| 亚洲国产精品久久久天堂| 特级淫片国产免费高清视频| 精品免费视在线观看| 亚洲精品无码国产片| 91大神亚洲影视在线| 亚洲av午夜精品一区二区三区| 最近免费中文字幕大全免费| 免费看又黄又爽又猛的视频软件| 久久亚洲日韩精品一区二区三区| 国产猛烈高潮尖叫视频免费| 久久久久久曰本AV免费免费| 中文在线免费不卡视频| 亚洲高清毛片一区二区| 亚洲视频中文字幕| 亚洲伊人成无码综合网| 日本免费人成视频播放| xx视频在线永久免费观看| 91在线视频免费观看| 色噜噜的亚洲男人的天堂| 亚洲日本视频在线观看| 亚洲大尺度无码专区尤物| 亚洲国产成人久久笫一页| 好吊妞在线成人免费| 黄瓜视频影院在线观看免费| 一级毛片免费不卡在线| 国产中文字幕在线免费观看| 国产亚洲美女精品久久久久| 亚洲午夜在线播放|