首页 > 数据库 >oracle RAC加盘踢盘

oracle RAC加盘踢盘

时间:2024-04-23 17:13:37浏览次数:26  
标签:mapper RAC dev grid SQL oracle path 加盘 root

环境:
OS:Centos 7
db:12CR2

 

1.主机层面加盘
虚拟机加盘需要停掉数据库和主句,生产环境之间划分lun给到主机,不需要重启.
multipath -ll 找到新加磁盘的UUID

 

2.配置多路径
每个节点上都要操作

[root@rac02 ~]# more /etc/multipath.conf 
blacklist {
    devnode "^sda"
}
defaults {
    user_friendly_names yes
    path_grouping_policy multibus
    failback immediate
    no_path_retry fail
}

multipaths {
       multipath {
               wwid                    VBOX_HARDDISK_VB00234d6f-80cec2bf
               alias                   ocrdisk01
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    VBOX_HARDDISK_VBbad719ae-a07de7a5
               alias                   datadisk01
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    VBOX_HARDDISK_VB76f10276-8a519e24
               alias                   redodisk01
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    VBOX_HARDDISK_VBbee132b8-6b532b27
               alias                   datadisk02
               path_grouping_policy    multibus
       }
       multipath {
               wwid                    VBOX_HARDDISK_VB20c3a1a6-36f1c22d
               alias                   redodisk02
               path_grouping_policy    multibus
       }
}

 

3.多路径重新加载
[root@rac01 ~]# multipath -r
[root@rac02 ~]# multipath -r

 

4.修改设备权限
修改文件/etc/udev/rules.d/99-oracle-asmdevices.rules
2个节点都需要操作

[root@rac01 rules.d]# more 99-oracle-asmdevices.rules 
ENV{DM_NAME}=="ocrdisk01", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="datadisk01", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="redodisk01", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="datadisk02", OWNER:="grid", GROUP:="asmadmin", MODE:="660"
ENV{DM_NAME}=="redodisk02", OWNER:="grid", GROUP:="asmadmin", MODE:="660"

 

重新加载规则文件(磁盘权限修改为grid)
2个节点都需要操作

[root@rac01 rules.d]# ls -al /dev/dm*
brw-rw---- 1 root disk     253, 0 Apr 23 17:40 /dev/dm-0
brw-rw---- 1 grid asmadmin 253, 1 Apr 23 18:21 /dev/dm-1
brw-rw---- 1 root disk     253, 2 Apr 23 18:17 /dev/dm-2
brw-rw---- 1 grid asmadmin 253, 3 Apr 23 18:21 /dev/dm-3
brw-rw---- 1 grid asmadmin 253, 4 Apr 23 18:21 /dev/dm-4
brw-rw---- 1 root disk     253, 5 Apr 23 18:17 /dev/dm-5

 

[root@rac01 rules.d]# udevadm trigger
若该命令不管用,可以执行如下命令


[root@localhost ~]#/sbin/udevadm control --reload
[root@localhost ~]# /sbin/udevadm trigger --type=devices --action=change
[root@localhost bin]# udevadm trigger

 

5.加盘
在其中一个节点操作即可,必须使用sysasm方式登录,如下步骤相同

su - grid
connect / as sysasm
set linesize 1000;
column group_number format 99;
column name format a16;
column path format a32;
column total_mb format 999999999;
column free_mb format 999999999;
column mount_status format a16;
column header_status format a16;
column mode_status format a16;

SQL> select group_number,name,path,total_mb,free_mb,mount_status,header_status,mode_status from v$asm_disk  order by group_number desc;

GROUP_NUMBER NAME             PATH                               TOTAL_MB    FREE_MB MOUNT_STATUS     HEADER_STATUS    MODE_STATUS
------------ ---------------- -------------------------------- ---------- ---------- ---------------- ---------------- ----------------
           3 REDO_0000        /dev/mapper/redodisk01                10240       9348 CACHED           MEMBER           ONLINE
           2 OCR_0000         /dev/mapper/ocrdisk01                 40960       6420 CACHED           MEMBER           ONLINE
           1 DATA_0000        /dev/mapper/datadisk01                10240       2980 CACHED           MEMBER           ONLINE
           0                  /dev/mapper/redodisk02                    0          0 CLOSED           CANDIDATE        ONLINE
           0                  /dev/mapper/datadisk02                    0          0 CLOSED           CANDIDATE        ONLINE


SQL> select group_number,name,state,type,total_mb,free_mb from v$asm_diskgroup;

GROUP_NUMBER NAME             STATE                  TYPE           TOTAL_MB    FREE_MB
------------ ---------------- ---------------------- ------------ ---------- ----------
           1 DATA             MOUNTED                EXTERN            10240       2980
           2 OCR              MOUNTED                EXTERN            40960       6420
           3 REDO             MOUNTED                EXTERN            10240       9348

SQL> alter diskgroup DATA add disk '/dev/mapper/datadisk02';

Diskgroup altered.

SQL> alter diskgroup REDO add disk '/dev/mapper/redodisk02';

Diskgroup altered.

 

6.磁盘均衡(rebalance)
只在一个节点上操作

SQL>alter diskgroup DATA rebalance power 4;
SQL>alter diskgroup REDO rebalance power 4;

查看进度:
SQL> select * from v$asm_operation;

no rows selected

 

 

7.剔除旧磁盘
只在一个节点上操作

SQL> alter diskgroup DATA drop disk 'DATA_0000';

Diskgroup altered.

SQL> alter diskgroup REDO drop disk 'REDO_0000';

