asmcmd命令的使用

来源:互联网 发布:房屋格局设计软件 编辑:程序博客网 时间:2024/05/29 19:06

 

asmcmd交互模式下,命令的使用总结:

 

ASMCMD> du

Used_MB      Mirror_used_MB

   4160                8409

显示已使用的空间

显示客户端已经打开的文件

ASMCMD> lsof

DB_Name  Instance_Name  Path                                            

orclasm  orclasm        +data/orclasm/controlfile/current.273.928159689 

orclasm  orclasm        +data/orclasm/controlfile/current.274.928159685 

orclasm  orclasm        +data/orclasm/datafile/sysaux.270.928159517     

orclasm  orclasm        +data/orclasm/datafile/system.269.928159515     

orclasm  orclasm        +data/orclasm/datafile/ts_hdp.283.928321325     

orclasm  orclasm        +data/orclasm/datafile/undotbs1.271.928159517   

orclasm  orclasm        +data/orclasm/datafile/users.272.928159517       

orclasm  orclasm        +data/orclasm/onlinelog/group_1.275.928159697   

orclasm  orclasm        +data/orclasm/onlinelog/group_1.276.928159703   

orclasm  orclasm        +data/orclasm/onlinelog/group_2.277.928159709   

orclasm  orclasm        +data/orclasm/onlinelog/group_2.278.928159717   

orclasm  orclasm        +data/orclasm/onlinelog/group_3.279.928159725   

orclasm  orclasm        +data/orclasm/onlinelog/group_3.280.928159731   

orclasm  orclasm        +data/orclasm/tempfile/temp.281.928159759 

返回asm实例的spfile     

ASMCMD> spget

+DATA/asm/asmparameterfile/registry.253.928153389

ASMCMD> shutdown

ORA-15097: cannot SHUTDOWN ASM instance with connected client (process 2708)

新建目录

ASMCMD> cd data

ASMCMD> ls

ASM/

ORCLASM/

ASMCMD> pwd

+data

ASMCMD> mkdir hdp

ASMCMD> ls

 

ASM/

ORCLASM/

hdp/

ASMCMD>

 

 

拷贝spfile

查看asm 实例 spfile文件的位置:

ASMCMD> spget

+DATA/asm/asmparameterfile/registry.253.928153389

 

 

ASMCMD> cp re* /home/grid

copying +data/asm/ASMPARAMETERFILE/REGISTRY.253.928153389 -> /home/grid/REGISTRY.253.928153389

ASMCMD-8016: copy source->'+data/asm/ASMPARAMETERFILE/REGISTRY.253.928153389' and target->'/home/grid/REGISTRY.253.928153389' failed

ORA-19505: failed to identify file "+data/asm/ASMPARAMETERFILE/REGISTRY.253.928153389"

ORA-17503: ksfdopn:2 Failed to open file +data/asm/ASMPARAMETERFILE/REGISTRY.253.928153389

ORA-15308: could not access ASM SPFILE in RDBMS instance

ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 413

ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)

可见用普通的cp命令,拷贝asm实例的spfile是不可行的!

可以参照:

ASMCMD> spcopy REGISTRY.253.928153389 /home/grid/

 

查看asm文件中的内容

[root@orcl grid]# strings REGISTRY.253.928153389

*.asm_power_limit=1

*.diagnostic_dest='/u01/app/grid'

*.instance_type='asm'

*.large_pool_size=12M

*.remote_login_passwordfile='EXCLUSIVE'

 

 

 

 

 

查看当前asm实例当前所连接的实例

ASMCMD> lsct

DB_Name  Status     Software_Version  Compatible_version  Instance_Name  Disk_Group

orclasm  CONNECTED        11.2.0.3.0          11.2.0.0.0  orclasm        DATA    

 

在rac环境下:

ASMCMD> lsct

DB_Name  Status     Software_Version  Compatible_version  Instance_Name  Disk_Group

+ASM     CONNECTED        11.2.0.3.0          11.2.0.3.0  +ASM2          CRS      

orcl     CONNECTED        11.2.0.3.0          11.2.0.0.0  orcl2          DATADG   

orcl     CONNECTED        11.2.0.3.0          11.2.0.0.0  orcl2          FRADG

 

 

 

显示磁盘组的使用信息:

 

ASMCMD> lsdg

State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name

MOUNTED  NORMAL  N         512   4096  1048576     15358     6769             5130             819              0             N  DATA/

 

显示已经打开的设备

ASMCMD> lsod

Instance Process                         OSPID Path     

1        oracle@orcl.hdp.com (DBW0)      2597  ORCL:ASM1

1        oracle@orcl.hdp.com (DBW0)      2597  ORCL:ASM2

1        oracle@orcl.hdp.com (DBW0)      2597  ORCL:ASM3

1        oracle@orcl.hdp.com (GMON)      2607  ORCL:ASM1

1        oracle@orcl.hdp.com (GMON)      2607  ORCL:ASM2

1        oracle@orcl.hdp.com (GMON)      2607  ORCL:ASM3

1        oracle@orcl.hdp.com (LGWR)      2599  ORCL:ASM1

1        oracle@orcl.hdp.com (LGWR)      2599  ORCL:ASM2

1        oracle@orcl.hdp.com (LGWR)      2599  ORCL:ASM3

1        oracle@orcl.hdp.com (RBAL)      2605  ORCL:ASM1

1        oracle@orcl.hdp.com (RBAL)      2605  ORCL:ASM1

1        oracle@orcl.hdp.com (RBAL)      2605  ORCL:ASM2

1        oracle@orcl.hdp.com (RBAL)      2605  ORCL:ASM2

1        oracle@orcl.hdp.com (RBAL)      2605  ORCL:ASM3

1        oracle@orcl.hdp.com (TNS V1-V3) 2613  ORCL:ASM1

1        oracle@orcl.hdp.com (TNS V1-V3) 2613  ORCL:ASM1

1        oracle@orcl.hdp.com (TNS V1-V3) 2613  ORCL:ASM2

1        oracle@orcl.hdp.com (TNS V1-V3) 2613  ORCL:ASM2

1        oracle@orcl.hdp.com (TNS V1-V3) 2613  ORCL:ASM3

1          oracle@orcl.hdp.com (TNS V1-V3) 2613  ORCL:ASM3

 

 

 

 

 

0 0
原创粉丝点击