91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Oracle RAC之:ASM概念及基本操作維護

發布時間:2020-08-14 06:45:40 來源:ITPUB博客 閱讀:268 作者:不一樣的天空w 欄目:關系型數據庫
Oracle RAC系列之:ASM基本操作維護

ASM(自動存儲管理)是一個專門為Oracle數據庫服務的數據文件存儲機制,通過ASM管理數據文件,DBA不用再擔心I/O性能問題,也不需要知道文件的名稱,同時ASM也提供了文件系統到卷管理器的集成,下面依次介紹。
一、 ASM的特點
(1)自動調整I/O負載
ASM可以在所有可用的磁盤中自動調整I/O負載,不但避免了人工調整I/O的難度,而且也優化了性能,同時,利用ASM可以在線增加數據庫的大小,而無需關閉數據庫。

(2)條帶化存儲
ASM將文件分為多個分配單元(Allocation Units, AU)進行存儲,并在所有磁盤間平均分配每個文件的AU。

(3)在線自動負載均衡
當共享存儲設備有變化時,ASM中的數據會自動均勻分配到現有存儲設備中。同時,還可以調節數據的負載均衡速度。

(4)自動管理數據庫文件
在ASM存儲管理中,Oracle數據文件是ASM自動管理的。ASM創建的任何文件一旦不再需要,就會被自動刪除。但是,ASM不管理二進制文件、跟蹤文件、預警日志和口令文件。

(5)數據冗余
ASM通過磁盤組鏡像可以實現數據冗余,不需要第三方工具。

(6)支持各種Oracle數據文件
ASM存儲支持Oracle數據文件、日志文件、控制文件、歸檔日志、RMAN備份集等。