Diskgroup altered.

剔除后查看磁盘状态,需要等待一会MOUNT_STATUS状态才会变成closed

SQL>  select group_number,name,path,total_mb,free_mb,mount_status,header_status,mode_status from v$asm_disk  order by group_number desc;

GROUP_NUMBER NAME             PATH                               TOTAL_MB    FREE_MB MOUNT_STATUS     HEADER_STATUS    MODE_STATUS
------------ ---------------- -------------------------------- ---------- ---------- ---------------- ---------------- ----------------
           3 REDO_0001        /dev/mapper/redodisk02                10240       9348 CACHED           MEMBER           ONLINE
           2 OCR_0000         /dev/mapper/ocrdisk01                 40960       6420 CACHED           MEMBER           ONLINE
           1 DATA_0001        /dev/mapper/datadisk02                10240       2980 CACHED           MEMBER           ONLINE
           0                  /dev/mapper/datadisk01                    0          0 CLOSED           FORMER           ONLINE
           0                  /dev/mapper/redodisk01                    0          0 CLOSED           FORMER           ONLINE
          

 

8.回收磁盘
修改多路径配置并reload和修改udev权限规则文件,把剔除的盘去掉.

 

9.说明
建议添加的磁盘大小与原有的大小保持一致,不过比原来磁盘大或是小一些(空间大小能能存储原有数据的情况下)也是可以的.

 

标签:mapper,RAC,dev,grid,SQL,oracle,path,加盘,root
From: https://www.cnblogs.com/hxlasky/p/18153269

相关文章

  • trace报错ORA-01565 ORA-00204 ORA-00202 ORA-15081
    项目环境:OS:Oraclelinux7.9grid版本:12.2.0.1Oracle版本:12.2.0.1故障现象:两个节点只能同时open一个节点,启动另一个节点时报错,不能访问磁盘组并且在实例trace日志中有报错ORA-01565......
  • Oracle数据库出现WARNING: too many parse errors告警的分析思路
    Oracle数据库的告警日志中出WARNING:toomanyparseerrors这些告警信息的话,如果遇到这个问题,我们应该如何分析呢?下面简单聊一下如何分析这个错误。该告警信息其实是12.2版本中的一个特性增强。在以前的Oracle版本中,数据库出现了解析错误时,数据库的alert日志中不会有任何相关的......
  • Oracle OCR,Vote disk故障恢复方案
     Oracle OCR,Votedisk故障恢复方案 1  概述OCR/Votedisk磁盘组故障场景恢复操作方案。测试版本:11.2.0.4.0适用于以下场景:操作维护OCR/Votedisk对应的磁盘组,提前备份了OCR文件信息,以便存在回退维护的空间。由于某些原因导致OCR/Votedisk的磁盘组丢失从而......
  • TIMESTAMP WITH TIME ZONE in PG and Oracle
    BothOracleandPostgreSQLsupporttheTIMESTAMPWITHTIMEZONEdatatype,buttherearesomedifferencesinhowtheyhandleandstoretimezoneinformation.Storage:Oracle:InOracle,TIMESTAMPWITHTIMEZONEvaluesarestoredinUTCinternally.Thet......
  • ORACLE定时器,执行周期设定
    对于DBA来说,数据库Job再熟悉不过了,因为经常要数据库定时的自动执行一些脚本,或做数据库备份,或做数据的提炼,或做数据库的性能优化,包括重建索引等等的工作。但是,Oracle定时器Job时间的处理上,千变万化,今天我把比较常用写法汇总如下:在总结之前,先把Job的参数一一说明一下:job参数是由Su......
  • Practice
    18.链表只能一个接着一个遍历,不允许通过随机访问7.链表的地址是连续的,通过内部的指针来进行访问//假设该链表只给出了头指针head。在不改变链表的前提下,请设计一个尽可能高效的算法,//查找链表中倒数第k(k为正整数)个位置上的结点。若查找成功,算法输出该结点的data值,并返回......
  • 使用pytesseract库识别图形验证码的简单案例
    importrequestsfromPILimportImageimportpytesseract#获取验证码图片url='http://jw.glutnn.cn/academic/getCaptcha.do?captchaCheckCode=0&random=0.20354331774429668'response=requests.get(url)#保存验证码图片withopen('captcha.png',&......
  • oracle 修改密码不过期
    1.以sysdba身份进入sqlplus模式 2.查看用户密码的有效期设置一般默认的配置文件是DEFAULTSELECT*FROMdba_profilesWHEREprofile='DEFAULT'ANDresource_name='PASSWORD_LIFE_TIME';3.将密码有效期修改成“无限期”ALTERPROFILEDEFAULTLIMITPASSWORD_LIFE_TIM......
  • oracel触发器
    1.创建测试表 首先,创建一个名为SAMPLE_TABLE的简单测试表,包含两个字段:ID和DATA。CREATETABLESAMPLE_TABLE(IDNUMBERPRIMARYKEY,DATAVARCHAR2(50));2.创建触发器对应的审计日志表及辅助序列 创建一个名为AUDIT_LOG的表,用于记录触发器触发时的相关信息。 这......
  • Oracle JDK 和 OpenJDK 有什么区别?
    OpenJDK是Sun在2006年末把Java开源而形成的项目,这里的“开源”是通常意义上的源码开放形式,即源码是可被复用的,例如IcedTea、UltraViolet都是从OpenJDK源码衍生出的发行版。OracleJDK采用了商业实现,而OpenJDK使用的是开源的FreeType。当然,“相同”是建立在两者共有的组件基础上的,O......