Adding / Dropping Disks From a ASM Disk Group

本文介绍了如何在Linux平台上为已存在的ASM磁盘组添加及移除磁盘的具体步骤。包括查询候选磁盘、添加磁盘并进行负载均衡操作、监控状态以及移除磁盘等过程。

磁盘组规划出现问题,需要踢出磁盘,具体添加删除步骤如下:

 

Adding / Dropping Disks From a ASM Disk Group

by Jeff Hunter, Sr. Database Administrator

Contents

 

 

Introduction

This short article provides the steps necessary to add a candidate disk to an already existing disk group on the Linux platform. It also documents the steps necessary to remove disks from a running disk group.

For the purpose of this document, I already have an existing disk group named TESTDB_DATA1. I am not using the ASMLib libraries.

Identify Candidate Disks

The current disk group configuration, (TESTDB_DATA1 and candidate disks not assigned to any disk group) has the following configuration:

$ ORACLE_SID=+ASM; export ORACLE_SID
$ sqlplus "/ as sysdba"

SELECT
    NVL(a.name, '[CANDIDATE]')      disk_group_name
  , b.path                          disk_file_path
  , b.name                          disk_file_name
  , b.failgroup                     disk_file_fail_group
FROM
    v$asm_diskgroup a RIGHT OUTER JOIN v$asm_disk b USING (group_number)
ORDER BY
    a.name;

Disk Group Name Path            File Name            Fail Group     
--------------- --------------- -------------------- ---------------
TESTDB_DATA1    /dev/raw/raw1   TESTDB_DATA1_0000    CONTROLLER1
                /dev/raw/raw2   TESTDB_DATA1_0001    CONTROLLER1
                /dev/raw/raw3   TESTDB_DATA1_0002    CONTROLLER2
                /dev/raw/raw4   TESTDB_DATA1_0003    CONTROLLER2

[CANDIDATE]     /dev/raw/raw5
                /dev/raw/raw6
                /dev/raw/raw7

In this example, I will be adding two new disks (/dev/raw/raw5 and /dev/raw/raw6) to the current disk group.

Add Disks to a Disk Group

Finally, let's add the two new disks to the disk group. This needs to be done within the ASM instance and connected as a user with SYSDBA privileges:

$ ORACLE_SID=+ASM; export ORACLE_SID
$ sqlplus "/ as sysdba"

SQL> ALTER DISKGROUP testdb_data1 ADD
  2  FAILGROUP controller1 DISK '/dev/raw/raw5'
  3  FAILGROUP controller2 DISK '/dev/raw/raw6' REBALANCE POWER 11;

Diskgroup altered.

After submitting the SQL to add the new disks to the disk group, query the dynamic performance view V$ASM_OPERATION in the ASM instance to check the status of the rebalance operation. The V$ASM_OPERATION view will return one row for every active Automatic Storage Management long running operation executing in the Automatic Storage Management instance.

SQL> SELECT group_number, operation, state, power, est_minutes FROM v$asm_operation;

GROUP_NUMBER OPERATION STATE   POWER EST_MINUTES
------------ --------- ------ ------ -----------
           1 REBAL     RUN        11           9

Continue to query this view to monitor the rebalance operation. When this row is gone, the ASM rebalance operation will be complete.

After adding the new disks, this is a new view of the disk group configuration:

Disk Group Name Path            File Name            Fail Group     
--------------- --------------- -------------------- ---------------
TESTDB_DATA1    /dev/raw/raw1   TESTDB_DATA1_0000    CONTROLLER1
                /dev/raw/raw2   TESTDB_DATA1_0001    CONTROLLER1
                /dev/raw/raw3   TESTDB_DATA1_0002    CONTROLLER2
                /dev/raw/raw4   TESTDB_DATA1_0003    CONTROLLER2
                /dev/raw/raw5   TESTDB_DATA1_0004    CONTROLLER1
                /dev/raw/raw6   TESTDB_DATA1_0005    CONTROLLER2

[CANDIDATE]     /dev/raw/raw7

Drop Disks from a Disk Group

Now, let's drop the same two new disks from the disk group. This needs to be done within the ASM instance and connected as a user with SYSDBA privileges:

$ ORACLE_SID=+ASM; export ORACLE_SID
$ sqlplus "/ as sysdba"