二、ASM的體系結構與后臺進程
圖1顯示了ASM的物理構成。
  Oracle RAC之:ASM概念及基本操作維護dNsXL+0e9ff2I3+1DrX5+5+69fKGouF02xRmXDQBcsCyHwqM448ovgBf1oY1HcSzA2baoj24Mitfq5y6XC6PMtqWzq7u8f6SsOQbFf9/8487de+wXGnDxj8RManZOWXMMis88S3GVSIETULxkH4PiXPVR4BA+lLYHBoeUNcegOM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YziMlRWtw1Yw5Hod3/pgBEozo+ci5M99LSl6Rhup1xpfEYjnjJSDuPzm1SfyReK1A2E1iQlPbihPcXQ9ruK01nZxgNUvHdyxgLF+bnGilu+UGzsFeI3sWTobiBvadqd2C/OjwPFgeZAcaA5UBxoDhQHmqO/4pgKq835tLfv7bmtrDkGxaem44wTqgN28oWiOTyisjnViqdm554mZtgvNODi5eLKo8dPlDXHoDimpW1zJsKTKn3jmZlW8cSNwDnU6ucdHbdULp3AozjS8bZF8YSGFpfilaMvnV3dmH+5Dent6/+4vaeyRbaFUDDobEPUh4CLUfFa/fxvd/+OZ0DtQ3n/aGBwSP2q4ZyLEn6uWr19/Rh4tgO1+vnA4JDiFIVgXlqWCogfStvsnwH4eVD8/n3zD5bW+RcIrxx9MX8dQYFFV968e88Vvwl+xa2zi1r9fGo63tnVvZxdRZlFG3Kv3/b29Y+OjavPv2UcoThR3j+aCE+6XK7RsfHl7Gq+UEQCc7P4uL2XLxRzr9/ef/DQ5XLdf/CQMXgLHKQ4Uaufv3n3fiI8aQ6PDAwOGfi6OV+9ff3m8Aj9Jqlzln53nOIAXC9QHGgOFAeaA8WB5kBxoDlQHGgOFAeaA8WB5vxH8aeJGVoUAQDNeP7i1chvvxkjv/0GgK7885//NP6NL3xp/fX/2/xgV8ufZfwAAAAASUVORK5CYII=">
         從圖1可以看出,第一部分是頂層的ASM磁盤組,ASM實例和數據庫實例可以直接訪問這些磁盤組;第二部分是ASM文件,每個ASM文件只能包含在一個磁盤組中,不過,一個磁盤組中可以包含屬于多個數據庫的多個ASM文件,并且單個數據庫可以使用來自多個磁盤組的存儲空間;第三部分是ASM磁盤,多個ASM磁盤組成了ASM磁盤組,但每個ASM磁盤只能屬于一個磁盤組;第四部分是AU(分配單元),AU是ASM磁盤組分配的最小連續磁盤空間,ASM磁盤按照AU進行分區,每個AU的大小默認為1MB;這個結構的底層是Oracle數據塊,由于AU是ASM分配的最小連續磁盤空間,因此,ASM是不允許跨分配單元拆分一個Oracle數據塊的。
          要使用ASM,需要在啟動數據庫實例之前,先啟動一個名為“+ASM”的實例,ASM實例不會裝載數據庫,啟動它的目的是為了管理磁盤組和保護其中的數據。同時,ASM實例還可以向數據庫實例傳遞有關文件布局的信息。通過這種方式,數據庫實例就可以直接訪問磁盤組中存儲的文件。圖2顯示了ASM的一般體系結構。
 Oracle RAC之:ASM概念及基本操作維護cDnlpFPbfPo0SO4042JiWFWNXK5/OjRo6wj4TBSM5OQQn0C/+23rPX09BgMhn379qnVaghvTEzM0aNHmQXQ2qWa1zZOVRdpxmZlZT22Ql5enpwBRVH79++3eAz8zfyjq6uLpumamhr475kzZ2pqahQKxYYNG86cOZOYmHjmzBmapru6usrLy/Py8pYtWwbf3bBhg0KhOMOgpqZm//79eXl5cDYOCgoKIFDcL3iRnlKOU8nNYB1w7949uVyel5cH17xhwwb4Y9myZfv371coFPBfmqYfP34MJQr+OHPmDITXaDSSSIAT0jSdl5dHAl5eXl5TU5OXl7d///579+5xhx2aU9wveNXV1UH8bN26lftsjx8/rqmpgVBDipD9YF9WWtA0DWEh+zds2JCYmEjTNMQMHFNTU3PmzBmIB6PRuH///mXLltXU1MAxeXl5GzZskMvliYmJ8PUNz5DL5Rs2bIDYZrF161bmna/E1UU6zY4cOcIKCGQeiBwS0q6uLrlcvmzZMsgkBFLFkz0KhaK8vBzKGjNRjEZjV1cXZEuS35j5FuKWGdtkZ78lDuB5ywg9pePGjbN2HsfGQE1NzbJly86cOXPv3r39+/fv379/w4YNRqMRyiAEzc4YuH37dr+3jHxqm8fP6kxS6IDExES5XM6qdeHyli1blpiYCHtqamqgoEEl85hHWYM/FAoF1MnMsCsUCvgvx9Wyahunqqu2ttZaESLQNM2MNWbUEM6cOWOurmXLlpHK+vEzdcHBoK4NGzZAcYIaGepx5g9B3JEsBfFr/ussGhoaIFDcq2PAklRjx461dp79+/czMxBYyjwTk3qZqAuKGanBmdcMtT/8CyUKjmeVSTgnyVLMQsUddng4JJPJOAJOZtA4fvw499ngIqFsQKCY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sfogDlw4EB0dDTkvQG91wXqamxszMzMfOONN8QOx4Dp7e2dMmVKY2MjhB3mb+SpLqht4F5Z7HAMmDfeeGPv3r0Q6nXr1klIXWfOnJk2bVppaanYUTQAGhoapkyZcufOHXjHe0CzaZDM1NTUVFBQMHv27Dt37ogdIL48fvwYchJ5v53MQstfXZDoNE1XVlaKHaABUFNTYzHRXVFdjY2Ner3e39+/oaFB7HgdAKWlpeHh5b29vZAEA5pNg6irqanp7bffjo2NdaG7xjt37syePfv48eOk3A1UXU1NTYcOHaJp2rVqm9WrV69bt46EWlrqampqOnv2bHh5eFRUVG9v7/+TPO+8886kSZNu375NZtb64osvbFPX+fPn9+zZM2LEiJqaGrGD1T8XL14cN25cUVERc1Yx29TV1NR06tQpmqbfeOMN6Sf6d999t3bt2ldeecVioruoupqamj788MOxY8euXbv2u+++EzuO+6G3t/eNN95YunRpb28vSQIyjeRA1XX+/PmkpKQJEyY0NDSIHbL+qampGTduHGsuUxvURWqb0tJSscPUPx0dHdOnT2dN2L127Vppqev8+fPNzc2bN28eMWLExx9//P9JlcuXL9M0bb5sxKVLl2xW1/nz5z/77DOoxL/99luxg2iVLVu2TJo0yXwBBZvVBYkOE6CdO3dO7PBZ5fLly+PGjeNIdNdVFyRBfHz89OnTL1++LHZMW+XcuXMjR47cs2cPKwnI2h82qKu5uflPf/rTxIkTt2zZInb4rPL999+vXLnylVde6erqYoXdNnVBbRMeHi7x2qaoqGjcuHGnTp1ihVqi6rpw4QLMjrVmzZq7d++KHXv/wvfff79jx45Jkybp9XrzNdDa29vtUReEHSrx48ePix1WNkajcfbs2UlJSV9//bV52JcsWWKPui5cuFBRUTF27FgJJvq3336r0WjGjRtncYlCkuiurq4LFy689957o0aN0mg0UqvO7t69u2bNmkmTJl27do1j7UHb1NXc3NzQ0PDGG2/QNP3ZZ5+JHVY2x48fHzduXH5+vsV1F2F5WxvURWqbF1988b333hM7lGygtlm+fLnF2uadd96RqLouXLjQ0tKSnJz861//+o033rhx48ZTsenr69uxY4ePj8/KlStv3Lhx3xKff/65/epqaWk5duzYjBkzJkyYcPToUbHD/fTp06eNjY2RkZFjx46tqKiwGPD79+8vXrzYTnW1tLSQRAeBiR3up319fRqNxsfH5+2337537x53oruBulpaWs6dO7dixYpf//rXGo2mr69P7BR4CtLy8fH54x//aC3vVVVV2akuCHtZWVlgYOD06dNPnz4tdrifPn369MMPP5wwYcLcuXPPnz9vLex2qqulpeXkyZMKhQIEJnaInz59+rS1tbXf2ubtt9+WtLouXrzY1NSUlZX1wgsvgMD+Kgb379+H+mvlypWdnZ191iEzsdqprosXLxqNxqNHj7766quQpUQJ+F//+te6uroZM2YEBgYeOnSII+B9fX2OUhckekpKikQS/e233+7u7uaT6O6hLkgCg8Hw1ltvvfDCC2vWrOnp6RElCXp6ekBamzdv7unp4UiCjz76yCHqgnK3f//+wMDAGTNm1NXViRLwv/71rzqdbsKECXPmzDEYDNzlzn51Qairq6sjIiJefPHFsrIysULd1tY2f/78sWPH9lvbuIC6jEZja2trW1tbdnb2Cy+8MGHChIKCgs7Ozr8Jz4MHD8rKyubPn+/l5ZWWlnb9+vVv+4Ms/ewQdUHYa2pq5s2b98tf/jIuLk6n0/35z392QtibmpqSkpJGjx4dEhLy0Ucf9Rvwb7/91oHqgoA3NzdDotM0XVBQcOPGDScE/N69e3v37p0/f/7QoUMHmujupC5IgrNnz6alpf3yl78MCwvbu3fvvXv3nJAEN27cKCgomDFjhpeX1+bNm+/evdtvEjhWXa2tra2trSUlJZMmTXrxxReTkpIMBoMTAv63v/1Np9OtWrXKy8trzpw5dXV1fMpdSEiIQ9TFrG2ee+65uLi48vJy59Q2bW1t69atGz169NixY99//30+oU5LS3MZdX3++eft7e1/+tOfoqOjf/vb344ePTopKamtrc3h8UhKztChQ+ENuDt37vTyw2g0OlxdEPbTp09v2rRp5syZzz333Pz588vKyh58eODYgP/5z3/W6XRxcXFeXl6BgYGbNm1qbGzkGfDe3t6oqCjHqosk+uHDh7Ojo1944YXRo0evW7dOiETv7O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y7EYGBWcBywNfhSqE8lkEo7BX4dvwfa6BUP8SEgXIqTLmIASwLYmWYHZYsh+8GBMicB8sJoHQx0+ghwO8irYgMPQHCC+hG2w31wuB3qmqfvBr2isrGTBkP/WWus+thtCuhqEqqqEEOsqhBD94j0QIdjWRItQ92Cr0hWLxSA9ApMA5aOUQmGEXy6IpXbGWKFQyOVykE7xZXcsXzBRMKwJIV3GBNcT4XSU5gAIIsGyQLrYarSHaoTSBSoFSoNV90wmAzKGywU11UgIFjUFDJg/A2utvGAodItHSFeDgBgNBygvMAgfr+EG5FL8fhjZEA9iyIZn8/l8vCiCveHKKFyUiCeklPKLo0TBsAaEdBkQLJUDsDJWv8wd1y6hdMGcNAaLfMEQLQ5K8fyiJwwQ8eu8rcF/8fhQKASSxiouGArd0iCkqxHoK9QwvhljqqqCcoCeabIutmqBOOhRutCEYMTHYjGYPwOTQ/XC+gOcUC91AOyHKopmp6YtUM2HhVvJZFI85syEdBkSLLYjED7CR7yeQbUcpQuORANcS7pgkQXYGj9DxlaNC0+Ic1q8NeVyOSiTVFIwhBQNZVg86cyEdDWGWCymsSLGGAx9qEtAZYOfN9Y8d8Vvg1pAigbWiCs4oHbBr9NdV7qwdgGRoKZg6PP5NHYCC64Qfbu2IUK6DAisWuL34BQvxIhQQsRUJhQKYaEvFovxGRIOcmV1AT3U+qBuD3UR/ZMnZaQLLFdRlFAoBFamWc3BXzY8/cIjVhgyIV2tS6FQAMuE6SswgFAoBOIHKzWk9eDDPY0mCTupHCFd2wRKKb4+A5f1QtKGz02ua3T8CUHz9IhixroI6dqaiJJCIxHSJWBrvztUsBkI6RIINoqQLoGgwQjpEgg2ipAugaDBCOkSCDaKkC6BoME0SLqePHnyP4Fgi/LkyZMGGFFV/Pvvv82+KwLBJvLPP//8H3BV4xRgXNdJAAAAAElFTkSuQmCC">
 
         從圖2可以看出,ASM實例與數據庫實例進行通信的橋梁是ASMB進程,此進程運行在每個數據庫實例上,是兩個實例間信息交換的通道。ASMB進程先利用磁盤組名稱通過CSS獲得管理該磁盤組的ASM實例連接串,然后建立一個到ASM的持久連接,這樣兩個實例之間就可以通過這條連接定期交換信息,同時這也是一種心跳監控機制。
         另外,在ASM實例中還存在另外一個新的進程,即RBAL,此進程負責規劃和協調磁盤組的重新平衡活動。除此之外,ASM實例還有一些與數據庫實例中的進程相同的后臺進程,例如LGWR、SMON、PMON、DBWR 、CKPT等。
