安裝oracleASM

問題:oracleasm status不能啓動html

解決方案:linux

[root@localhost ~]# oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
[root@localhost ~]# oracleasm exit
[root@localhost ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Mounting ASMlib driver filesystem: /dev/oracleasm
[root@localhost ~]# oracleasm status
Checking if ASM is loaded: yes
Checking if /dev/oracleasm is mounted: yesoracle

一。手工搞定安裝
 
1. 檢查是否已安裝及系統內核
  --查看內核
  [root@xclrac1 /]# uname -rm
  2.6.39-400.17.1.el6uek.x86_64 x86_6
 
  --查看asm包
  [root@xclrac1 /]# rpm -qa|grep asm
  libatasmart-0.17-4.el6_2.x86_64
  [root@xclrac1 /]#
 
  [root@xclrac1 db2]# cat /proc/version
  Linux version 2.6.39-400.17.1.el6uek.x86_64 (mockbuild@ca-build44.us.oracle.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Fri Feb 22 18:16:18 PST 2013
 
   [root@xclrac1 ~]# cat /etc/issue
  Oracle Linux Server release 6.4
  Kernel \r on an \m
 
2. 去官網找到相應系統對應的asm下載安裝.
 之前Oracle Linux 5 以下:
  --安裝ASM, support->asm-> lib放最後 
   rpm -Uvh oracleasm-support-2.1.7-1.el5.x86_64.rpm
   rpm -Uvh oracleasm-2.6.18-194.el5-2.0.5-1.el5.x86_64.rpm
   rpm -Uvh oracleasmlib-2.0.4-1.el5.x86_64.rpm
  如今Oracle 6.4就不需這麼麻煩:
   2.1 去系統光盤找到asmlib support的安裝包(rpm -Uvh oracleasm-support-2.1.8-1.el6.x86_64.rpm)裝上
   2.2 去Oracle官網,下載Oracle Linux 6 對應的asmlib.rpm包並裝上
   2.3 從新查看
 [root@xclrac1 db2]# rpm -qa|grep asm
 oracleasmlib-2.0.4-1.el6.x86_64
 libatasmart-0.17-4.el6_2.x86_64
 
 3. 安裝成功後,經過 oracleasm命令檢查並管理asmlib
 [root@xclrac1 /]# oracleasm status
 Checking if ASM is loaded: yes
 Checking if /dev/oracleasm is mounted: yes
 
 [root@xclrac1 ~]# oracleasm update-driver
 
 
二。yum快速搞定安裝
 http://www.oracle.com/technetwork/server-storage/linux/uln-095759.html
 
Getting Oracle ASMLib via the Unbreakable Linux Network
Installing ASMLib via ULN
  Now that the system is registered with ULN, it can install the software. Log in as root and run:
                                           
 # yum install oracleasm-support oracleasmlib oracleasm-`uname -r`
 
On Oracle Linux 5 and older, run the following command instead:
 
# up2date -i oracleasm-support oracleasmlib oracleasm-`uname -r`
 
This will install the support tools, the library, and the kernel driver for the currently running kernel.
 
Note: If you are running the Unbreakable kernel, the ASMLib kernel driver is included in that kernel package, and the oracleasm-`uname -r` package should not be specified.
 
安裝成功後。就能夠.配置和管理asm 磁盤了。
 
1. 我在這建立5個磁盤
  cd C:\Program Files\Oracle\VirtualBox
VBoxManage.exe createhd -filename D:\OracleVM\ASM\asm1.vdi -size 5120 -format VDI -variant Fixed
VBoxManage.exe createhd -filename D:\OracleVM\ASM\asm2.vdi -size 5120 -format VDI -variant Fixed
VBoxManage.exe createhd -filename D:\OracleVM\ASM\asm3.vdi -size 5120 -format VDI -variant Fixed
VBoxManage.exe createhd -filename D:\OracleVM\ASM\asm4.vdi -size 5120 -format VDI -variant Fixed
VBoxManage.exe createhd -filename D:\OracleVM\ASM\asm5.vdi -size 5120 -format VDI -variant Fixed
 
2. 在Oracle VM中附加進去。 這個VM也能夠用命令,但不太好使。
  Settings -> Storage->Controller:SATA ->Add Hard Disk
3. 更改爲共享模式
VBoxManage.exe modifyhd D:\OracleVM\ASM\asm1.vdi --type shareable
VBoxManage.exe modifyhd D:\OracleVM\ASM\asm2.vdi --type shareable
VBoxManage.exe modifyhd D:\OracleVM\ASM\asm3.vdi --type shareable
VBoxManage.exe modifyhd D:\OracleVM\ASM\asm4.vdi --type shareable
VBoxManage.exe modifyhd D:\OracleVM\ASM\asm5.vdi --type shareable
 
4. 檢查下狀態 
    a. VBoxManage list vms
    b. 進入linux系統
  [root@rac1 dev]# ls sd*
   sda sda1 sda2 sdb sdc sdd sde sdf
   //其中   sdb sdc sdd sde sdf 就是掛上的那5個盤
 
5. 來fdisk 磁盤。
    依次:  fdisk sdb   fdisk sdc   fdisk sdd    fdisk sde    fdisk sdf 
   附了個例子:  
[root@rac1 dev]# fdisk sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x1f132726.
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)
 
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').
 
Command (m for help): p
 
Disk sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1f132726
 
Device Boot Start End Blocks Id System
 
Command (m for help): n
Command action
   e extended
   p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-652, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652):