SQL> ALTER DISKGROUP testdb_data1 DROP
  2  DISK testdb_data1_0004, testdb_data1_0005  REBALANCE POWER 11;

Diskgroup altered.

The current disk group configuration, (TESTDB_DATA1 and candidate disks not assigned to any disk group) now has the following configuration:

Disk Group Name Path            File Name            Fail Group     
--------------- --------------- -------------------- ---------------
TESTDB_DATA1    /dev/raw/raw1   TESTDB_DATA1_0000    CONTROLLER1
                /dev/raw/raw2   TESTDB_DATA1_0001    CONTROLLER1
                /dev/raw/raw3   TESTDB_DATA1_0002    CONTROLLER2
                /dev/raw/raw4   TESTDB_DATA1_0003    CONTROLLER2

                                                  
[CANDIDATE]     /dev/raw/raw5
                /dev/raw/raw6
                /dev/raw/raw7

About the Author

Jeffrey Hunter is an Oracle Certified Professional, Java Development Certified Professional, Author, and an Oracle ACE. Jeff currently works as a Senior Database Administrator for The DBA Zone, Inc. located in Pittsburgh, Pennsylvania. His work includes advanced performance tuning, Java and PL/SQL programming, developing high availability solutions, capacity planning, database security, and physical / logical database design in a UNIX / Linux server environment. Jeff's other interests include mathematical encryption theory, tutoring advanced mathematics, programming language processors (compilers and interpreters) in Java and C, LDAP, writing web-based database administration tools, and of course Linux. He has been a Sr. Database Administrator and Software Engineer for over 20 years and maintains his own website site at: http://www.iDevelopment.info. Jeff graduated from Stanislaus State University in Turlock, California, with a Bachelor's degree in Computer Science and Mathematics.

 