如果一個數據庫實例使用ASM作為存儲,那么它將多出兩個后臺進程,即RBAL和ASMB。RBAL 負責打開磁盤組中所有磁盤和數據,而ASMB負責和ASM實例進程通信。

三、管理ASM實例
 在使用ASM作為數據存儲時,ASM實例管理顯得非常重要,Oracle提供了豐富的管理功能,對ASM實例進行管理需要具備SYSDBA權限,在Oracle 11g中可以使用一個新角色 ,即SYSASM,此角色只用于管理ASM實例。

1.創建ASM實例
創建ASM實例有兩種方法,第一種是利用dbca創建,這種方法只需運行Database Configuration Assistant(DBCA),然后根據提示即可創建一個ASM實例,此種方式在前面已有講述,這里不再多說。第二種方法是用命令行方式創建ASM實例,下面進行簡單介紹。

(1)創建ASM磁盤
可以使用RAID劃分的LUN、分區和裸設備等來創建ASM磁盤,但是在使用LUN、分區或裸設備時,要注意將屬主和屬組改為Oracle用戶及其對應的組,這個在前面節已經講述過,另外一種簡單的方法就是使用Oracle提供的ASMLib來完成ASM磁盤的創建,下面將講述這種方法。

在創建ASM實例之前,首先應該確保節點上已經安裝了ASMlib包,同時確認ASMLib是否已經自動加載:
[root@node1 ~]# lsmod | grep oracleasm
oracleasm              46356  1

