首页  >  文章  >  数据库  >  手动创建Oracle 10g ASM磁盘组

手动创建Oracle 10g ASM磁盘组

WBOY
WBOY原创
2016-06-07 17:05:54897浏览

准备环境:Oracle 10g 联机文档、已经配置10g数据库软件的主机、oracleasm library rpm包、2块5GB硬盘1、 查看本机磁盘信息[roo

准备环境:

Oracle 10g 联机文档、已经配置10g数据库软件的主机、oracleasm library rpm包、2块5GB硬盘

1、  查看本机磁盘信息

[root@shiyueasm~]# 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   *        307        1958    13269690  83  Linux

/dev/sda2               1         306    2457913+  82 Linux swap

 

Partitiontable entries are not in disk order

 

Disk/dev/sdb: 10.7 GB, 10737418240 bytes

255heads, 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: 5368 MB, 5368709120 bytes

255heads, 63 sectors/track, 652 cylinders

Units =cylinders of 16065 * 512 = 8225280 bytes

 

Disk/dev/sdc doesn't contain a valid partition table

 

Disk/dev/sdd: 5368 MB, 5368709120 bytes

255heads, 63 sectors/track, 652 cylinders

Units =cylinders of 16065 * 512 = 8225280 bytes

 

Disk /dev/sdd doesn't contain a validpartition table

2、  对新添加的2块磁盘进行分区

[root@shiyueasm~]# fdisk /dev/sdc

Devicecontains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Buildinga new DOS disklabel. Changes will remain in memory only,

until youdecide to write them. After that, of course, the previous

contentwon't be recoverable.

 

Warning:invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

Command(m for help): n

Commandaction

   e  extended

   p  primary partition (1-4)

p

Partitionnumber (1-4): 1

Firstcylinder (1-652, default 1):

Usingdefault value 1

Lastcylinder or +size or +sizeM or +sizeK (1-652, default 652):

Usingdefault value 652

 

Command(m for help): w

Thepartition table has been altered!

 

Callingioctl() to re-read partition table.

Syncingdisks.

[root@shiyueasm~]# fdisk /dev/sdd

Devicecontains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Buildinga new DOS disklabel. Changes will remain in memory only,

until youdecide to write them. After that, of course, the previous

contentwon't be recoverable.

 

Warning:invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

 

Command(m for help): n

Commandaction

   e  extended

   p  primary partition (1-4)

p

Partitionnumber (1-4): 1

Firstcylinder (1-652, default 1):

Usingdefault value 1

Lastcylinder or +size or +sizeM or +sizeK (1-652, default 652):

Usingdefault value 652

 

Command(m for help): w

Thepartition table has been altered!

 

Callingioctl() to re-read partition table.

Syncing disks.

 

3、  上传 oracle asmlibrary rpm包并对上传的包进行安装

[root@shiyueasmu01]# cd asm\ rpm\ for\ rhel4.0/

[root@shiyueasmasm rpm for rhel4.0]# ll

total 236

-rw-r--r--  1 root root 129218 Apr 29  2010oracleasm-2.6.9-42.ELsmp-2.0.3-1.i686.rpm

-rw-r--r--  1 root root 13105 Apr 29  2010oracleasmlib-2.0.4-1.el4.i386.rpm

-rw-r--r--  1 root root 82542 Apr 29  2010oracleasm-support-2.1.3-1.el4.i386.rpm

[root@shiyueasmasm rpm for rhel4.0]# rpm -ivh *

warning:oracleasmlib-2.0.4-1.el4.i386.rpm: V3 DSA signature: NOKEY, key ID b38a8516

准备中...               ########################################## [100%]

   1:oracleasm 支持     ############################################ #[33%]

  2:oracleasm-2.6.9-42.ELsm#################################### ####### [67%]

   3:oracleasmlib          ############################################ [ 100%]

 

4、 配置ASM驱动

[root@shiyueasm~]# /etc/init.d/oracleasm configure

配置 Oracle ASM 库驱动程序。

 

这将配置 Oracle ASM 库的启动属性

司机。  以下问题将决定司机是否

在启动时加载以及它将拥有哪些权限。 当前值

将显示在方括号('[]')中。  按键无需输入

答案将保持当前值。  Ctrl-C 将中止。

 

拥有驱动程序接口的默认用户[]:oracle

拥有驱动程序接口的默认组[]:oinstall

启动时启动Oracle ASM 库驱动程序 (y/n) [n]: y

启动时扫描 Oracle ASM 磁盘 (y/n) [y]:

编写 Oracle ASM 库驱动程序配置:完成

初始化 Oracle ASMLib 驱动程序:[  OK  ]

扫描系统中的 Oracle ASMLibdisks:[  OK  ]

5、创建ASM磁盘组

[root@shiyueasm~]# /etc/init.d/oracleasm createdisk VOL01 '/dev/sdc1'

将磁盘“VOL02”标记为 ASM 磁盘:[ 确定 ]

[root@shiyueasm~]# /etc/init.d/oracleasm createdisk VOL02 '/dev/sdd1'

将磁盘“VOL01”标记为 ASM 磁盘:[  OK  ]

6、手动创建磁盘组参数文件

[oracle@shiyueasm~]$ cd $ORACLE_HOME/dbs

[oracle@shiyueasmdbs]$ ll

共48个

-rw-r--r--  1 oracle oinstall   934 5 月 26 日 10:52 db.sql

-rw-rw---- 1 oracle oinstall 1544 5 月 26 日 10:32 hc_shiyue.dat

-rw-r----- 1 oracle oinstall 12920 May 3 2001initdw.ora

-rw-r----- 1 oracle oinstall 8385 1998 年 9 月 11 日 init.ora

-rw-r--r--  1 oracle oinstall   996 5 月 26 日 10:31 initshiyue.ora

-rw-rw----  1 oracle oinstall    5 月 26 日 24 日 10:52 lkSHIYUE

-rw-r-----  1 oracle oinstall  1536 5 月 26 日 10:32 orapwshiyue

[oracle@shiyueasm dbs]$ viinit ASM.ora

asm_diskstring=''

background_dump_dest=/u01/admin/shiyueasm/bdump

core_dump_dest=/u01/admin/shiyueasm/cdump

user_dump_dest=/u01/admin/shiyueasm/udump

instance_type='asm'

large_pool_size=20m

remote_login_passwordfile='共享'

7、 创建相关目录

[oracle@shiyueasm~]$ mkdir -p /u01/admin/shiyueasm/bdump

[oracle@shiyueasm~]$ mkdir -p /u01/admin/shiyueasm/cdump

[oracle@shiyueasm ~]$ mkdir -p/u01/admin/shiyueasm/udump

8、  切换至 ASM 实例

[oracle@shiyueasm ~]$ export ORACLE_SID= ASM

手动创建Oracle 10g ASM磁盘组

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn