在Oracle10g 新增ASM磁盘组

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:1113

在Oracle10g 新增ASM磁盘组

首先在虚拟机器上 添加个硬盘1G 启动后对其进行分区 每个200M
[root@rac1 ~]# fdisk /dev/sdb
我把它分成了五个200M的扩展分区:
/dev/sdb5
/dev/sdb6
/dev/sdb7
/dev/sdb8
/dev/sdb9
[root@rac1 ~]# vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdf5
/dev/raw/raw2 /dev/sdf6
/dev/raw/raw3 /dev/sdf7
/dev/raw/raw4 /dev/sdf8
/dev/raw/raw5 /dev/sdf9
[root@rac1 ~]# service rawdevices restart

[root@rac1 ~]# chown oracle:dba /dev/raw/raw[1-5]
[root@rac1 ~]# chmod 660 /dev/raw/raw[1-5]
[root@rac1 ~]# ls -lat /dev/raw/raw*
crw-rw---- 1 oracle dba 162, 5 Apr 17 10:57 /dev/raw/raw5
crw-rw---- 1 oracle dba 162, 4 Apr 17 10:57 /dev/raw/raw4
crw-rw---- 1 oracle dba 162, 3 Apr 17 10:57 /dev/raw/raw3
crw-rw---- 1 oracle dba 162, 2 Apr 17 10:57 /dev/raw/raw2
crw-rw---- 1 oracle dba 162, 1 Apr 17 10:57 /dev/raw/raw1
修改 /etc/udev/permissions.d/50-udev.permissions,使oracle能操作裸设备
[root@rac1 ~]# vi /etc/udev/permissions.d/50-udev.permissions
# raw devices
ram*:root:disk:0660
#raw/*:root:disk:0660
raw/*:oracle:dba:0660
[root@rac1 ~]# service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/sdb5
/dev/raw/raw1: bound to major 8, minor 133
/dev/raw/raw2 --> /dev/sdb6
/dev/raw/raw2: bound to major 8, minor 134
/dev/raw/raw3 --> /dev/sdb7
/dev/raw/raw3: bound to major 8, minor 135
/dev/raw/raw4 --> /dev/sdb8
/dev/raw/raw4: bound to major 8, minor 136
/dev/raw/raw5 --> /dev/sdb9
/dev/raw/raw5: bound to major 8, minor 137
创建裸设备完成后 用oracle用户登录先启动asm实例,后启动数据库
[oracle@d10031 ~]$ export ORACLE_SID=+ASM
[oracle@d10031 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 23 16:20:11 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[oracle@d10031 ~]$ export ORACLE_SID=ORCL
[oracle@d10031 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 23 16:20:28 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.

[oracle@d10031 ~]$ export ORACLE_SID=+ASM
[oracle@d10031 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jun 23 16:21:51 2008
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>alter system set asm_diskstring='ORCL:VOL*',' /dev/raw/raw*';
System altered.

SQL> select path from v$asm_disk;
PATH
--------------------------------------------------------------------------------
/dev/raw/raw1
/dev/raw/raw2
/dev/raw/raw3
/dev/raw/raw4
/dev/raw/raw5
ORCL:VOL1
ORCL:VOL2
ORCL:VOL3
ORCL:VOL4
9 rows selected.
SQL> show parameter string;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
asm_diskstring string ORCL:VOL*, /dev/raw/raw*

SQL> create diskgroup testdg external redundancy disk '/dev/raw/raw1';
Diskgroup created.
SQL> select group_number,name,state,total_mb from v$asm_diskgroup;
GROUP_NUMBER NAME STATE TOTAL_MB
------------ ------------------------------ ----------- ----------
1 DGROUP1 MOUNTED 8188
2 TESTDG MOUNTED 196
红色就是新增加的磁盘组

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】