然后,通過ASMlib提供的oracleasm將已經劃分好的磁盤分區轉化為ASM磁盤,例如:
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMDISK1 /dev/sdc5
Marking disk "/dev/sdc5" as an ASM disk [  OK  ]
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMDISK2 /dev/sdc6
Marking disk "/dev/sdc6" as an ASM disk [  OK  ]
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMDISK3 /dev/sdc7
Marking disk "/dev/sdc7" as an ASM disk [  OK  ]
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMDISK4 /dev/sdc8
Marking disk "/dev/sdc8" as an ASM disk [  OK  ]
[root@node1 ~]#/etc/init.d/oracleasm createdisk ASMdisk5 /dev/sdc9
Marking disk "/dev/sdc9" as an ASM disk [  OK  ]

創建完ASM磁盤后,可以查看系統的/dev/oracleasm/disks/目錄下是否已經生成磁盤設備,可以采用的命令如如下:
[root@node1 ~]# ll /dev/oracleasm/disks/ASMDISK*
brw-rw---- 1 oracle oinstall 8, 21 Sep 10 23:40 /dev/oracleasm/disks/ASMDISK1
brw-rw---- 1 oracle oinstall 8, 22 Sep 10 23:40 /dev/oracleasm/disks/ASMDISK2
brw-rw---- 1 oracle oinstall 8, 23 Sep 10 23:36 /dev/oracleasm/disks/ASMDISK3
brw-rw---- 1 oracle oinstall 8, 24 Sep 10 23:40 /dev/oracleasm/disks/ASMDISK4
brw-rw---- 1 oracle oinstall 8, 25 Sep 10 23:40 /dev/oracleasm/disks/ASMDISK5

