Oracle RAC环境下ASM磁盘组扩容

标签: Oracle RAC
8人阅读 评论(0) 收藏 举报
分类:

Oracle RAC环境下ASM磁盘组扩容

​实验环境:
操作系统环境 :OEL 3.8.13-68.3.4.el6uek.x86_64
数据库环境 :11.2.0.4 GRID及DATABASE

实验目的:
存储空间不足,需要给磁盘组DATA加一块磁盘,而后观察是否运行正常


**********准备工作**********

1.检查各个节点database、asm及grid日志是否有错误信息

SQL> select instance_name,host_name,startup_time,status from gv$instance;

INSTANCE_NAME HOST_NAME STARTUP_TIME STATUS
---------------- ---------------------------------------------------------------- ------------------- -----------
+ASM1 node01 2018-04-16 12:53:15 STARTED
+ASM2 node02 2018-04-16 13:00:58 STARTED

SQL> select instance_name,host_name,startup_time,status from gv$instance;

INSTANCE_NAME HOST_NAME STARTUP_TIME STATUS
---------------- ---------------------------------------------------------------- ------------------- ------------
racdb1 node01 2018-04-16 13:51:24 OPEN
racdb2 node02 2018-04-16 13:51:28 OPEN

检查node01和node02节点数据库、ASM及grid日志是否有错误信息

2.ASM磁盘组及磁盘检查

SQL> select * from gv$asm_client order by 1,2;

   INST_ID GROUP_NUMBER INSTANCE_NAME DB_NAME STATUS SOFTWARE_VERSION COMPATIBLE_VERSION
---------- ------------ ------------------------------ -------- ------------ ------------------------------ ------------------------------
  1 1 +ASM1 +ASM CONNECTED 11.2.0.4.0 11.2.0.4.0
  1 2 +ASM1 +ASM CONNECTED 11.2.0.4.0 11.2.0.4.0
  1 2 racdb1 racdb CONNECTED 11.2.0.4.0 11.2.0.4.0
  2 1 +ASM2 +ASM CONNECTED 11.2.0.4.0 11.2.0.4.0
  2 2 +ASM2 +ASM CONNECTED 11.2.0.4.0 11.2.0.4.0
  2 2 racdb2 racdb CONNECTED 11.2.0.4.0 11.2.0.4.0

SQL> select group_number,name,state,type,total_mb,free_mb,usable_file_mb,allocation_unit_size/1024/1024 unit_mb from v$asm_diskgroup order by 1;

GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB USABLE_FILE_MB UNIT_MB
------------ -------------------- ----------- ------ ---------- ---------- -------------- ----------
    1 OCR_VF MOUNTED NORMAL 6144 5218 1585 1
    2 DATA MOUNTED EXTERN 8192 5740 5740 1

SQL> select group_number,name,path,mount_status,state,redundancy,total_mb,free_mb,failgroup,create_date from v$asm_disk order by 1,2;

GROUP_NUMBER NAME PATH MOUNT_S STATE REDUNDA TOTAL_MB FREE_MB FAILGROUP CREATE_DATE
------------ -------------------- ------------------------------ ------- -------- ------- ---------- ---------- -------------------- -------------------
    1 OCR_VF_0000 /dev/asm-diskb CACHED NORMAL UNKNOWN 2048 1739 OCR_VF_0000 2018-04-16 12:50:33
    1 OCR_VF_0001 /dev/asm-diskc CACHED NORMAL UNKNOWN 2048 1739 OCR_VF_0001 2018-04-16 12:50:33
    1 OCR_VF_0002 /dev/asm-diskd CACHED NORMAL UNKNOWN 2048 1740 OCR_VF_0002 2018-04-16 12:50:33
    2 DATA_0000 /dev/asm-diske CACHED NORMAL UNKNOWN 4096 2871 DATA_0000 2018-04-16 13:10:07
    2 DATA_0001 /dev/asm-diskf CACHED NORMAL UNKNOWN 4096 2869 DATA_0001 2018-04-16 13:10:07

3.系统层面记录UDEV结果

[root@node01 ~]# cat /etc/udev/rules.d/99-oracle-asmdisks.rules
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB1ed55b97-19b7f780", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBacfab6a9-29b2beda", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB70280fd2-8b5bc96a", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBfb27a599-aec3c0fe", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB7ee690ce-ab92de29", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"

[root@node01 ~]# ll /dev/asm-disk*
brw-rw---- 1 grid asmadmin 8, 16 Apr 16 14:49 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8, 32 Apr 16 14:49 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8, 48 Apr 16 14:49 /dev/asm-diskd
brw-rw---- 1 grid asmadmin 8, 64 Apr 16 14:49 /dev/asm-diske
brw-rw---- 1 grid asmadmin 8, 80 Apr 16 14:49 /dev/asm-diskf

************数据库层面工作************

4.停止对应数据库的业务

此处不做赘述

5.检查数据库会话及停止监听

SQL> select * from v$session;

检查是否还有应用连接数据库,如果没有则停止监听
检查各个节点监听状态

[grid@node02 ~]$ srvctl status listener -n node01
Listener LISTENER is enabled on node(s): node01
Listener LISTENER is running on node(s): node01
[grid@node02 ~]$ srvctl status listener -n node02
Listener LISTENER is enabled on node(s): node02
Listener LISTENER is running on node(s): node02

禁止监听自启动

[grid@node02 ~]$ srvctl disable listener -n node01
[grid@node02 ~]$ srvctl disable listener -n node02

停止监听

[grid@node02 ~]$ srvctl stop listener -n node01
[grid@node02 ~]$ srvctl stop listener -n node02

查看停止及关闭自启后的监听状态

[grid@node02 ~]$ srvctl status listener -n node01
Listener LISTENER is disabled on node(s): node01
Listener LISTENER is not running on node(s): node01
[grid@node02 ~]$ srvctl status listener -n node02
Listener LISTENER is disabled on node(s): node02
Listener LISTENER is not running on node(s): node02

6.关闭数据库

检查数据库状态

[grid@node02 ~]$ srvctl status database -d racdb
Instance racdb1 is running on node node01
Instance racdb2 is running on node node02

检查数据库配置

[grid@node02 ~]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/11.2.0.4/dbhome_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Database is administrator managed

禁止数据库自启动(需切换root用户)

[root@node02 bin]# ./srvctl disable database -d racdb

关闭数据库

[grid@node02 ~]$ srvctl stop database -d racdb

检查关闭后数据库状态

[grid@node02 ~]$ srvctl status database -d racdb
Instance racdb1 is not running on node node01
Instance racdb2 is not running on node node02

7.关闭集群软件

查看各个节点集群是否为自启动

[root@node01 bin]# ./crsctl config has
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@node02 bin]# ./crsctl config has
CRS-4622: Oracle High Availability Services autostart is enabled.

禁止各个节点的自启动

[root@node01 bin]# ./crsctl disable has
CRS-4621: Oracle High Availability Services autostart is disabled.
[root@node02 bin]# ./crsctl disable has
CRS-4621: Oracle High Availability Services autostart is disabled.

查看各个节点禁止自启动是否生效

[root@node01 bin]# ./crsctl config has
CRS-4621: Oracle High Availability Services autostart is disabled.
[root@node02 bin]# ./crsctl config has
CRS-4621: Oracle High Availability Services autostart is disabled.

停止各个节点集群

[root@node01 bin]# ./crsctl stop has
[root@node02 bin]# ./crsctl stop has

查看各个节点是否还有后台进程

[grid@node01 ~]$ ps -ef | grep css
grid 6888 31689 0 15:12 pts/0 00:00:00 grep css
[grid@node01 ~]$ ps -ef | grep crs
grid 6893 31689 0 15:12 pts/0 00:00:00 grep crs
[grid@node01 ~]$ ps -ef | grep asm
grid 6895 31689 0 15:12 pts/0 00:00:00 grep asm

***************OS层面工作***************

8.系统添加共享磁盘后测试及重启

此处不做赘述

9.各个节点使用UDEV添加磁盘

[root@node01 ~]# cat /etc/udev/rules.d/99-oracle-asmdisks.rules
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB1ed55b97-19b7f780", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBacfab6a9-29b2beda", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB70280fd2-8b5bc96a", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBfb27a599-aec3c0fe", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB7ee690ce-ab92de29", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"
KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBee83e2f5-8316b596", NAME="asm-diskg", OWNER="grid", GROUP="asmadmin", MODE="0660"
[root@node01 ~]# ll /dev/asm-disk*
brw-rw---- 1 grid asmadmin 8, 16 Apr 16 15:18 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8, 32 Apr 16 15:18 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8, 48 Apr 16 15:18 /dev/asm-diskd
brw-rw---- 1 grid asmadmin 8, 64 Apr 16 15:18 /dev/asm-diske
brw-rw---- 1 grid asmadmin 8, 80 Apr 16 15:18 /dev/asm-diskf
brw-rw---- 1 grid asmadmin 8, 96 Apr 16 15:23 /dev/asm-diskg

