一、 ASM(自動存儲管理)的來由:
ASM是Oracle 10g R2中為了簡化Oracle數(shù)據(jù)庫的管理而推出來的一項新功能,這是Oracle自己提供的卷管理器,主要用于替代操作系統(tǒng)所提供的LVM,它不僅支持單實(shí)例,同時對RAC的支持也是非常好。ASM可以自動管理磁盤組并提供有效的數(shù)據(jù)冗余功能。使用ASM(自動存儲管理)后,數(shù)據(jù)庫管理員不再需要對ORACLE中成千上萬的數(shù)據(jù)文件進(jìn)行管理和分類,從而簡化了DBA的工作量,可以使得工作效率大大提高。
二、 什么是ASM
ASM它提供了以平臺無關(guān)的文件系統(tǒng)、邏輯卷管理以及軟RAID服務(wù)。ASM可以支持條帶化和磁盤鏡像,從而實(shí)現(xiàn)了在數(shù)據(jù)庫被加載的情況下添加或移除磁盤以及自動平衡I/O以刪除“熱點(diǎn)”。它還支持直接和異步的I/O并使用Oracle9i中引入的Oracle數(shù)據(jù)管理器API(簡化的I/O系統(tǒng)調(diào)用接口)。
ASM是做為單獨(dú)的Oracle實(shí)例實(shí)施和部署,并且它只需要有參數(shù)文件,不需要其它的任何物理文件,就可以啟動ASM實(shí)例,只有它在運(yùn)行的時候,才能被其它數(shù)據(jù)訪問。在Linux平臺上,只有運(yùn)行了OCSSD服務(wù)(Oracle安裝程序默認(rèn)安裝)了才能和訪問ASM。
三、 使用ASM的好處:
1、 將I/O平均分部到所有可用磁盤驅(qū)動器上以防止產(chǎn)生熱點(diǎn),并且最大化性能。
2、 配置更簡單,并且最大化推動數(shù)據(jù)庫合并的存儲資源利用。
3、 內(nèi)在的支持大文件
4、 在增量增加或刪除存儲容量后執(zhí)行自動聯(lián)系重分配
5、 維護(hù)數(shù)據(jù)的冗余副本以提高可用性。
6、 支持10g,11g的數(shù)據(jù)存儲及RAC的共享存儲管理
7、 支持第三方的多路徑軟件
8、 使用OMF方式來管理文件
四、 ASM冗余:
ASM使用獨(dú)特的鏡像算法:不鏡像磁盤,而是鏡像盤區(qū)。作為結(jié)果,為了在產(chǎn)生故障時提供連續(xù)的保護(hù),只需要磁盤組中的空間容量,而不需要預(yù)備一個熱備(hot spare)磁盤。不建議用戶創(chuàng)建不同尺寸的故障組,因為這將會導(dǎo)致在分配輔助盤區(qū)時產(chǎn)生問題。ASM將文件的主盤區(qū)分配給磁盤組中的一個磁盤時,它會將該盤區(qū)的鏡像副本分配給磁盤組中的另一個磁盤。給定磁盤上的主盤區(qū)將在磁盤組中的某個伙伴磁盤上具有各自的鏡像盤區(qū)。ASM確保主盤區(qū)和其鏡像副本不會駐留在相同的故障組中。磁盤組的冗余可以有如下的形式:雙向鏡像文件(至少需要兩個故障組)的普通冗余(默認(rèn)冗余)和使用三向鏡像(至少需要3個故障組)提供較高保護(hù)程度的高冗余。一旦創(chuàng)建磁盤組,就不可以改變它的冗余級別。為了改變磁盤組的冗余,必須創(chuàng)建具有適當(dāng)冗余的另一個磁盤組,然后必須使用RMAN還原或DBMS_FILE_TRANSFER將數(shù)據(jù)文件移動到這個新創(chuàng)建的磁盤組。
三種不同的冗余方式如下:
1、 外部冗余(external redundancy):表示Oracle不幫你管理鏡像,功能由外部存儲系統(tǒng)實(shí)現(xiàn),比如通過RAID技術(shù);有效磁盤空間是所有磁盤設(shè)備空間的大小之和。
2、 默認(rèn)冗余(normal redundancy):表示Oracle提供2份鏡像來保護(hù)數(shù)據(jù),有效磁盤空間是所有磁盤設(shè)備大小之和的1/2 (使用最多)
3、 高度冗余(high redundancy):表示Oracle提供3份鏡像來保護(hù)數(shù)據(jù),以提高性能和數(shù)據(jù)的安全,最少需要三塊磁盤(三個failure group);有效磁盤空間是所有磁盤設(shè)備大小之和的1/3,雖然冗余級別高了,但是硬件的代價也最高。
五、 ASM進(jìn)程
ASM實(shí)例除了傳統(tǒng)的DBWR,LGWR,CKPT,SMON,PMON等進(jìn)程還包含如下四個新后臺進(jìn)程:
RBAL:負(fù)責(zé)協(xié)調(diào)磁盤組的重新平衡活動(負(fù)責(zé)磁盤組均衡)
ARB0-ARBn:在同一時刻可以存在許多此類進(jìn)程,它們分別名為ARB0、ARB1,以此類推,執(zhí)行實(shí)際的重新平衡分配單元移動進(jìn)程。
GMON:用于ASM磁盤組監(jiān)控
O0nn 01-10:這組進(jìn)程建立到ASM實(shí)例的連接,某些長時間操作比如創(chuàng)建數(shù)據(jù)文件,RDBMS會通過這些進(jìn)程向ASM發(fā)送信息
ASMB與ASM 實(shí)例的前臺進(jìn)程連接,周期性的檢查兩個instance的健康狀況。每個數(shù)據(jù)庫實(shí)例同時只能與一個ASM實(shí)例連接,因此數(shù)據(jù)庫只會有一個ASMB后臺進(jìn)程。如一個節(jié)點(diǎn)上有多個數(shù)據(jù)庫實(shí)例,它們只能共享一個ASM實(shí)例。
RBAL用來進(jìn)行全局調(diào)用,以打開某個磁盤組內(nèi)的磁盤。ASMB進(jìn)程與該節(jié)點(diǎn)的CSS守護(hù)進(jìn)程進(jìn)行通信,并接收來自ASM實(shí)例的文件區(qū)間映射信息。ASMB還負(fù)責(zé)為ASM實(shí)例提供I/O統(tǒng)計數(shù)據(jù)
CSS集群同步服務(wù)。要使用ASM,必須確保已經(jīng)運(yùn)行了CSS集群同步服務(wù),CSS負(fù)責(zé)ASM實(shí)例和數(shù)據(jù)庫實(shí)例之間的同步。
注意:ASM實(shí)例必須要先于數(shù)據(jù)庫實(shí)例啟動,和數(shù)據(jù)庫實(shí)例同步運(yùn)行,遲于數(shù)據(jù)庫實(shí)例關(guān)閉。ASM 實(shí)例和數(shù)據(jù)庫實(shí)例的關(guān)系可以是1:1,也可以是1:n。如果是1:n,最好為ASM 安裝單獨(dú)的ASM_HOME。
六、 ASM支持datafile,logfiles,control files,archivelogs,RMAN backup sets等自動的數(shù)據(jù)庫文件管理
七、 ASM實(shí)例和數(shù)據(jù)庫實(shí)例對應(yīng)關(guān)系
八、 Cluster ASM 架構(gòu)
如需了解更詳細(xì)信息請參見Oracle數(shù)據(jù)庫管理員指南(Oracle首次放出):
http://docs.oracle.com/cd/B28359_01/server.111/b31107/toc.htm
好了,現(xiàn)在開始談?wù)動嘘P(guān)于ASM安裝的相關(guān)內(nèi)容,ASM的安裝必須建立在操作系統(tǒng)和數(shù)據(jù)庫軟件已經(jīng)安裝完成的及實(shí)例未創(chuàng)建之前來進(jìn)行安裝,之后再進(jìn)行選擇ASM方式建庫。ASM不僅可以應(yīng)用于單實(shí)例的數(shù)據(jù)庫,同時更適用于RAC集群方式的數(shù)據(jù)庫,并且ASM只被Oracle所認(rèn),同時也是ORACLE最佳的存儲解決方案,可以有效的替代RAID技術(shù)和卷管理技術(shù),比裸設(shè)備的管理更加方便;所以現(xiàn)在大部分企業(yè)都在迅速的向ASM技術(shù)遷移。
在上面我們已經(jīng)探討過了ASM的三種模式,及其的一些應(yīng)用,在這里我們就不對其進(jìn)行過多的累述。正式進(jìn)入這篇的主題,如何安裝ASM軟件,安裝ASM需要具備哪些條件。
ASM安裝步驟:
一、基礎(chǔ)環(huán)境準(zhǔn)備
1、 檢查操作系統(tǒng)和數(shù)據(jù)庫軟件是否安裝完成:
Installation in progress (Mon Apr 09 19:12:44 CST 2012)
............................................................... 18% Done.
............................................................... 36% Done.
............................................................... 54% Done.
............................................................... 73% Done.
............ 76% Done.
Install successful
Linking in progress (Mon Apr 09 19:19:34 CST 2012)
Link successful
Setup in progress (Mon Apr 09 19:23:13 CST 2012)
.............. 100% Done.
Setup successful
End of install phases.(Mon Apr 09 19:23:26 CST 2012)
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/oracle/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts
/oracle/orahome/10.2.0/db_1/root.sh
need to be executed as root for configuring the system. If you skip the execution of the configuration tools, the configuration will not be complete and the product wont function properly. In order to get the product to function properly, you will be required to execute the scripts and the configuration tools after exiting the OUI.
The installation of Oracle Database 10g was successful.
從如上信息我們可以看到數(shù)據(jù)庫已經(jīng)安裝完成,操作系統(tǒng)肯定也是沒有問題的。
2、 檢查數(shù)據(jù)庫和操作系統(tǒng)版本:
[oracle@ jb51.net db_1]$ lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.4 (Carthage)
Release: 5.4
Codename: Carthage
[oracle@ jb51.net db_1]$
[oracle@ jb51.net db_1]$ uname -a
Linux wwl 2.6.18-164.el5 #1 SMP Thu Sep 3 02:16:47 EDT 2009 i686 i686 i386 GNU/Linux
操作系統(tǒng)版本為5.4 X86,內(nèi)核版本為2.6.18-164.el5,后面下載ASM包必須要對應(yīng)
[oracle@ jb51.net db_1]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Apr 9 19:41:54 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
數(shù)據(jù)庫版本是10.2.0.1.
3、 我們已經(jīng)知道了這些信息后,我們就可以有針對性的下載ASM了:
ASM下載地址,版本不一樣,用的ASM包也不一樣:
http://www.oracle.com/technetwork/server-storage/linux/downloads/rhel5-084877.html
找到Intel IA32 (x86) Architecture系列中的這個包下載下來:
Drivers for kernel 2.6.18-164.el5
· oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
· 以及如下兩個包下載下來就可以了:
Library and Tools
· oracleasm-support-2.1.7-1.el5.i386.rpm
· oracleasmlib-2.0.4-1.el5.i386.rpm
·
4、 下載完了之后開始安裝asm的rpm包,用root用戶安裝,注意安裝順序,如下:
[root@wwl asmpark]# ls
oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
oracleasmlib-2.0.4-1.el5.i386.rpm
oracleasm-support-2.1.7-1.el5.i386.rpm
[root@wwl asmpark]# rpm -ivh oracleasm-support-2.1.7-1.el5.i386.rpm
warning: oracleasm-support-2.1.7-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-support ########################################### [100%]
[root@wwl asmpark]# rpm -ivh oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm
warning: oracleasm-2.6.18-164.el5-2.0.5-1.el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasm-2.6.18-164.el########################################### [100%]
[root@wwl asmpark]# rpm -ivh oracleasmlib-2.0.4-1.el5.i386.rpm
warning: oracleasmlib-2.0.4-1.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:oracleasmlib ########################################### [100%]
[root@wwl asmpark]#
5、 好了,現(xiàn)在ASM相關(guān)包已經(jīng)安裝完成,現(xiàn)在來開始創(chuàng)建用于ASM的磁盤分區(qū)(不是一定要做,裸盤也可以做ASM)
[root@wwl asmpark]# fdisk -l
Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1958 15623212+ 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdc doesn't contain a valid partition table
[root@wwl asmpark]#
我們從上圖可以看出系統(tǒng)中有兩塊空閑的磁盤沒有使用,我們首先需要對磁盤創(chuàng)建分區(qū),但不能格式化,命令如下:
fdisk /dev/sdb /n/p/1/回車/回車/w
fdisk /dev/sdc /n/p/1/回車/回車/w
如下就已經(jīng)創(chuàng)建好了分區(qū):
[root@wwl asmpark]# fdisk -l
Disk /dev/sda: 16.1 GB, 16106127360 bytes
255 heads, 63 sectors/track, 1958 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1958 15623212+ 8e Linux LVM
Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 1305 10482381 83 Linux
Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 1305 10482381 83 Linux
二、ASM配置
以上已將準(zhǔn)備環(huán)境準(zhǔn)備好,下一步驟就是開始配置了,這里面配置包括如下幾個步驟
開始創(chuàng)建ASM實(shí)例,創(chuàng)建ASM實(shí)例的方式有兩種,一種是通過命令行,還有一種是通過圖形界面,執(zhí)行DBCA后有一步是創(chuàng)建ASM實(shí)例,圖形界面實(shí)在太簡單了,跟創(chuàng)建DB是一樣的,在這里就不累贅了。
在使用ASM之前首先要配置ASMLib驅(qū)動程序,如下:
我們首先可以看下asm的配置工具 oracleasm的語法和功能,如下:
[root@wwl asmpark]# /etc/init.d/oracleasm --help
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}
[root@wwl asmpark]#
1、開始配置ASMLib:
[root@wwl asmpark]# /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
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
2、啟用ASMLib驅(qū)動程序:
[root@wwl asmpark]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
3、通過以root用戶身份運(yùn)行以下命令來標(biāo)記由 ASMLib 使用的磁盤:
[root@wwl asmpark]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@wwl asmpark]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdc1
Marking disk "VOL2" as an ASM disk: [ OK ]
[root@wwl asmpark]#
4、通過如下命令查看ASM所能使用的磁盤及狀態(tài),一切顯示都是正常的。
[root@wwl asmpark]# oracleasm querydisk VOL1
Disk "VOL1" is a valid ASM disk
[root@wwl asmpark]# oracleasm querydisk /dev/sdb1
Device "/dev/sdb1" is marked an ASM disk with the label "VOL1"
[root@wwl asmpark]# oracleasm querydisk VOL2
Disk "VOL2" is a valid ASM disk
[root@wwl ~]# oracleasm querydisk /dev/sdc1
Device "/dev/sdc1" is marked an ASM disk with the label "VOL2"
[root@wwl asmpark]# oracleasm listdisks
VOL1
VOL2
[root@wwl asmpark]# ls -l /dev/oracleasm/disks/*
brw-rw---- 1 oracle dba 8, 17 Apr 10 00:25 /dev/oracleasm/disks/VOL1
brw-rw---- 1 oracle dba 8, 33 Apr 10 00:25 /dev/oracleasm/disks/VOL2
[root@wwl asmpark]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yes
5、如上ASMLib已經(jīng)安裝完成,并且也將磁盤標(biāo)記為可用,接下來要做的就是創(chuàng)建ASM實(shí)例,并構(gòu)建一個使用ASM磁盤來存儲數(shù)據(jù)的數(shù)據(jù)庫,可以使用DBCA,當(dāng)然也可以使用手工的方式來創(chuàng),在這里,我就采用手工方式創(chuàng)建ASM實(shí)例,步驟如下:
6、創(chuàng)建初始化參數(shù)文件,信息如下:
[oracle@ jb51.net dbs]$ vi $ORACLE_HOME/dbs/init$ORACLE_SID.ora
asm_diskstring='WWL:VOL*'
background_dump_dest='/oracle/admin/+ASM/bdump'
core_dump_dest='/oracle/admin/+ASM/cdump'
user_dump_dest='/oracle/admin/+ASM/udump'
instance_type='asm'
large_pool_size=12M
remote_login_passwordfile='SHARED'
7、增加實(shí)例信息到/etc/oratab
$ vi /etc/oratab
+ASM:/u01/app/oracle/product/10.2.0/db_1:Y
8、創(chuàng)建ASM實(shí)例密碼文件:
[oracle@ jb51.net dbs]$ $ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/orapw$ORACLE_SID password='oracle' force=y;
[oracle@ jb51.net dbs]$
9、創(chuàng)建ASM實(shí)例相應(yīng)的目錄:
[oracle@ jb51.net dbs]$ mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/bdump
[oracle@ jb51.net dbs]$ mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/cdump
[oracle@ jb51.net dbs]$ mkdir -p $ORACLE_BASE/admin/$ORACLE_SID/udump
[oracle@ jb51.net dbs]$
10、開啟CSS服務(wù)
$ su - root
[root@wwl ~]# /oracle/orahome/10.2.0/db_1/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
Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
wwl
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
11、啟動ASM實(shí)例,并創(chuàng)建ASM磁盤組:
[oracle@ jb51.net dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Apr 10 01:23:44 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> startup nomount;
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
+ASM STARTED
SQL>
現(xiàn)在實(shí)例我已經(jīng)將其啟動到nomount狀態(tài),下一步開始創(chuàng)建ASM磁盤組。
12、創(chuàng)建ASM組并將其啟動到MOUNT狀態(tài),
SQL> create diskgroup ASMGROUP1 normal redundancy disk '/dev/oracleasm/disks/VOL1','/dev/oracleasm/disks/VOL2';
Diskgroup created.
好了,磁盤組已經(jīng)創(chuàng)建好了,并且也已經(jīng)掛載了
SQL> select name,state from v$asm_diskgroup;
NAME STATE
------------------------------ -----------
ASMGROUP1 MOUNTED
SQL>
可以看到如下,參數(shù)文件也隨著更新了:
SQL> show parameter asm_diskgroups;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskgroups string ASMGROUP1
13、檢查ASM進(jìn)程是否都正常啟動了,我們之前提到的幾個進(jìn)程名稱,這里面都有了,說明現(xiàn)在ASM已經(jīng)是正常運(yùn)行狀態(tài)。
[oracle@ jb51.net ~]$ ps -ef | grep asm
oracle 3887 1 0 02:58 ? 00:00:00 asm_pmon_+ASM
oracle 3889 1 0 02:58 ? 00:00:00 asm_psp0_+ASM
oracle 3891 1 0 02:58 ? 00:00:00 asm_mman_+ASM
oracle 3893 1 0 02:58 ? 00:00:00 asm_dbw0_+ASM
oracle 3895 1 0 02:58 ? 00:00:00 asm_lgwr_+ASM
oracle 3897 1 0 02:58 ? 00:00:00 asm_ckpt_+ASM
oracle 3899 1 0 02:58 ? 00:00:00 asm_smon_+ASM
oracle 3901 1 0 02:58 ? 00:00:00 asm_rbal_+ASM
oracle 3903 1 0 02:58 ? 00:00:00 asm_gmon_+ASM
一、通過ASM方式建立單實(shí)例庫
二、檢查通過ASM建庫后,文件存儲的狀態(tài):
SQL>select file_name,tablespace_name from dba_data_files;
FILE_NAME TABLESPACE_NAME
-----------------------------------------------------------------
+ASMGROUP1/wwl/datafile/users.259.780215953 USERS
+ASMGROUP1/wwl/datafile/sysaux.257.780215951 SYSAUX
+ASMGROUP1/wwl/datafile/undotbs1.258.780215953 UNDOTBS1
+ASMGROUP1/wwl/datafile/system.256.780215951 SYSTEM
SQL>
我們由如上可以看出,現(xiàn)在數(shù)據(jù)都是存儲在ASM新建的+ASMGROUP1的組里面,并且文件名后面跟了一大串的數(shù)字,這是因為我們在新建表空間的時候直接采用就是Oracle OMF規(guī)范來進(jìn)行創(chuàng)建的(OMF實(shí)際上是9i里面就已經(jīng)推出來的功能了),在ASM中創(chuàng)建表空間和添加數(shù)據(jù)文件我們就沒有必要指定數(shù)據(jù)文件的存放路徑了,當(dāng)然他跟db_create_file_dest這個參數(shù)是相關(guān)聯(lián)的。
如下通過OMF方式創(chuàng)建表空間和添加數(shù)據(jù)文件的方式,可以看到很方便,默認(rèn)大小就是100M,會自動擴(kuò)展:
1、我們通過查看db_create_file_dest參數(shù),發(fā)現(xiàn)了數(shù)據(jù)文件默認(rèn)創(chuàng)建路徑是在+ASMGROUP1
SQL> show parameter db_create_file_dest
NAME TYPE VALUE
----------------------------------------------- ------------------------------
db_create_file_dest string +ASMGROUP1
2、使用OMF特性來進(jìn)行表空間的創(chuàng)建
SQL> create tablespace asm;
Tablespace created.
SQL> alter tablespace asm add datafile;
Tablespace altered.
3、檢查表空間是否已創(chuàng)建好
通過如下,我們可以看到,表空間已經(jīng)創(chuàng)建成功,并且已經(jīng)開啟了數(shù)據(jù)文件自動擴(kuò)展功能。
SQL> selectFILE_NAME,tablespace_name,bytes/1024/1024,AUTOEXTENSIBLE,MAXBYTES/1024/1024from dba_data_files where TABLESPACE_NAME='ASM';
FILE_NAME TABLESPACE_NAMEBYTES/1024/1024 AUT MAXBYTES/1024/1024
----------------------------------------------------------------- --------------- --- ------------------
+ASMGROUP1/wwl/datafile/asm.270.780300769 ASM 100 YES 32767.9844
+ASMGROUP1/wwl/datafile/asm.271.780300809 ASM 100 YES 32767.9844
4、可以動態(tài)的修改數(shù)據(jù)庫創(chuàng)建文件的位置
SQL> alter system set db_create_file_dest='/oracle/oradata/wwl';
System altered.
一、 ASM實(shí)例相關(guān)操作:
ASM實(shí)例的管理,啟動,關(guān)閉
ASM實(shí)例的啟動和數(shù)據(jù)庫實(shí)例的啟動有嚴(yán)格的先后關(guān)系,ASM啟動一定早于數(shù)據(jù)庫實(shí)例,關(guān)閉一定晚于ASM實(shí)例,因為它是數(shù)據(jù)庫數(shù)據(jù)文件存儲位置。如果ASM沒有起來,起數(shù)據(jù)庫將會報ORA-17503;ORA-15077的錯誤,錯誤信息如下:
SQL>startup
ORA-01078:failure in processing system parameters
ORA-01565:error in identifying file '+ASMGROUP1/WWL/spfileWWL.ora'
ORA-17503:ksfdopn:2 Failed to open file +ASMGROUP1/WWL/spfileWWL.ora
ORA-15077:could not locate ASM instance serving a required diskgroup
SQL>
1.1 ASM啟動的方法:
SQL>startup
ASMinstance started
TotalSystem Global Area 83886080 bytes
FixedSize 1217836 bytes
VariableSize 57502420 bytes
ASMCache 25165824 bytes
ASMdiskgroups mounted
SQL>select instance_name,status from v$instance;
INSTANCE_NAME STATUS
----------------------------
+ASM STARTED
SQL>
1.2 ASM關(guān)閉的方法 (必須先關(guān)閉數(shù)據(jù)庫)
沒有關(guān)閉RDBMS實(shí)例關(guān)閉ASM將報錯ORA-15097,提示已連接RDBMS實(shí)例,無法關(guān)閉ASM實(shí)例,
$ export Oracle_SID=+ASM
$ sqlplus / as sysdba
SQL> shutdown immediate
ORA-15097: cannot SHUTDOWNASM instance with connected RDBMS instance
關(guān)閉RDBMS實(shí)例狀態(tài)ASM是可以正常關(guān)閉的。
$export ORACLE_SID=WWL ---先關(guān)閉在ASM上運(yùn)行的RDBMS實(shí)例
$sqlplus / as sysdba
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
$export ORACLE_SID=+ASM ---再關(guān)閉ASM實(shí)例
$ sqlplus / as sysdba
SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
SQL>
二、 ASM三種磁盤組及磁盤的添加和維護(hù)
1、ASM磁盤的添加及刪除
1.1 添加這個步驟所需的磁盤(/dev/sdd -- /dev/sdm 共10塊10G的盤)
1.2 通過root用戶查看下當(dāng)前有幾個ASM磁盤,磁盤狀態(tài),實(shí)例狀態(tài)
# oracleasm listdisks
VOL1
VOL2
# oracleasm querydisk VOL1
Disk"VOL1" is a valid ASM disk
# oracleasm querydisk VOL2
Disk"VOL2" is a valid ASM disk
# ls -l /dev/oracleasm/disks/*
brw-rw---- 1oracle dba 8, 17 Apr 12 05:30 /dev/oracleasm/disks/VOL1
brw-rw---- 1oracle dba 8, 33 Apr 12 05:30 /dev/oracleasm/disks/VOL2
# oracleasm status
Checking if ASMis loaded: yes
Checking if /dev/oracleasm is mounted: yes
我們已知數(shù)據(jù)庫當(dāng)有兩塊通過ASMLiB已經(jīng)標(biāo)記了的磁盤,并且狀態(tài)是正常的
1.3 開始通過ASMLib來標(biāo)記新的磁盤,用于后面的實(shí)驗:
l 報錯了,很經(jīng)典,是由于沒有創(chuàng)建分區(qū)導(dǎo)致:
# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd
Marking disk"VOL3" as an ASM disk: [FAILED]
l 先創(chuàng)建分區(qū)方法:fdisk /dev/sdd /n/p/1/回車/回車/w,將所有磁盤都創(chuàng)建分區(qū)。
# /etc/init.d/oracleasmcreatedisk VOL3 /dev/sdd1
Marking disk "VOL3" as anASM disk: [ OK ] ---可以看到,能正常創(chuàng)建
# sh oracleasm 通過執(zhí)行腳本命令,新建10個磁盤已全部完成標(biāo)記
Marking disk "VOL4" as an ASM disk: [ OK ]
Marking disk "VOL5" as an ASM disk: [ OK ]
Marking disk "VOL6" as an ASM disk: [ OK ]
Marking disk "VOL7" as an ASM disk: [ OK ]
Marking disk "VOL8" as an ASM disk: [ OK ]
Marking disk "VOL9" as an ASM disk: [ OK ]
Marking disk "VOL10" as an ASM disk: [ OK ]
Marking disk "VOL11" as an ASM disk: [ OK ]
Marking disk "VOL12" as an ASM disk: [ OK ]
1.4 為ASMGROUP1磁盤組添加刪除磁盤
l 查看磁盤組的狀態(tài)
SQL> selectGROUP_NUMBER,NAME,STATE,TYPE from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TYPE
------------------------ ----------------- -------------- --------
1 ASMGROUP1 CONNECTED NORMAL
SQL> SELECT a.name GRPNAME,b.group_number GR_NUMBER,b.disk_numberDK_NUMBER,b.name ASMFILE,b.path,b.mount_status,b.state FROM v$asm_diskgroupa,v$asm_disk b;
GRPNAME GR_NUMBER DK_NUMBER ASMFILE PATH MOUNT_S STATE
---------- ---------- ---------------------------------------- ------------------------- ------- --------
ASMGROUP1 1 0ASMGROUP1_0000 /dev/oracleasm/disks/VOL1OPENED NORMAL
ASMGROUP1 1 1ASMGROUP1_0001 /dev/oracleasm/disks/VOL2 OPENED NORMAL
l 查看磁盤組ASMGROUP1中的成員
SQL> selectgroup_number,disk_number, failgroup,name,path from v$asm_disk where FAILGROUPlike 'ASMGROUP1%';
GROUP_NUMBERDISK_NUMBER FAILGROUP NAME PATH
----------------------- ------------------------------ ----------------------------------------------------------------------
2 1 ASMGROUP1_0001 ASMGROUP1_0001 /dev/oracleasm/disks/VOL2
2 0 ASMGROUP1_0000 ASMGROUP1_0000 /dev/oracleasm/disks/VOL1
SQL>
l 添加為ASMGROUP1添加磁盤
SQL> alterdiskgroup ASMGROUP1 add disk '/dev/oracleasm/disks/VOL10';
Diskgroupaltered.
l 我們可以看到已經(jīng)添加成功了
SQL> select group_number,disk_number,failgroup,name,path from v$asm_disk where FAILGROUP like 'ASMGROUP1%';
GROUP_NUMBERDISK_NUMBER FAILGROUP NAME PATH
----------------------- ------------------------------ ----------------------------------------------------------------------
2 2 ASMGROUP1_0002 ASMGROUP1_0002 /dev/oracleasm/disks/VOL10
2 1 ASMGROUP1_0001 ASMGROUP1_0001 /dev/oracleasm/disks/VOL2
2 0 ASMGROUP1_0000 ASMGROUP1_0000 /dev/oracleasm/disks/VOL1
2、ASM三種磁盤組的創(chuàng)建及刪除(High Normal Extermal)
2.1 創(chuàng)建High級別的ASM磁盤組,最少需要三塊磁盤來創(chuàng)建。
SQL> create diskgroup asmhigh high redundancy disk'/dev/oracleasm/disks/VOL3','/dev/oracleasm/disks/VOL4','/dev/oracleasm/disks/VOL5';
Diskgroupcreated.
2.2 創(chuàng)建Normal級別的ASM磁盤,最少需要兩個磁盤來創(chuàng)建。
SQL> creatediskgroup asmnormal normal redundancy disk'/dev/oracleasm/disks/VOL6','/dev/oracleasm/disks/VOL7';
Diskgroupcreated.
2.3 創(chuàng)建Extermal級別的ASM磁盤,最少需要一個磁盤來創(chuàng)建。
SQL> creatediskgroup asmexternal external redundancy disk '/dev/oracleasm/disks/VOL8';
Diskgroupcreated.
2.4 查看剛才創(chuàng)建的磁盤狀態(tài)
SQL> select name,state,type fromv$asm_diskgroup;
NAME STATE TYPE
--------------- ----------- ------
ASMGROUP1 MOUNTED NORMAL
ASMHIGH MOUNTED HIGH
ASMNORMAL MOUNTED NORMAL
ASMEXTERNAL MOUNTED EXTERN
2.5 為ASM磁盤組添加成員,在這里我們就以Normal磁盤組來進(jìn)行成員添加的例子:
SQL> alter diskgroup ASMNORMAL add disk'/dev/oracleasm/disks/VOL9';
Diskgroup altered.
SQL> select group_number,disk_number,failgroup,name,path from v$asm_disk where FAILGROUP like 'ASMNORMAL%';
GROUP_NUMBER DISK_NUMBER FAILGROUP NAME PATH
------------ ----------------------------------------- ------------------------------ ----------------------------------------
4 2 ASMNORMAL_0002 ASMNORMAL_0002 /dev/oracleasm/disks/VOL9
4 1 ASMNORMAL_0001 ASMNORMAL_0001 /dev/oracleasm/disks/VOL7
4 0 ASMNORMAL_0000 ASMNORMAL_0000 /dev/oracleasm/disks/VOL6
SQL>
2.6 刪除磁盤組成員,在這里我們同樣以NORMAL磁盤組來進(jìn)行成員刪除的例子:
SQL> alter diskgroup ASMNORMAL drop disk ASMNORMAL_0002;
Diskgroup altered.
SQL> select group_number,disk_number, failgroup,name,path fromv$asm_disk where FAILGROUP like 'ASMNORMAL%';
GROUP_NUMBER DISK_NUMBER FAILGROUP NAME PATH
------------ ----------- ------------------------------ ----------------------------------------------------------------------
4 1 ASMNORMAL_0001 ASMNORMAL_0001 /dev/oracleasm/disks/VOL7
4 0 ASMNORMAL_0000 ASMNORMAL_0000 /dev/oracleasm/disks/VOL6
SQL>
三、 模擬磁盤故障
3.1 在AMSGROUP1(NORMAL類型)磁盤組中寫數(shù)據(jù)
SQL> selecttablespace_name,file_name,bytes/1024/1024 M from dba_data_files;
TABLESPACE_NAMEFILE_NAME M
------------------------------------------------------------ ----------
USERS +ASMGROUP1/wwl/datafile/users.259.780215953 5
SYSAUX +ASMGROUP1/wwl/datafile/sysaux.257.780215951 230
UNDOTBS1 +ASMGROUP1/wwl/datafile/undotbs1.258.78021595 25
3
SYSTEM +ASMGROUP1/wwl/datafile/system.256.780215951 480
ASM +ASMGROUP1/wwl/datafile/asm.270.780300769 100
ASM +ASMGROUP1/wwl/datafile/asm.271.780300809 100
6 rowsselected.
如上我們可以看到,我們所有的表空間均是放在ASMGROUP1中的,一會兒我們將對表空間寫如數(shù)據(jù),并刪除一磁盤。
3.2 我們查看下該表空間的默認(rèn)用戶
SQL> selectusername,default_tablespace from dba_users where DEFAULT_TABLESPACE='ASM';
USERNAME DEFAULT_TABLESPACE
------------------------------------------------------------
WWL ASM
3.3 在ASM表空間寫入數(shù)據(jù)。
通過WWL用戶登錄到系統(tǒng)創(chuàng)建一張表,用來測試.
SQL> connwwl/wwl
Connected.
SQL> createtable wwl (id varchar(5),name varchar(10));
Table created.
SQL> begin
2 fori in 1..1000 loop
3 insert into wwl values (15,'wwl15');
4 endloop;
5 end;
6 /
PL/SQLprocedure successfully completed.
我們創(chuàng)建了一張wwl的表,并且插入了1000行數(shù)據(jù)
SQL> selectcount(*) from wwl;
COUNT(*)
----------
1000
3.4 模擬磁盤突然損壞
[root@wwl ~]#oracleasm deletedisk VOL2;
Clearing diskheader: done
Dropping disk:done
[root@wwl ~]#
仔細(xì)看下面,我們通過如上的命令刪除了VOL2后,現(xiàn)在只認(rèn)到一個磁盤了。
SQL> selectgroup_number,disk_number, failgroup,name,path from v$asm_disk where FAILGROUPlike 'ASMGROUP%';
GROUP_NUMBERDISK_NUMBER FAILGROUP NAME PATH
----------------------- ------------------------------ ----------------------------------------------------------------------
2 0 ASMGROUP1_0000 ASMGROUP1_0000 /dev/oracleasm/disks/VOL1
SQL>
但是我們的實(shí)例和我們剛才創(chuàng)建的表數(shù)據(jù)都沒有丟失,這就是冗余的好處,NORMAL模式它是用犧牲一塊磁盤的空間來保障數(shù)據(jù)的安全性的,hight模式是至少犧牲一塊硬盤來保障數(shù)據(jù)的安全性。
SQL> selectcount(*) from wwl;
COUNT(*)
----------
1000
3.5 而且業(yè)務(wù)是不會中斷的,但是在日志和硬盤指示燈上會有告警:
ASM日志信息如下:
WARNING:offlining disk 2.3916240783 (ASMGROUP1_0002) with mask 0x1
NOTE: PSTupdate: grp = 2, dsk = 2, mode = 0x6
NOTE: cacheclosing disk 2 of grp 2: ASMGROUP1_0002
NOTE: PSTupdate: grp = 2
NOTE: erasingheader on grp 2 disk ASMGROUP1_0002
3.6 這個時候我們需要盡快更換新的硬盤,因為發(fā)生這問題之后如果另外一個磁盤再損壞的話那將是不可彌補(bǔ)的數(shù)據(jù)丟失,更換新硬盤后,數(shù)據(jù)將會再次進(jìn)行同步。
3.7
四、 ASM別名管理
別名就是外號,比如說當(dāng)系統(tǒng)自動產(chǎn)生的名稱太過復(fù)雜不怎么好記,DBA可以通過別名,為它創(chuàng)建一個簡單化的名稱,而又不會對其現(xiàn)有名稱造成任何影響。ASM中創(chuàng)建別名是通過alter diskgroup的alias子句實(shí)現(xiàn),支持增加/修改/刪除等多項操作。V$ASM_ALIAS視圖中可以查詢到當(dāng)前實(shí)例中創(chuàng)建的別名。
4.1 添加別名
SQL> alter diskgroup ASMGROUP1 add alias'+ASMGROUP1/wwl/datafile/asm01.dbf' for'+ASMGROUP1/wwl/datafile/asm.270.780300769';
Diskgroup altered.
4.2 修改別名
SQL> alter diskgroup ASMGROUP1 renamealias '+ASMGROUP1/wwl/datafile/asm01.dbf' for'+ASMGROUP1/wwl/datafile/asm.270.780300769';
Diskgroup altered.
4.3 刪除別名
SQL> alter diskgroup ASMGROUP1 dropalias '+ASMGROUP1/wwl/datafile/asm01.dbf' for'+ASMGROUP1/wwl/datafile/asm.270.780300769';
Diskgroup altered.
無論是添加、刪除或是修改別名,對原文件路徑均不會有影響。
五、 目錄及目錄文件管理
5.1 創(chuàng)建目錄
SQL> alter diskgroup ASMGROUP1 add directory '+ASMGROUP1/WWL1';
Diskgroupaltered.
5.2 修改目錄
SQL> alterdiskgroup ASMGROUP1 rename directory '+ASMGROUP1/WWL1' to '+ASMGROUP1/WWL2';
Diskgroupaltered.
5.3 刪除目錄
SQL> alter diskgroup ASMGROUP1 drop directory '+ASMGROUP1/WWL2';
Diskgroupaltered.
六、 手動平衡磁盤組
一般情況下ASM都會自動對其下的磁盤組進(jìn)行平衡,不過ORACLE也提供了手動平衡磁盤組的方式,通過alter diskgroup ... power 語句。前面提到過磁盤組的平衡度有0到11多個級別,默認(rèn)是按照ASM_POWER_LIMIT初始化參數(shù)中設(shè)置的值,手動平衡的話,設(shè)置的平衡度可以與初始化參數(shù)中并不相同,例如,設(shè)置磁盤組平衡度為5,語句如下:
SQL>alter diskgroup asmgroup1 rebalance power 5;
Diskgroup altered.
七、 通過ASMCMD工具管理ASM
[oracle@wwl ~]$ which asmcmd
/oracle/orahome/10.2.0/db_1/bin/asmcmd
[oracle@wwl ~]$ cd/oracle/orahome/10.2.0/db_1/bin/
ASMCMD> ls
ASMEXTERNAL/
ASMGROUP1/
ASMHIGH/
ASMNORMAL/
ASMCMD>
ASMCMD> help
asmcmd [-p] [command]
The environment variables ORACLE_HOME and ORACLE_SID determine the
instance to which the program connects, and ASMCMD establishes a
bequeath connection to it, in the same manner as a SQLPLUS / AS
SYSDBA. The user must be a memberof the SYSDBA group.
Specifying the -p option allows the current directory to be displayed
in the command prompt, like so:
ASMCMD [+DATAFILE/ORCL/CONTROLFILE] >
[command] specifies one of the following commands, along with its
parameters.
Type "help [command]" to get help on a specific ASMCMDcommand.
commands:
--------
cd:------------------------------------------進(jìn)入下級目錄或進(jìn)入所需要的目錄
du:------------------------------------------顯示指定的ASM目錄下ASM文件占用的所有磁盤空間
find:-----------------------------------------查找所需的文件
help:-----------------------------------------顯示幫助信息
ls:---------------------------------------------列出ASM目錄下的內(nèi)容及其屬性
lsct:-------------------------------------------列出當(dāng)前ASM客戶端的信息
lsdg:-------------------------------------------列出所有磁盤組及其屬性
mkalias:--------------------------------------為系統(tǒng)生成的文件名創(chuàng)建別名
mkdir:----------------------------------------創(chuàng)建新目錄
pwd:------------------------------------------顯示當(dāng)前目錄路徑
rm:--------------------------------------------刪除ASM目錄下的某個文件或文件夾
rmalias:--------------------------------------刪除別名
ASMCMD>
要查看某個命令的相信通過在命令前添加help來查看,如下:
ASMCMD> help cd
cd dir>
Change the current directory to dir>.
ASMCMD> help du
du [-H] [dir]
Display total space used for files located recursively under [dir],
similar to "du -s" under UNIX; default is the currentdirectory. Two
values are returned, both in units of megabytes. The first value does
not take into account mirroring of the diskgroup while the second does.
For instance, if a file occupies 100 MB of space, then it actually
takes up 200 MB of space on a normal redundancy diskgroup and 300 MB
of space on a high redundancy diskgroup.
[dir] can also contain wildcards.
The -H flag suppresses the column headers from the output.
ASMCMD> help find
find [-t type>] dir> pattern>
Find the absolute paths of all occurrences of pattern> underdir>.
pattern> can be a directory and may include wildcards. dir> may also
include wildcards. Note thatdirectory names in the results have the
"/" suffix to clarify their identity.
The -t option allows searching by file type. For instance, one can
search for all the control files at once. type> must be one of the
valid values in V$ASM_FILE.TYPE.
ASMCMD>
八、 oracleasm工具的使用和語法介紹
[root@wwl ~]# oracleasm --help
Usage: oracleasm[--exec-path=exec_path>] command> [ args> ]
oracleasm --exec-path
oracleasm -h
oracleasm -V
The basic oracleasm commands are:
configure Configure the OracleLinux ASMLib driver
init Load andinitialize the ASMLib driver
exit Stop the ASMLibdriver
scandisks Scan the systemfor Oracle ASMLib disks
status Display thestatus of the Oracle ASMLib driver
listdisks List known OracleASMLib disks
querydisk Determine if adisk belongs to Oracle ASMlib
createdisk Allocate a devicefor Oracle ASMLib use
deletedisk Return a deviceto the operating system
renamedisk Change the labelof an Oracle ASMlib disk
update-driver Download thelatest ASMLib driver
[root@wwl ~]#
九、 ASM相關(guān)視圖(V$)和數(shù)據(jù)字典(X$)
ASM由于其高度的封裝性,使得我們很難知道窺探其內(nèi)部的原理??梢酝ㄟ^一下視圖和數(shù)據(jù)字典來來查看ASM 的信息。
相關(guān)視圖和數(shù)據(jù)字典
View Name
X$ Table name
Description
V$ASM_DISKGROUP
X$KFGRP
performs disk discovery and lists diskgroups
V$ASM_DISKGROUP_STAT
X$KFGRP_STAT
diskgroup stats without disk discovery
V$ASM_DISK
X$KFDSK, X$KFKID
performs disk discovery, lists disks and their usage metrics
V$ASM_DISK_STAT
X$KFDSK_STAT, X$KFKID
lists disks and their usage metrics
V$ASM_FILE
X$KFFIL
lists ASM files, including metadata/asmdisk files
V$ASM_ALIAS
X$KFALS
lists ASM aliases, files and directories
V$ASM_TEMPLATE
X$KFTMTA
lists the available templates and their properties
V$ASM_CLIENT
X$KFNCL
lists DB instances connected to ASM
V$ASM_OPERATION
X$KFGMG
lists rebalancing operations
N.A.
X$KFKLIB
available libraries, includes asmlib path
N.A.
X$KFDPARTNER
lists disk-to-partner relationships
N.A.
X$KFFXP
extent map table for all ASM files
N.A.
X$KFDAT
extent list for all ASM disks
N.A.
X$KFBH
describes the ASM cache (buffer cache of ASM in blocks of 4K (_asm_blksize)
N.A.
X$KFCCE
a linked list of ASM blocks. to be further investigated
This list isobtained querying v$fixed_view_definitionwhere view_name like '%ASM%' whichexposes all the v$ and gv$ views with theirdefinition. Fixed tables are exposedby querying v$fixed_table where name like'x$kf%' (ASM fixed tables use the'X$KF' prefix).
SQL>select* fromv$fixed_view_definition whereview_name like '%ASM%';
SQL>select* from sys.v$fixed_tablewhere name like 'X$KF%' ;
十、 ASM常見的錯誤處理
錯誤一、
ORA-15097:cannotSHUTDOWN ASM instance with connected RDBMS instance
解決辦法:
發(fā)生這個問題,唯一的一個原因就是Oracle實(shí)例沒有關(guān)閉,或ORACLE實(shí)例正在關(guān)閉或處于掛起狀態(tài),導(dǎo)致ASM實(shí)例無法關(guān)閉,解決辦法,關(guān)閉RDBMS實(shí)例后再關(guān)閉ASM實(shí)例。
錯誤二、
[root@wwl ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdd
Marking disk "VOL3" as an ASM disk: [FAILED]
報這個錯的原因在于磁盤為分區(qū)導(dǎo)致。在創(chuàng)建ASM的之前必須線將磁盤分區(qū),但不能格式化,后執(zhí)行創(chuàng)建就不會有問題了。
十一、 ASM 擴(kuò)展性
最多支持63個磁盤組; 最多支持10000個磁盤; 最大支持4pb/磁盤; 最大支持40 exabyte/ASM存儲; 最大支持1百W個文件/磁盤組; 外部冗余時單個文件最大35tb,標(biāo)準(zhǔn)冗余時單個文件最大5.8tb,高冗余度時單個文件最大3.9tb
十二、 ASM其它信息請參考如下連接:
http://docs.oracle.com/cd/E11882_01/server.112/e16102/asmfiles.htm
您可能感興趣的文章:- Oracle ASM數(shù)據(jù)庫故障數(shù)據(jù)恢復(fù)解決方案
- oracle中fdisk導(dǎo)致的ASM磁盤數(shù)據(jù)丟失的解決方法
- Oracle ASM故障數(shù)據(jù)恢復(fù)解決方案