也可以通過如下方式查看:
[root@node1 ~]#service oracleasm listdisks
ASMDISK1
ASMDISK2
ASMDISK3
ASMDISK4
ASMDISK5

如果要刪除 ASM磁盤可通過以下命令:
[root@node1 ~]#./etc/init.d/oracleasm deletedisk ASMDISK5
Removing ASM disk "ASMdisk5" [  OK  ]

在RAC環境中,要注意另外一個節點是否能夠發現對應的ASM磁盤,執行如下命令,讓另外一個節點來獲取這種變化。
[root@node2 ~]#/etc/init.d/oracleasm scandisks
到此位置,ASM磁盤已經創建完畢了。

(2)初始化參數
啟動ASM實例只需要如下幾個參數即可,利用這些參數可以實現ASM實例的內存的自動分配和自動管理。
下面介紹ASM實例初始化參數:
instance_type=asm
cluster_database=true
DB_UNIQUE_NAME=+ASM
ASM_POWER_LIMIT=1
large_pool_size=60M
asm_diskgroups='FLASH_DISK','ARCH_DISK','DATA_DISK'
asm_diskstring='/dev/oracleasm/disks/*'
每個參數的含義如下:
? instance_type,指定實例的類型,對于ASM實例,應設置為ASM
? cluster_database,指定是否是數據庫集群,true表示是ASM集群
? DB_UNIQUE_NAME,指定ASM實例的名稱,默認是+ASM
? ASM_POWER_LIMIT,該參數用來控制ASM中數據的負載均衡速度
? large_pool_size,設置大池的大小,由于ASM文件的分配單元映射是從large_pool分配的,因此large_pool_size至少要8MB,                                   建議越大越好
? asm_diskgroups,指定實例啟動時可用的ASM磁盤組,ASM實例將在啟動時自動掛載這些磁盤組
? asm_diskstring,用于限制ASM實例可用于創建磁盤組的磁盤設備。如果該值為NULL,則ASM實例可見的所有磁盤都可以成為創建磁盤組的可選磁盤