确保各个节点可以识别到磁盘且一致

**********数据库层面工作*********

10.启动集群

[root@node01 ~]# cd /u01/app/ghome/grid/bin/
[root@node01 bin]# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.
[root@node02 ~]# cd /u01/app/ghome/grid/bin/
[root@node02 bin]# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.

11.检查集群的各个组件是否启动正常

此处不做赘述

12.ASM扩容

检查asm是否识别到未添加的磁盘

SQL> select group_number,name,state,type,total_mb,free_mb,usable_file_mb,allocation_unit_size/1024/1024 unit_mb from v$asm_diskgroup order by 1;

GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB USABLE_FILE_MB UNIT_MB
------------ -------------------- ----------- ------ ---------- ---------- -------------- ----------
    1 DATA MOUNTED EXTERN 8192 5740 5740 1
    2 OCR_VF MOUNTED NORMAL 6144 5218 1585 1

SQL> select group_number,name,path,mount_status,state,redundancy,total_mb,free_mb,failgroup,create_date from v$asm_disk order by 1,2;

GROUP_NUMBER NAME PATH MOUNT_S STATE REDUNDA TOTAL_MB FREE_MB FAILGROUP CREATE_DA
------------ -------------------- ------------------------------ ------- -------- ------- ---------- ---------- ------------------------------ ---------
    0 /dev/asm-diskg CLOSED NORMAL UNKNOWN 0 0
    1 DATA_0000 /dev/asm-diske CACHED NORMAL UNKNOWN 4096 2871 DATA_0000 16-APR-18
    1 DATA_0001 /dev/asm-diskf CACHED NORMAL UNKNOWN 4096 2869 DATA_0001 16-APR-18
    2 OCR_VF_0000 /dev/asm-diskb CACHED NORMAL UNKNOWN 2048 1739 OCR_VF_0000 16-APR-18
    2 OCR_VF_0001 /dev/asm-diskc CACHED NORMAL UNKNOWN 2048 1739 OCR_VF_0001 16-APR-18
    2 OCR_VF_0002 /dev/asm-diskd CACHED NORMAL UNKNOWN 2048 1740 OCR_VF_0002 16-APR-18

给磁盘组DATA添加磁盘

SQL> alter diskgroup DATA add disk '/dev/asm-diskg' rebalance power 10;

Diskgroup altered.

如果添加时间过长,可查看v$asm_operation来观察进度。

检查添加结果

SQL> select group_number,name,path,mount_status,state,redundancy,total_mb,free_mb,failgroup,create_date from v$asm_disk order by 1,2;

GROUP_NUMBER NAME PATH MOUNT_S STATE REDUNDA TOTAL_MB FREE_MB FAILGROUP CREATE_DA
------------ -------------------- ------------------------------ ------- -------- ------- ---------- ---------- ------------------------------ ---------
    1 DATA_0000 /dev/asm-diske CACHED NORMAL UNKNOWN 4096 3276 DATA_0000 16-APR-18
    1 DATA_0001 /dev/asm-diskf CACHED NORMAL UNKNOWN 4096 3277 DATA_0001 16-APR-18
    1 DATA_0002 /dev/asm-diskg CACHED NORMAL UNKNOWN 4096 3281 DATA_0002 16-APR-18
    2 OCR_VF_0000 /dev/asm-diskb CACHED NORMAL UNKNOWN 2048 1739 OCR_VF_0000 16-APR-18
    2 OCR_VF_0001 /dev/asm-diskc CACHED NORMAL UNKNOWN 2048 1739 OCR_VF_0001 16-APR-18
    2 OCR_VF_0002 /dev/asm-diskd CACHED NORMAL UNKNOWN 2048 1740 OCR_VF_0002 16-APR-18

6 rows selected.

