asmcmd详解(原创)ITeye - 牛牛娱乐

asmcmd详解(原创)ITeye

2019年03月20日15时18分26秒 | 作者: 诗珊 | 标签: 检查,指令,文件 | 浏览: 1601

+DATA/CZMMIAO/DATAFILE/aaa = EXAMPLE.264.800386585
none = SYSAUX.257.800386397
none = SYSTEM.256.800386395
none = UNDOTBS1.258.800386397
none = UNDOTBS2.265.800386713
none = USERS.259.800386397
aaa
ASMCMD rmalias aaa        删去目标别号

ASMCMD ls -a
none = EXAMPLE.264.800386585
none = SYSAUX.257.800386397
none = SYSTEM.256.800386395
none = UNDOTBS1.258.800386397
none = UNDOTBS2.265.800386713
none = USERS.259.800386397
ASMCMD lsdg             检查磁盘组信息
State    Type    Rebal  Unbal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Name
MOUNTED  EXTERN  N      N         512   4096  1048576      3815     2529                0            2529              0  DATA/
ASMCMD lsct              检查asm客户端信息
DB_Name   Status        Software_Version  Compatible_version  Instance_Name
czmmiao   CONNECTED           10.2.0.1.0          10.2.0.1.0  czmmiao1

ASMCMD mkdir bbb ccc           创立bbb和ccc目录

ASMCMD ls
EXAMPLE.264.800386585
SYSAUX.257.800386397
SYSTEM.256.800386395
UNDOTBS1.258.800386397
UNDOTBS2.265.800386713
USERS.259.800386397
bbb/
ccc/
ASMCMD rmdir bbb ccc           删去bbb和ccc目录,rm指令有-r和-f两个参数,用法同linux的rm指令

11g R2新增指令

cp:不只能够在ASM和OS之间仿制文件,也能够在不同的ASM Instance和Diskgroup之间仿制文件;

cp +dgtest/test/datafile/USERS.264.646186565 users.dbf md_backup: 将disk group中的metadata备份到文件;
md_backup /tmp/backupfile -G DATAGP md_restore: 将备份文件中的metadata康复到disk group;
md_restore -full -G data silent /tmp/file lsattr: 列出disk group的特点;
lsattr -l -G DATAGP setattr: 设置disk group的特点;
setattr -G DATAGP compataible.asm 11.2.0.0.0 lsof: 显现local clients的open files;
lsof -G DATAGP chdg: 修正disk group, add或drop disk;
chdg DATAGP_config.xml chkdg: check 或 repair disk group 的metadata;
chkdg repair DATAGP dropdg: drop disk group;
dropdg -r -f DATAGP iostat: 检查I/O statics经过v$asm_disk_iostat;
iostat -G DATAGP lsdsk: list ASM disks;
lsdsk -p -G DATAGP /dev/raw/* ;
lsdsk candidate -p lsod: list open ASM disks;
lsod -G DATAGP mkdg: create disk group based on a xml file;
mkdg DATAGP_config.xml mount: mount a disk group;
mount -f DATAGP;
mount restrict DATAGP;
mount -a offline: offline disks or failure groups that belong to disk group.
offline -G DATAGP -F FG1 online: online disks or a failure group;
online -G DATAGP -D data_0001 power=3 rebal: rebalance a disk group;
rebal power 4 DATAGP remap: mark blocks as unusable on the disk and relocates data;
remap DATAGP data_0001 500-700 umount: dismount a disk group;
unmount -f DATAGP pwcopy: copy password file;
pwcopy asm +DG/mydir/mypwfile +DG1/mypwfile pwcreate: create password file for sys;
pwcreate asm +DG/mdir/mypwfile welcome pwdelete: delete password file;
pwdelete asm +DG/mydir/mypwfile pwget: get the location of password file;
pwget asm pwmove: move password file;
pwmove asm +DG/mydir/mypwfile +DG1/mypwfile pwset: set the location of password file;
pwset -dbuniquename aime1 +DG/mydir/mypwfile dsget: get the discovery disk string;
dsget dsset: set the discovery disk string;
dsset /dev/raw/* lsop: list current operations on disk group from v$asm_operation;
lsop shutdown: shutdown ASM instance;
shut immediate spbackup: backup ASM Spfile;
spbackup +DATA/asm/asmprameterfile/register.323.234 +DATA/spf.bak spcopy: copy spfile;
spcopy +DATA/asm/asmprameterfile/register.323.234 +DATA/spf.ora spget: get the spfile location;
spget spmove: move spfile;
spmove +DATA/spf.ora +DATA1/spf.ora spset: set the location of spfile;
spset +DATA/spf.ora startup: start up ASM instance;
startup nomount pfile asm.ora chtmpl:改动template的特点;
chtmpl -G DATAGP redundancy high striping fine mytemplate lstmpl: list templates;
ls -l -G DATAGP mktmpl: add template to disk group;
mktmpl -G DATA redundancy mirror striping coarse rmtmpl: remove template from disk group;
rmtmpl -G DATAGP mytp chgrp: change user group of files; 
chgrp asm-data +data/mydir/a.f chmod: change permissions of files;
chmod 640 a.f chown: change owner of files;
chown user:usergroup a.f groups: list all user groups of a user;
groups DATAGP user grpmod: add or remove OS users to ASM user group;
grpmod add fra asm_fra oracle1 oracle2 lsgrp: list all ASM user groups;
lsgrp -a lspwusr: list users from ASM password file;
lspwusr lsusr: list users in a disk group;
lsusr -G DATAGP mkgrp: create new ASM user group;
mkgrp DATAGP asm_data oracle1 oracle2 mkusr: add OS user to a disk group;
mkusr DATA oracle1 orapwusr: add, drop, modify ASM password file user; 
orapwusr add privilege sysdba hrusr passwd: change password of a user;
passwd oracle2
rmgrp: remove a user group from disk group;
rmgrp DATAGP asm_data rmusr: remove a OS user from disk group;
rmusr DATAGP oracle2 rpusr: replace OS user1 with OS user2;
rpusr DATAGP oracle1 oracle2 volcreate: create an ADVM volume in disk group;
volcreate -G DATA -s 10G width 64K column 8 volume1 voldelete: delete an ADVM volume;
voldelete -G DATAGP volume1 voldisable: disable an ADVM volumes in mounted disk groups and remove the volume device on the local node;
voldisable -G DATAGP volume1 volenable: enable ADVM volume in mounted disk groups;
volenable -G DATAGP volume1 volinfo: display information of ADVM volumes;
volinfo -G DATAGP volume1 volresize: resize an ADVM volume;
volresize -G DATAGP -s 20G volume1 volset: set attributes of ADVM volume;
volset -G DATA usagestring no file system attached  volume1 volstat: report I/O statistics of ADVM volume;
volstat -G DATAGP

参阅至:http://www.ningoo.net/html/2008/oracle11g_asmcmd_new_command.html
               http://www.dba-oracle.com/t_asmcmd.htm
               http://www.reachdba.com/showthread.php?386-asmcmd-Usage-with-Examples
               http://www.isnetne.ch/lbd/SGBD/oracle/documents/ASM/ASMCMD%20Quick%20Reference%20Guide.pdf
               http://blog.chinaunix.net/uid-23622436-id-3196692.html
               http://www.cnblogs.com/zlja/archive/2011/01/13/2449338.html
本文原创,转载请注明出处、作者
如有过错,欢迎纠正
邮箱:czmcj@163.com

版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表牛牛娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章