使用SecureCRT的按钮实现快速查询

背景:有这么个平常运维场景,客户因管理需求,不容许在服务器上部署任何自动化的脚本,须要人工登陆到机器上查询ASM磁盘组的使用率状况,有上百套环境。sql

使用的工具是SecureCRT,如何提高一些效率呢?服务器

其实很简单,能够在SecureCRT的工具上新建一个按钮,好比叫ASM-DISKGROUP-USAGE,内容以下:运维

sqlplus / as sysasm <<EOF\n
set lines 140\n
col name for a15\n
select name, total_mb, free_mb, type, state from v\\$asm_diskgroup;\n
EOF\n

这样只需人工登陆到grid用户,就能够点击此按钮,会自动查询出ASM磁盘组的空间使用率状况,要比EM等方式高效不少。
点击此按钮,效果以下:工具

[grid@jystdrac1 ~]$ sqlplus / as sysasm <<EOF
> set lines 140
> col name for a15
> select name, total_mb, free_mb, type, state from v\$asm_diskgroup;
> EOF

SQL*Plus: Release 11.2.0.4.0 Production on Wed Apr 29 22:58:17 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

SQL> SQL> SQL> 
NAME              TOTAL_MB    FREE_MB TYPE         STATE
--------------- ---------- ---------- ------------ ----------------------
DATA                 15360       3610 EXTERN       MOUNTED
FRA                   5120       3834 EXTERN       MOUNTED
OCR                   3072       2146 NORMAL       MOUNTED

SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
[grid@jystdrac1 ~]$

这样就能够很方便查询了,也比复制命令等方式简便,且还不容易出错。code

相关文章
相关标签/搜索