<think>我们正在处理用户在使用tleap时遇到的错误:当尝试加载leaprc.GLYCAM_06j-1文件时,系统提示“is a directory”。这意味着用户可能错误地输入了一个目录路径而不是文件路径。以下将逐步解决此问题。 ### 问题分析 在AmberTools中,力场文件通常存储在`$AMBERHOME/dat/leap/cmd`目录下。用户遇到的错误通常由以下原因引起: 1. **路径输入错误**:可能将目录路径当作文件加载 2. **环境变量设置不当**:`$AMBERHOME`未正确设置 3. **文件缺失**:GLYCAM力场未正确安装 ### 解决步骤 #### 1. **验证AmberTools安装** 首先确认AmberTools已正确安装并设置了环境变量: ```bash # 检查AMBERHOME环境变量 echo $AMBERHOME # 验证tleap可执行文件 which tleap ``` 如果`$AMBERHOME`未设置,请根据安装方式配置: - 源码安装:在安装目录执行`source amber.sh`(或`amber.csh`) - 预编译版本:根据文档设置路径 #### 2. **定位GLYCAM力场文件** GLYCAM力场文件应位于: ``` $AMBERHOME/dat/leap/cmd/leaprc.GLYCAM_06j-1 ``` 使用以下命令检查文件是否存在: ```bash ls $AMBERHOME/dat/leap/cmd/leaprc.GLYCAM_06j-1 ``` 若文件不存在,则需重新安装GLYCAM力场或完整安装AmberTools。 #### 3. **正确加载命令** 在tleap中加载时**仅需文件名**,无需路径: ```tleap # 正确方式(自动搜索cmd目录) source leaprc.GLYCAM_06j-1 ``` 错误示例(绝对路径会导致目录识别错误): ```tleap source /path/to/AmberTools/dat/leap/cmd/leaprc.GLYCAM_06j-1 # 避免! ``` #### 4. **常见错误处理** | 错误现象 | 解决方案 | |---------|----------| | `File 'leaprc.GLYCAM_06j-1' not found` | 检查`$AMBERHOME/dat/leap/cmd`目录是否存在该文件 | | `is a directory` | 删除source命令中的路径前缀,仅保留文件名 | | `GLYCAM residue not recognized` | 确保加载顺序:先蛋白质力场,后糖力场[^3] | #### 5. **完整加载示例** ```tleap # 标准糖蛋白体系加载流程 source leaprc.protein.ff14SB # 先加载蛋白质力场 source leaprc.GLYCAM_06j-1 # 再加载糖力场(注意仅文件名) source leaprc.water.tip3p # 加载水模型 # 构建葡萄糖分子 glc = sequence { GL4P } savepdb glc glucose.pdb ``` ### 安装问题排查 如果确认文件缺失,需重新安装GLYCAM: 1. **AmberTools≥22用户**:GLYCAM已集成,无需单独安装 2. **旧版用户**:从[GLYCAM官网](glycam.org)下载并手动安装 ```bash # 手动安装示例(需管理员权限) cp downloaded_glycam_files/* $AMBERHOME/dat/leap/lib/ cp downloaded_glycam_files/cmd/* $AMBERHOME/dat/leap/cmd/ ``` ### 验证操作 成功加载后,在tleap中执行: ```tleap list ``` 输出应包含: ``` > Object types: GLYCAM_06j-1 force field > Residues: GL4P MAN GALP ... ``` ### 进阶提示 - **多力场混合**:同时使用蛋白质、核酸和糖力场时,加载顺序应为: 1. 通用力场(如ff14SB) 2. 专用力场(GLYCAM) 3. 溶剂模型[^3] - **参数检查**:使用`parmchk2`验证糖分子参数 ```bash parmchk2 -i glucose.pdb -f pdb -o glucose.frcmod ``` §§相关问题§§ 1. 如何解决AmberTools安装过程中出现的netcdf库链接错误?[^1] 2. tleap加载多个力场时出现参数冲突应如何解决? 3. 如何验证GLYCAM力场在糖分子模拟中的能量收敛性?</think>### 解决 "tleap source leaprc.GLYCAM_06j-1 is a directory" 错误 #### 🔍 问题原因分析 当出现 `is a directory` 错误时,通常表示: 1. **文件路径混淆**:尝试加载了目录而非文件 2. **安装不完整**:GLYCAM力场未正确安装(常见于源码编译时的库缺失问题[^1]) 3. **环境变量错误**:`$AMBERHOME` 路径配置不当 #### ✅ 逐步解决方案 ##### 步骤 1:验证 AmberTools 安装完整性 检查关键文件是否存在: ```bash # 检查GLYCAM力场文件 ls $AMBERHOME/dat/leap/cmd/leaprc.GLYCAM_06j-1 # 检查依赖库(解决引用[1]的netcdf错误) ls $AMBERHOME/include/netcdf.h ``` 若文件缺失,需重新安装。 ##### 步骤 2:修复依赖库问题(针对引用[1]的错误) ```bash # 安装缺失的ZLIB库(Ubuntu示例) sudo apt-get install zlib1g-dev # 重新编译AmberTools cd $AMBERHOME make clean ./configure -python make install ``` ##### 步骤 3:正确加载力场 在 tleap 中使用**完整路径**加载: ```tleap source $AMBERHOME/dat/leap/cmd/leaprc.GLYCAM_06j-1 ``` ##### 步骤 4:验证力场加载 ```tleap > list ``` 成功加载时输出应包含: ``` GLYCAM_06j-1 force field parameters Residues: GL4P, MAN, GALP... ``` #### ⚠️ 常见错误场景处理 | 错误场景 | 解决方案 | |---------|----------| | `File not found` | 运行 `amber.python -m pdb4amber -i` 修复安装 | | `Permission denied` | 执行 `chmod +x $AMBERHOME/dat/leap/cmd/*` | | `NetCDF link error` | 重装 netcdf 库:`conda install -c conda-forge netcdf4` | | 多力场冲突 | 加载顺序:先蛋白质力场(ff14SB),再糖力场(GLYCAM)[^3] | #### 📝 正确操作示例 ```tleap # 标准加载流程 source leaprc.protein.ff14SB source $AMBERHOME/dat/leap/cmd/leaprc.GLYCAM_06j-1 # 显式路径 # 创建糖分子 glc = sequence { GL4P } solvateBox glc TIP3PBOX 10.0 savepdb glc glucose.pdb ``` #### 🔧 预防措施 1. **安装验证**:运行测试用例 ```bash cd $AMBERHOME/test make test.serial ``` 2. **环境配置**:在 `~/.bashrc` 添加 ```bash export AMBERHOME=/path/to/amber export PATH=$AMBERHOME/bin:$PATH ``` > 💡 **提示**:AmberTools 22+ 版本已优化库依赖问题,建议升级[^2]
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值