SQL> select group_number,name,state,type,total_mb,free_mb,usable_file_mb,allocation_unit_size/1024/1024 unit_mb from v$asm_diskgroup order by 1;


GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB USABLE_FILE_MB UNIT_MB
------------ -------------------- ----------- ------ ---------- ---------- -------------- ----------
    1 DATA MOUNTED EXTERN 12288 9834 9834 1
    2 OCR_VF MOUNTED NORMAL 6144 5218 1585 1

13.启动数据库

[grid@node01 ~]$ srvctl status database -d racdb
Instance racdb1 is running on node node01
Instance racdb2 is running on node node02

至此,扩容成功

查看评论

Oracle 11g 第一季 Oracle基础

Oracle 11g是在推出的最新数据库软件,Oracle 11g提供了高性能、伸展性、可用性和安全性,并能更方便地在低成本服务器和存储设备组成的网格上运行 。 主讲内容: 第一讲 Oracle概述 第二讲 Oracle体系结构 第三讲 SQL PLUS概述 第四讲 SET命令 第五讲 HELP、DESCRIBE、SPOOL命令 第六讲 其他常用命令
  • 2017年02月23日 19:55

LINUX 11G RAC ASM磁盘组在线增加磁盘扩容

LINUX 11G RAC ASM磁盘组在线增加磁盘扩容 1.操作系统版本 OEL 6.1 [root@cqltjcpt1 ~]# more /etc/redhat-release Red Hat...
  • Evils798
  • Evils798
  • 2012-11-20 15:32:22
  • 13273

oracle 10g rac asm磁盘组增加硬盘

环境:rhel4.4 ,oracle 10gR2 两个节点  rac1  rac2 SQL> select name from v$asm_diskgroup; NAME ------...
  • Joehlc
  • Joehlc
  • 2012-10-12 08:53:50
  • 3454

oracle rac的磁盘组添加磁盘扩容

asm添加磁盘1:创建共享磁盘组2:查看新的磁盘fdisk -l显示是/dev/sdi  8G2:绑定设备需要添加的为/dev/sdc,/dev/sdd 时,将脚本修改为 for i in c d 即...
  • weeknd
  • weeknd
  • 2018-03-01 16:27:14
  • 116

10grac ASM磁盘组添加和删除磁盘

10grac ASM磁盘组添加和删除磁盘 10grac 已经升级到10.2.0.5 linux 5.8 操作系统 两个节点 rac1,rac2 实验步骤 1)创建一块共享磁盘...
  • huoshuyinhua
  • huoshuyinhua
  • 2016-03-07 10:15:45
  • 1016

Oracle ASM 磁盘组添加磁盘

1.链接存储,确保操作系统能发现设备1 2.更改存储设备文件的属性    chown grid:oinstall /dev/mxxxxx 3.确保ASM实例的磁盘发现路径包括新增加的存储设备 ...
  • wenhuiqiao
  • wenhuiqiao
  • 2011-12-13 16:52:38
  • 3938

11g Oracle DBCA时找不到ASM磁盘组

由于11g 的ASM部分交于grid用户管理,所以oracle用户的要在asmdba组中才能有权限管理。 问题的原因是前面创建oracle用户时使用了Oracle linux的自动安装包创建的,他不...
  • tanqingru
  • tanqingru
  • 2014-03-28 14:38:27
  • 2412

oracle RAC如何正确地删除ASM磁盘组

1.检查确认要删除的磁盘组是否在用 select * from dba_data_files; select * from dba_temp_files; select * from v$log...
  • zengxuewen2045
  • zengxuewen2045
  • 2017-10-13 20:16:43
  • 509

挂载ASM磁盘组

10g [oracle@rac1 bdump]$ export ORACLE_SID=+ASM1 [oracle@rac1 bdump]$ sqlplus / as sysdba SQL*Plus: ...
  • songyundong1993
  • songyundong1993
  • 2017-05-08 08:53:48
  • 1475

Oracle 11.2.0.1 RAC ASM磁盘组全部丢失后的恢复

1.查看ASM与磁盘对应关系 [root@rac1 ~]# oracleasm querydisk /dev/sdb1 Device "/dev/sdb1" is marked an ASM di...
  • u011616400
  • u011616400
  • 2015-01-04 12:40:52
  • 1114
    个人资料
    等级:
    访问量: 79
    积分: 60
    排名: 165万+
    文章分类
    文章存档