(3)創建密碼文件
[oracle@node1 ~]$su - oracle
[oracle@node1 ~]$ cd $ORACLE_HOME/dbs
[oracle@node1 ~]$ orapwd file=orapw+ASM password=oracle

(4)創建目錄結構
[oracle@node 1~]$su – oracle
[oracle@node1 ~]$cd $ORACLE_HOME/dbs
[oracle@node1 ~]$mkdir –p $ORALCE_BASE/admin/+ASM/udump
[oracle@node1 ~]$ mkdir –p $ORALCE_BASE/admin/+ASM/bdump
[oracle@node1 ~]$mkdir –p $ORALCE_BASE/admin/+ASM/adump
[oracle@node1~]$ mkdir –p $ORALCE_BASE/admin/+ASM/cdump

2.啟動ASM實例
 無論在RAC環境中還是單實例環境,ASM實例都需要用到CSS進程,在RAC環境中,啟動CRS后CSS已經運行,而在單實例環境下,需要以root用戶運行腳本,初始化CSS服務,否則,在啟動ASM實例時會報如下錯誤:
ORA-29701: unable to connect to Cluster Manager
執行初始化腳本的過程如下:
[root@node1 ~]#$ORACLE_HOME/bin/localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized
Cleaning up Network socket directories
Setting up Network socket directories
 Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
 Cluster Synchronization Services is active on these nodes.
        node1
Cluster Synchronization Services is active on all the nodes.
Oracle CSS service is installed and running under init(1M)

然后啟動ASM實例:
[oracle@node1 ~]$export ORACLE_SID=+ASM
[oracle@node1 ~]$sqlplus / as sysdba
SQL> startup
ASM instance started
Total System Global Area    134217728 bytes
Fixed Size                   1218124 bytes
Variable Size               107833780 bytes
ASM Cache                   25165824 bytes
ORA-15110: no diskgroups mounted
因為首次啟動ASM實例并沒有創建ASM磁盤組,所以顯示 15110錯誤是正常的。
 
3.管理ASM磁盤組
 ASM磁盤組是作為邏輯單元進行統一管理的一組磁盤,在ASM實例中,可以創建和添加新的磁盤組,可以修改現有的磁盤組,在其中添加一個磁盤或者刪除一個磁盤,也可以刪除現有的磁盤組。

(1)添加磁盤組
SQL> create diskgroup FLASH_DISK external redundancy disk '/dev/oracleasm/disks/ASMDISK1' name flashdisk;
Diskgroup created.
SQL> create diskgroup ARCH_DISK external redundancy disk '/dev/oracleasm/disks/ASMDISK2' name archdisk1;
Diskgroup created.
SQL> create diskgroup DATA_DISK normal redundancy disk '/dev/oracleasm/disks/ASMDISK4' name datadisk1, '/dev/oracleasm/disks/ASMDISK5' name datadisk2;
Diskgroup created.

(2)查看磁盤組狀態
SQL> select name,state from v$asm_diskgroup;
NAME                           STATE
-------------------       --------------
FLASH_DISK                   MOUNTED
ARCH_DISK                   MOUNTED
DATA_DISK               MOUNTED

