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

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

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

    Decode360's Blog

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

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

    ??? 關于ASM的討論很多,但是到底什么是ASM?ASM是一個有效的抽象層,使你的Oracle數據庫可以與叫做DiskGroups的抽象空間一起使用,而不是直接使用DataFiles。這帶來了很多好處,但是也要求學習一些新的概念、命令、使用和管理任務。所以在投入你的生產系統之前,看看它解決什么、管理什么,以及對它的正反面評價。
    ?
    ?
    為什么創建它?
    ?
      回答這個問題的最好方式是直接追溯源頭,Bill Bridge——自動存儲管理的最初架構師。在Oracle Press標題中的Oracle ASM,Bill提供了一個鏈接,他在那里討論了使用供應商特定操作系統的文件系統來管理Oracle數據文件放置所遇到的問題:
    ?
      1. 對于歸檔日志和備份,操作系統供應商不提供共享磁盤文件系統。
      2. 邏輯卷管理器隱藏了文件的位置,使得很難管理磁盤I/O和提供良好的統計。
      3. 當磁盤數超過100時,現有的lvm不能工作得很好。
      4. 當數據庫有1000以上的數據文件時,操作系統和Oracle不能很好地處理數據庫。
      5. 當有大量數據文件時命名就變得很困難了。
      6. 特性和文件系統限制隨操作系統的不同而不同。
      7. 操作系統級的用戶可以通過標準使用接觸到Oracle文件,而Oracle并不知道。
    ?
      所以,他通過建立Oracle自己的文件系統開始解決這些問題。他的目標是提供這些特性:
    ?
      1. 與Oracle緊密集成,并與集群一起使用(并行服務器)。
      2. 自動使用新的存儲,作為磁盤單元或磁盤組來管理。
      3. 支持成千上萬的磁盤。
      4. 文件不會名字,并會在操作系統中隱藏起來。
    ?
    ?
    誰需要它?
    ?
      現在快速瀏覽一下上面那些問題和解決方案會幫助你確定誰需要ASM。起初,它是用來處理現在很大型的聯機數據庫。所以如果它包括你的商店,那么你可能已經在關注它了,或者開始執行ASM。如果你的數據庫較小,數據文件也不多,那么你可能需要再一些理由使你考慮采用它。
    ?
      1. 你將要熟悉一些新技術,并且應該從在你的開發環境中建立它開始,并測試幾個月。
      2. 如果你想從你現有的磁盤子系統中獲得更高的性能,并獲得更好的統計用于預測磁盤I/O。
      3. 如果你正在使用RAC,那么就需要考慮ASM了。
    ?
    ?
    開始
    ?
      ASM是由一個實例管理,非常類似于Oracle數據庫。但是初始參數是非常有限的,而且啟動過程也簡單得多。
    ?
      a. 將你的ORACLE_SID設置為+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. 創建磁盤組
    ?
      SQL> create diskgroup SEAN disk '/dev/cciss/c0d0p1';
    ?
      e. 檢查表空間的創建
    ?
      你可能會猜測,創建一個表空間會有輕微的改變。默認方法如下所示:
    ?
      SQL> create tablespace sean_space datafile '+SEAN' size 1GB;
    ?
      不過想一下這個很好的特性。如果在你的數據庫中init.ora文件你設置參數為:
    ?
    ??? db_create_file_dest=+SEAN
    ?
      那么你可以這樣做:
    ?
      SQL> create tablespace sean_space;
    ?
      然后讓Oracle做其余的工作。在這兩種情形下,你將發現在v$datafile中列出的文件路徑是和抽象的+SEAN 磁盤組有關,而不是與一個實際的操作系統數據文件。
    ?
      f. 更多的
    ?
      當然簡化文件名稱和表空間的創建只是ASM可以為你做的工作的冰山一角。它還可以提供一個冗余級別。
    ?
      在數據庫方面,外部冗余能力主要是當你在硬件級別(RAID)上或Oracle可以看到的其它外部方法中具有冗余。換句話說,如果asm_diskstring設備是它們自己的邏輯,隱藏物理磁盤于一些冗余的硬件層后面,那么你就會有外部冗余能力。
    ?
      但是,如果你沒有這個冗余能力,那么ASM可以提供。你可以指定冗余、失敗組和一組其它的選項來防止損失一個或多個磁盤、控制器或甚至是整個SAM失效。ASM還提供了在磁盤組中均勻分布的I/O。因為ASM很好的了解背后發生了什么,所以Oracle可以自動的為你提供I/O到磁盤的一個更好的平衡。
    ?
    ?
    使用ASM遇到的挑戰
    ?
      ASM當然是一個具有很大潛能的強大技術。但是對于每一個技術解決方案,都會有很多的挑戰。對于ASM,它潛在地破壞了Unix系統管理組和數據庫/數據庫管理員組間力量的普通平衡。以前的組管理磁盤、硬件和操作系統級別,使數據庫管理員與它們協作獲取新的資源。這將在某種程度上挑戰這個平衡,而這會引起一些來自于這個組的阻力。
    ?
      最后,應該是業務需求促使了它的采用。還要注意到ASM仍然是處于企業計算認識階段,相對還比較新。有一些供應商他們的核心業務已經放在邏輯空間管理器/文件系統空間中很多年了。一般來說,對于軟件系統和可靠性來說成熟是很重要的。
    ?
    ?
    總結
    ?
      ASM很強大,它為目前部署的不斷發展的大型數據庫系統提供了解決方案。它還可以為較小數據庫安裝或者那些使用集群的數據庫提供解決方案。如同對于任何新技術一樣,評估、測試,然后更多的測試。
    ?
    ?
    ?
    ?
    再轉一篇ASM的配置文章
    ********************************************************************************************
    ?
    配置Oracle 10g ASM磁盤

    總結一下ASM的磁盤創建過程
    此次實驗是基于CentOS 4.6系統的實驗,
    ?
    1.首先,我需要在Oracle的網站上download的一些ASM的lib包
    http://www.oracle.com/technology/tech/linux/asmlib/install.html
    因為自己實驗的環境是基于Linux的,而且是RHEL AS 4所以會根據當前的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的軟件對他們分別進行安裝
    [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%]
    并且創建相應的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相關的一些.o的驅動.并且mount上asm的文件系統
    ?
    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.創建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]
    這里出現錯誤的原因是由于我們還沒有對/dev/sdb這個設備文件所加載的磁盤進行分區,而且sdb也不是一個partition
    因此我們先對sdb磁盤進行分區
    [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.
    ?
    這個時候系統中會出現一個sdb1這個設備文件
    ?
    之后我們繼續對sdc,sdd,sde以上面同樣的方法來進行分區。
    ------------------------------------------------------
    重新創建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環境中呢,如果在一個節點添加了ASM磁盤,在其他節點上要用過scandisks命令來獲得這種變化。
    如:
    [root@orahost01 dev]#/etc/init.d/oracleasm scandisks
    Scanning system for ASM disks: [? OK? ]
    ?
    就此ASM環境的物理基礎就已經搭建成功.
    ?
    其他OS類似于此,很簡單,只要按照這個思路走就可以了:)
    ?
    ********************************************************************************************
    ?
    ?
    posted on 2009-07-16 23:05 decode360 閱讀(1480) 評論(0)  編輯  收藏 所屬分類: 07.Oracle
    主站蜘蛛池模板: 日韩精品亚洲专区在线影视| 亚洲午夜久久久精品影院| 亚洲黄色网站视频| 羞羞漫画小舞被黄漫免费| 香蕉97超级碰碰碰免费公| 亚洲综合精品香蕉久久网97| www在线观看播放免费视频日本| 国产福利在线观看免费第一福利| 亚洲精品无码mv在线观看网站 | baoyu777永久免费视频| 在线A级毛片无码免费真人| 亚洲jjzzjjzz在线观看| 最近免费中文字幕高清大全| 亚洲邪恶天堂影院在线观看| 最新国产乱人伦偷精品免费网站| 亚洲人成无码网WWW| yy一级毛片免费视频| 中文字幕亚洲一区| 你懂的免费在线观看| 亚洲一区影音先锋色资源| 免费无遮挡无码永久视频| 亚洲小说图片视频| 无人在线观看免费高清视频| 中文字幕a∨在线乱码免费看| 国产jizzjizz免费视频| 牛牛在线精品免费视频观看| 免费一级毛片不卡不收费| 久久亚洲AV成人无码国产电影| 日批日出水久久亚洲精品tv| 四虎精品免费永久免费视频| 亚洲AV无码一区二区乱孑伦AS| 91成人免费观看| 精品国产亚洲AV麻豆| 久久精品国产亚洲一区二区| 亚洲午夜免费视频| 亚洲精品无码久久久久APP | 美女露隐私全部免费直播| 国产成人综合亚洲AV第一页| 性xxxxx免费视频播放| 一级毛片正片免费视频手机看| 亚洲高清不卡视频|