ASM安装和配置.docx
《ASM安装和配置.docx》由会员分享,可在线阅读,更多相关《ASM安装和配置.docx(24页珍藏版)》请在冰豆网上搜索。
![ASM安装和配置.docx](https://file1.bdocx.com/fileroot1/2022-12/30/ee983cbc-11e3-41b5-9a8c-d2f3fc95eb1b/ee983cbc-11e3-41b5-9a8c-d2f3fc95eb1b1.gif)
ASM安装和配置
ASM安装和配置
1.软件准备
1.1ASMdriver-Asmlib
oracleasm-support-version.arch.rpm
oracleasm-kernel-version.arch.rpm
oracleasmlib-version.arch.rpm
Enterthefollowingcommandtodeterminethekernelversionand
architectureofthesystem:
#uname-rm
DownloadtherequiredASMLIBpackagesfromtheOracleTechnology
Network(OTN)Website:
Note:
Youmustinstalloracleasm-supportpackageversion2.0.1orlaterto
useASMLIBonRedHatEnterpriseLinuxAdvancedServer,orSUSELinux
EnterpriseServer.
Youmustinstallthefollowingpackages,whereversionistheversion
oftheASMLIBdriver,archisthesystemarchitecture,andkernelis
theversionofthekernelthatyouareusing.
1.2GridInfrastructure
html
2.安装驱动-Asmlib
2.1安装ASMDriver
Switchusertotherootuser:
$su-
Enteracommandsimilartothefollowingtoinstallthepackages:
#rpm-Uvhoracleasm-support-version.arch.rpm\
oracleasm-kernel-version.arch.rpm\
oracleasmlib-version.arch.rpm
Forexample,ifyouareusingtheRedHatEnterpriseLinuxAS4
enterprisekernelonanAMD64system,thenenteracommandsimilarto
thefollowing:
#rpm-Uvhoracleasm-support-2.0.1.x86_64.rpm\
oracleasmlib-2.0.1.x86_64.rpm\
oracleasm-2.6.9-11.EL-2.0.1.x86_64.rpm
[root@rac1rpm]#ls|grepasm
oracleasm-2.6.9-89.ELsmp-2.0.5-1.el4.i686.rpm
oracleasmlib-2.0.4-1.el4.i386.rpm
oracleasm-support-2.1.7-1.el4.i386.rpm
rpm-Uvhoracleasm-support-2.1.7-1.el4.i386.rpm\
oracleasmlib-2.0.4-1.el4.i386.rpm\
oracleasm-2.6.9-89.ELsmp-2.0.5-1.el4.i686.rpm
[root@rac1rpm]#rpm-qa|grepasm
[root@rac1rpm]#rpm-Uvhoracleasm-support-2.1.7-1.el4.i386.rpm\
>oracleasmlib-2.0.4-1.el4.i386.rpm\
>oracleasm-2.6.9-89.ELsmp-2.0.5-1.el4.i686.rpm
warning:
oracleasm-support-2.1.7-1.el4.i386.rpm:
V3DSAsignature:
NOKEY,keyIDb38a8516
Preparing...###########################################
[100%]
1:
oracleasm-support###########################################
[33%]
2:
oracleasm-2.6.9-89.ELsm###########################################
[67%]
3:
oracleasmlib###########################################
[100%]
[root@rac1rpm]#
2.2配置驱动
Enterthefollowingcommandtoruntheoracleasminitializationscript
withtheconfigureoption:
#/usr/sbin/oracleasmconfigure-i
or
#/etc/init.d/oracleasmconfigure
[root@rac1rpm]#/etc/init.d/oracleasmconfigure
ConfiguringtheOracleASMlibrarydriver.
Thiswillconfiguretheon-bootpropertiesoftheOracleASMlibrary
driver.Thefollowingquestionswilldeterminewhetherthedriveris
loadedonbootandwhatpermissionsitwillhave.Thecurrentvalues
willbeshowninbrackets('[]').Hittingwithouttypingan
answerwillkeepthatcurrentvalue.Ctrl-Cwillabort.
Defaultusertoownthedriverinterface[grid]:
Defaultgrouptoownthedriverinterface[dba]:
StartOracleASMlibrarydriveronboot(y/n)[y]:
ScanforOracleASMdisksonboot(y/n)[y]:
WritingOracleASMlibrarydriverconfiguration:
done
InitializingtheOracleASMLibdriver:
[OK]
ScanningthesystemforOracleASMLibdisks:
[OK]
[root@rac1rpm]#
2.3创建ASM磁盘
IfyouintendtouseIDE,SCSI,orRAIDdevicesintheOracleASMdisk
group,thenfollowthesesteps:
Ifnecessary,installorconfiguretheshareddiskdevicesthatyou
intendtouseforthediskgroupandrestartthesystem.
Toidentifythedevicenameforthediskstouse,enterthefollowing
command:
Dependingonthetypeofdisk,thedevicenamecanvary:
DiskType
DeviceNameFormat
Description
IDEdisk
/dev/hdxn
Inthisexample,xisaletterthatidentifiestheIDEdiskandnis
thepartitionnumber.Forexample,/dev/hdaisthefirstdiskonthe
firstIDEbus.
SCSIdisk
/dev/sdxn
Inthisexample,xisaletterthatidentifiestheSCSIdiskandnis
thepartitionnumber.Forexample,/dev/sdaisthefirstdiskonthe
firstSCSIbus.
Toincludedevicesinadiskgroup,youcanspecifyeitherwhole-drive
devicenamesorpartitiondevicenames.
Note:
Oraclerecommendsthatyoucreateasinglewhole-diskpartitiononeach
disk.
Useeitherfdiskorpartedtocreateasinglewhole-diskpartitionon
thediskdevices.
EnteracommandsimilartothefollowingtomarkadiskasanOracle
ASMdisk:
#/usr/sbin/oracleasmcreatediskDISK1/dev/sdb1
Inthisexample,DISK1isthenameyouassigntothedisk.
Note:
Thedisknamesthatyouspecifycancontainuppercaseletters,numbers,
andtheunderscorecharacter.Theymuststartwithanuppercaseletter.
Ifyouareusingamulti-pathingdiskdriverwithOracleASM,thenmake
surethatyouspecifythecorrectlogicaldevicenameforthedisk.
Tomakethediskavailableontheothernodesinthecluster,enterthe
followingcommandasrootoneachnode:
#/usr/sbin/oracleasmscandisks
Thiscommandidentifiesshareddisksattachedtothenodethatare
markedasOracleASMdisks.
[root@rac1rpm]#fdisk-l
Disk/dev/sda:
107.3GB,107374182400bytes
255heads,63sectors/track,13054cylinders
Units=cylindersof16065*512=8225280bytes
DeviceBootStartEndBlocksIdSystem
/dev/sda1*112662101707483+83Linux
/dev/sda21266313054314874082Linuxswap
Disk/dev/sdb:
1073MB,1073741824bytes
255heads,63sectors/track,130cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdbdoesn'tcontainavalidpartitiontable
Disk/dev/sdc:
1073MB,1073741824bytes
255heads,63sectors/track,130cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdcdoesn'tcontainavalidpartitiontable
Disk/dev/sdd:
1073MB,1073741824bytes
255heads,63sectors/track,130cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdddoesn'tcontainavalidpartitiontable
Disk/dev/sde:
1073MB,1073741824bytes
255heads,63sectors/track,130cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdedoesn'tcontainavalidpartitiontable
[root@rac1rpm]#fdisk/dev/sdb
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIor
OSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwon'tberecoverable.
Warning:
invalidflag0x0000ofpartitiontable4willbecorrectedby
w(rite)
Command(mforhelp):
n
Commandaction
eextended
pprimarypartition(1-4)
p
Partitionnumber(1-4):
1
Firstcylinder(1-130,default1):
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-130,default130):
Usingdefaultvalue130
Command(mforhelp):
w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
[root@rac1rpm]#fdisk/dev/sdc
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIor
OSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwon'tberecoverable.
Warning:
invalidflag0x0000ofpartitiontable4willbecorrectedby
w(rite)
Command(mforhelp):
n
Commandaction
eextended
pprimarypartition(1-4)
p
Partitionnumber(1-4):
1
Firstcylinder(1-130,default1):
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-130,default130):
Usingdefaultvalue130
Command(mforhelp):
w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
[root@rac1rpm]#fdisk/dev/sdd
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIor
OSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwon'tberecoverable.
Warning:
invalidflag0x0000ofpartitiontable4willbecorrectedby
w(rite)
Command(mforhelp):
n
Commandaction
eextended
pprimarypartition(1-4)
p
Partitionnumber(1-4):
1
Firstcylinder(1-130,default1):
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-130,default130):
Usingdefaultvalue130
Command(mforhelp):
w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
[root@rac1rpm]#fdisk/dev/sde
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIor
OSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwon'tberecoverable.
Warning:
invalidflag0x0000ofpartitiontable4willbecorrectedby
w(rite)
Command(mforhelp):
n
Commandaction
eextended
pprimarypartition(1-4)
p
Partitionnumber(1-4):
1
Firstcylinder(1-130,default1):
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-130,default130):
Usingdefaultvalue130
Command(mforhelp):
w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
Createasmdisk
/etc/init.d/oracleasmcreatediskASMDISK1/dev/sdb1
/etc/init.d/oracleasmcreatediskASMDISK2/dev/sdc1
/etc/init.d/oracleasmcreatediskASMDISK3/dev/sdd1
/etc/init.d/oracleasmcreatediskASMDISK4/dev/sde1
/etc/init.d/oracleasmscandisks
/etc/init.d/oracleasmlistdisks
[root@rac1rpm]#/etc/init.d/oracleasmcreatediskASMDISK1/dev/sdb1
Markingdisk"ASMDISK1"asanASMdisk:
[OK]
[root@rac1rpm]#/etc/init.d/oracleasmcreatediskASMDISK2/dev/sdc1
Markingdisk"ASMDISK2"asanASMdisk:
[OK]
[root@rac1rpm]#/etc/init.d/oracleasmcreatediskASMDISK3/dev/sdd1
Markingdisk"ASMDISK3"asanASMdisk:
[OK]
[root@rac1rpm]#/etc/init.d/oracleasmcreatediskASMDISK4/dev/sde1
Markingdisk"ASMDISK4"asanASMdisk:
[OK]
[root@ra