(3)卸載FLASH_DISK磁盤組
SQL> alter diskgroup FLASH_DISK dismount;
Diskgroup altered.
SQL> select name,state from v$asm_diskgroup;
NAME               STATE
---------------------------  -----------
FLASH_DISK         DISMOUNTED
ARCH_DISK          MOUNTED
DATA_DISK          MOUNTED

(4)掛載FLASH_DISK磁盤組
SQL> alter diskgroup  FLASH_DISK mount;
Diskgroup altered.
SQL> select name,state from v$asm_diskgroup;
NAME                STATE
------------------------------  -----------
FLASH_DISK      MOUNTED
ARCH_DISK        MOUNTED
DATA_DISK     MOUNTED

(5)查看磁盤名與裸設備對應關系
SQL>  select name,path from v$asm_disk_stat;
NAME                             PATH
-------------------         --------------------------------------
 DATADISK3                     /dev/oracleasm/disks/ASMDISK3
DATADISK2                      /dev/oracleasm/disks/ASMDISK5
DATADISK1                      /dev/oracleasm/disks/ASMDISK4
ARCHDISK1                      /dev/oracleasm/disks/ASMDISK2
FLASHDISK                      /dev/oracleasm/disks/ASMDISK1

(6)查看每個磁盤組的可用大小
SQL> select name,allocation_unit_size,total_mb from v$asm_diskgroup;
NAME      ALLOCATION_UNIT_SIZE      TOTAL_MB
------------------ --------------------------------    ----------
FLASH_DISK  1048576          3815
ARCH_DISK  1048576          3815
DATA_DISK   1048576           954

(7)向磁盤組中增加一個磁盤
SQL> ALTER DISKGROUP ARCH_DISK ADD DISK '/dev/oracleasm/disks/ASMDISK3' name ARCHDISK2;

Diskgroup altered.

查看每個磁盤組的可用大小
SQL> select name,allocation_unit_size,total_mb from v$asm_diskgroup;
NAME       ALLOCATION_UNIT_SIZE   TOTAL_MB
------------------- -------------------------------   ----------
FLASH_DISK  1048576         3815
ARCH_DISK  1048576         4292
DATA_DISK  1048576          954

SQL> select name,path from v$asm_disk_stat;
NAME                            PATH
-------------------       ----------------------------------------
DATADISK3                      /dev/oracleasm/disks/ASMDISK5
DATADISK1                       /dev/oracleasm/disks/ASMDISK4
ARCHDISK2                       /dev/oracleasm/disks/ASMDISK3
ARCHDISK1                       /dev/oracleasm/disks/ASMDISK2
FLASHDISK                       /dev/oracleasm/disks/ASMDISK1
可以看出,磁盤組ARCH_DISK的大小發生變化了,表明添加磁盤成功

(8)從磁盤組中刪除一個磁盤:
SQL> ALTER DISKGROUP ARCH_DISK DROP DISK ARCHDISK2;
Diskgroup altered.

(9)刪除一個磁盤組:
SQL> drop diskgroup  FLASH_DISK;
Diskgroup dropped.
當有數據庫使用ASM的磁盤組時,是無法卸載和刪除這個磁盤組的。ASM實例如果宕掉,那么使用ASM的數據庫實例也會宕掉。在RAC環境中,在刪除一個磁盤組之前,其他節點的ASM實例必須要將這個要刪除的磁盤組卸載。

4.關閉ASM實例
關閉ASM實例的命令和關閉數據庫實例的命令相同,但只有在沒有任何數據庫實例連接到該ASM實例的情況下,才能正常關閉ASM實例,如果至少有一個數據庫實例與之連接,會提示以下錯誤:
ORA-15097: cannot SHUTDOWN ASM instance with connected RDBMS instance
此時,如果對該ASM實例強制執行SHUTDOWN ABORT命令,那么ASM實例將被關閉,任何與之連接的數據庫實例最終也將自動關閉,同時報以下錯誤:
ORA-15064: communication failure with ASM instance
ASM實例被強制關閉后,在下次啟動時,會要求進行恢復。