Using default value 652
 
Command (m for help): p
 
Disk sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1f132726
 
Device Boot Start End Blocks Id System
  sdb1 1 652 5237158+ 83 Linux
 
Command (m for help): w
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
Syncing disks.
[root@rac1 dev]# ls sd*
sda sda1 sda2 sdb sdb1 sdc sdd sde sdf
 
最後的結果:
 
[root@rac1 dev]# ls sd*
sda sda1 sda2 sdb sdb1 sdc sdc1 sdd sdd1 sde sde1 sdf sdf1
 
 
6. 依次建立asm磁盤 
[root@xclrac1 ~]# oracleasm createdisk DISK1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@xclrac1 ~]# oracleasm createdisk DISK2 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@xclrac1 ~]# oracleasm createdisk DISK3 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@xclrac1 ~]# oracleasm createdisk DISK4 /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@xclrac1 ~]# oracleasm createdisk DISK5 /dev/sdf1
Writing disk header: done
Instantiating disk: done
 
7. 檢查下效果 
[root@xclrac1 ~]# oracleasm listdisks
DISK1
DISK2
DISK3
DISK4
DISK5
 
8. 讓oracleasm把磁盤給找出來
[root@xclrac1 ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
 
9.配置asm 磁盤的管理用戶
[root@xclrac1 Packages]# oracleasm configure -i
Configuring the Oracle ASM library driver.
 
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
 
[root@xclrac1 Packages]# oracleasm configure
ORACLEASM_ENABLED=true
ORACLEASM_UID=oracle
ORACLEASM_GID=dba
ORACLEASM_SCANBOOT=true
ORACLEASM_SCANORDER=""
ORACLEASM_SCANEXCLUDE=""
ORACLEASM_USE_LOGICAL_BLOCK_SIZE="false"
 
    至此,這個Linux的asm就掛載成功了。 剩下的工做就是把這個OS再Clone一下。而後你就會發現。這些磁盤都能被兩個OS找到並使用了。
就能夠放心裝RAC了。
   C:\Program Files\Oracle\VirtualBox>VBoxManage.exe clonehd D:\OracleVM\OLE_RAC1\O LE_RAC1.vdi D:\OracleVM\OLE_RAC2\OLE_RAC2.vdi 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Clone hard disk created in format 'VDI'. UUID: c7f39d05-98b8-426f-8897-16a8e39ea 34f
相關文章
相關標籤/搜索