ASM Command-Line Utility(ASMCMD)

本文详细介绍ASMCMD命令,包括目录切换、文件大小显示、文件删除等常用功能,以及Oracle专有的asmcmd命令,如列出所有连接的Oracle实例。


ASMCMD is a command-line utility that you can use to easily view and manipulate files and directories within Automatic Storage Management (ASM) disk groups. It can list the contents of disk groups, perform searches, create and remove directories and aliases, display space utilization, and more.


Table 20-1 Summary of ASM Commands

CommandDescription
cdChanges the current directory to the specified directory.
duDisplays the total disk space occupied by ASM files in the specified ASM directory and all its subdirectories, recursively.
exitExits ASMCMD.
findLists the paths of all occurrences of the specified name (with wildcards) under the specified directory.
helpDisplays the syntax and description of ASMCMD commands.
lsLists the contents of an ASM directory, the attributes of the specified file, or the names and attributes of all disk groups.
lsctLists information about current ASM clients.
lsdgLists all disk groups and their attributes.
mkaliasCreates an alias for a system-generated filename.
mkdirCreates ASM directories.
pwdDisplays the path of the current ASM directory.
rmDeletes the specified ASM files or directories.
rmaliasDeletes the specified alias, retaining the file that the alias points to.

he asmcmd utility supports all common Linux commands:

    ASMCMD> ls -alt -- list directory contents

    ASMCMD> cd -- change directory

    ASMCMD> mkdir -- create (make)directory

    ASMCMD> du -- display directory space

    ASMCMD> find -- standard UNIX find command

    ASMCMD> rm -- remove file/directory

    ASMCMD> lsdg -- list diskgroups

    ASMCMD> pwd -- display current directory

Plus, we see some Oracle-only asmcmd commands:

    ASMCMD> lsct -- list all connected Oracle instances




gcc -I. -Iinclude -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -- -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -DZLIB -DNDEBUG -MMD -MF apps/app_rand.d.tmp -MT apps/app_rand.o -c -o apps/app_rand.o apps/app_rand.c gcc -I. -Iinclude -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -- -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/usr/local/ssl\"" -DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -DZLIB -DNDEBUG -MMD -MF apps/app_rand.d.tmp -MT apps/app_rand.o -c -o apps/app_rand.o apps/app_rand.c gcc: error: unrecognized command-line option '--' gcc: error: unrecognized command-line option '--' make[1]: *** [Makefile:708: apps/app_rand.o] Error 1 make[1]: Leaving directory '/home/zhilong/openssl-1.1.1g' make[1]: *** [Makefile:708: apps/app_rand.o] Error 1 make[1]: Leaving directory '/home/zhilong/openssl-1.1.1g' make: *** [Makefile:174:all] 错误 2 make: *** [Makefile:177:build_libs] 错误 2 [1]+ 退出 2 make
最新发布
09-20
你遇到的编译错误: ``` gcc: error: unrecognized command-line option '--' ``` 出现在 OpenSSL 1.1.1g 的 `make` 构建过程中,这是 **一个典型的配置或脚本生成问题**。 --- ## ✅ 错误原因分析 关键线索是这行命令中的异常部分: ```bash gcc -I. -Iinclude ... -O3 -- -DOPENSSL_USE_NODELETE ... ``` 👉 注意这里: `-O3 -- -DOPENSSL...` - `--` 是 GCC 支持的一种语法,用于 **分隔选项和文件名**(防止文件名被误解析为选项)。 - 但在你的命令中,`--` 被错误地放在了 **宏定义之前**,变成了: ```bash -O3 -- -DOPENSSL_XXX ``` 这会导致 GCC 把后面的 `-DOPENSSL_XXX` 当作“文件名”处理,而由于前面有 `--`,GCC 认为之后不应该再出现编译选项,于是报错: > `unrecognized command-line option '--'` 但实际上这个 `--` 根本不该存在! --- ## 🔍 深入定位:为什么会出现多余的 `--`? OpenSSL 的构建系统使用 Perl 脚本来自动生成编译规则。在 `Makefile` 中你会看到类似这样的片段: ```makefile $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $< ``` 其中: - `$(CFLAGS)` 来自配置脚本生成的变量 - 如果 `CFLAGS` 或 `INCLUDES` 包含了一个孤立的 `--`,就会传给 `gcc` ### ❌ 问题根源: 你在运行 `./config` 或 `./Configure` 时,**意外传入了一个 `--` 参数**,导致它被写入 `Makefile`。 查看你的 `Makefile` 文件(搜索): ```bash grep "CFLAG\|INCLUDE" Makefile ``` 输出可能类似于: ```makefile CFLAGS=-I. -Iinclude -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -- ``` 看到了吗?最后多了一个 **孤立的 `--`**! --- ## ✅ 解决方案 ### ✅ 步骤 1:清理旧配置 ```bash make clean rm -f Makefile ``` > ⚠️ 不要只是 `make clean`,因为 `Makefile` 是由 `./config` 生成的,不会自动重建。 --- ### ✅ 步骤 2:重新配置 OpenSSL(注意不要加多余的 `--`) #### 正确方式(推荐): ```bash # 清洁地配置 OpenSSL 静态+动态库,安装到 /usr/local/ssl ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib ``` 或者如果你不需要 zlib 支持: ```bash ./config ``` 📌 **重点**:不要像这样错误调用: ```bash ./config -- # ❌ 错!会把 -- 写进 CFLAGS ./Configure linux-x86_64 -- # ❌ 同样错 ``` --- ### ✅ 步骤 3:确认 `Makefile` 中没有孤立的 `--` 检查是否修复: ```bash grep "^CFLAGS" Makefile ``` ✅ 正确输出示例: ```makefile CFLAGS=-I. -Iinclude -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 ``` ❌ 错误输出(末尾有 `--`): ```makefile CFLAGS=... -O3 -- ``` 如果有,请手动删除该 `--` 并保存文件,或重新运行正确的 `./config`。 --- ### ✅ 步骤 4:重新编译 ```bash make depend # 可选,确保依赖关系更新 make -j$(nproc) make test # 推荐测试 sudo make install ``` 现在应该能成功编译通过。 --- ## 🛠️ 补充说明:什么时候该用 `--`? `--` 在 shell 和 gcc 中合法用途如下: ```bash # 示例1:防止以 - 开头的文件名被误认为参数 gcc -o output -- -input.c # 示例2:脚本中结束选项解析 find . -name "*.c" --print ``` 但在 `CFLAGS` 中加入 `--` 是无意义且有害的,除非后面紧跟的是源文件。 --- ## ✅ 总结 | 问题 | 原因与解决方案 | |------|----------------| | `gcc: unrecognized command-line option '--'` | 因为 `./config` 时误加了 `--`,导致 `Makefile` 中 `CFLAGS` 多出一个孤立的 `--` | | 如何避免 | 配置时不加多余参数:`./config` 或 `./config --prefix=...` 即可,不要单独写 `--` | | 如何修复 | 删除 `Makefile`,重新运行正确命令 | --- ###
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值