5.  ASMCMD命令
Oracle在10g版本中提供了ASMCMD命令,通過這個命令可以管理存儲在ASM磁盤中的數據。下面簡單介紹ASMCMD命令的使用方法。
在使用ASMCMD命令時必須啟動ASM實例,然后指定ORACLE_HOME和ORACLE_SID,例如:
[oracle@node-rac1 ~]$ export ORACLE_SID=+ASM1
[oracle@node-rac1 ~]$ asmcmd
ASMCMD>
還可以使用“asmcmd -p”,加上“-p”參數可以顯示當前路徑。
下面是ASMCMD提供的一些可用命令,其中oracle 11g新增的命令有cp、md_backup、md_restore。
ASMCMD> ?
        commands:
        --------
        help
        cd
        cp
        du
        find
        ls
        lsct
        lsdg
        mkalias
        mkdir
        pwd
        rm
        rmalias
        md_backup
        md_restore
        lsdsk
        remap

(1)切換目錄
ASMCMD> cd +DATA_DISK/RACDB

(2)列出目錄信息
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileracdb.ora

(3)查看磁盤空間信息
執行ASMCMD的 “du DATAFILE”命令查看磁盤空間信息,如圖3所示
 

(4)顯示ASM和數據庫實例連接情況
執行ASMCMD的“lsct”命令顯示ASM和數據庫實例連接情況,如圖4所示
 

(5)創建一個目錄
ASMCMD> mkdir test
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileracdb.ora
test/

(6)復制磁盤文件
將ASM磁盤文件spfileracdb.ora復制到test目錄下:
ASMCMD> cp spfileracdb.ora test
source +DATA_DISK/RACDB/spfileracdb.ora
target +DATA_DISK/RACDB/test/spfileracdb.ora
copying file(s)...
file, +DATA_DISK/racdb/test/spfileracdb.ora, copy committed.
ASMCMD> cd test
ASMCMD> ls
spfileracdb.ora

將ASM磁盤文件UNDOTBS1.258.728340289文件復制到操作系統某目錄下:
ASMCMD> cp UNDOTBS1.258.728340289 UNDOTBS1.dbf           
source +DATA_DISK/RACDB/DATAFILE/UNDOTBS1.258.728340289
target UNDOTBS1.dbf
copying file(s)...
copying file(s)...
copying file(s)...
copying file(s)...
copying file(s)...
copying file(s)...
file, /u01/oracle/product/11.0.6/rac_db/dbs/UNDOTBS1.dbf, copy committed.

(7)備份ASM的metadata
ASMCMD> md_backup  /u01/oracle/datadisk.bak -G data_disk
Disk group to be backed up: DATA_DISK
這樣就把ASM的metadata備份到了文件系統上,通過查看datadisk.bak文件可以得知metadata的組織信息。

(8)為ASM磁盤文件設置別名
執行如圖5所示的命令為ASM磁盤文件設置別名。


(9)在磁盤組查找文件
ASMCMD> find +DATA_DISK  sys*
+DATA_DISK/RACDB/DATAFILE/SYSAUX.257.728340287
+DATA_DISK/RACDB/DATAFILE/SYSAUX.dbf
+DATA_DISK/RACDB/DATAFILE/SYSTEM.256.728340285
+DATA_DISK/RACDB/DATAFILE/SYSTEM.dbf

(10)在磁盤組刪除文件
ASMCMD> rm -rf test
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

湾仔区| 寻甸| 景宁| 四子王旗| 务川| 鹿邑县| 平阴县| 慈利县| 涡阳县| 刚察县| 宁津县| 温宿县| 桦川县| 南宁市| 昭苏县| 吉安县| 延津县| 乐昌市| 华蓥市| 保山市| 易门县| 邵东县| 灵宝市| 永嘉县| 陵川县| 闻喜县| 鄂温| 玛曲县| 兴业县| 叙永县| 常宁市| 苏州市| 五常市| 云南省| 临沂市| 津南区| 遂宁市| 屏东县| 大安市| 土默特左旗| 永胜县|