oracle asm asmcmd
1,asmcmd command type[@more@]
asmcmd instance management command: dsget,dsset,lsct,lsop,lspwusr,orapwusr,shutdown
asmcmd file management commands: cd,cp,du,find,ls,lsof,mkalias,pwd,rm,rmaliasspbackup,spcopy,spget,spmove,spset,startup
asmcmd disk group management commands: chdg,chkdg,dropdg,iostat,lsattr,lsdg,lsdsk,lsod,md_backup,
asmcmd template management commands: chtmpl,lstmpl,mktmpl,rmtmplmd_restore,mkdg,mount,offline,online,rebal,remap,setattr,umount
asmcmd file access control commands: chgrp,chmod,chown,groups,grpmod,lsgrp,lsusr,mkgrp,mkusr,passwd,
asmcmd volume management commands:volcreate,voldelete,voldisable,volenable,volinfo,volresize,volset,volstatrmgrp,rmusr
2,asmcmd -p
[grid@asm ~]$ asmcmd -p
ASMCMD [+] > ls
DATA/
FLASH/
ASMCMD [+] > cd data
ASMCMD [+data] > ls
ASM/
ASMCMD [+data] > cd asm
ASMCMD [+data/asm] > ls -l
ASMCMD [+] > ls
DATA/
FLASH/
ASMCMD [+] > cd data
ASMCMD [+data] > ls
ASM/
ASMCMD [+data] > cd asm
ASMCMD [+data/asm] > ls -l
3,獲取asmcmd中comand的幫助文件
ASMCMD> help dsget
dsget [--normal|--parameter|--profile [-f]]
Retrieve the diskstring value from the ASM server and gPnP profile;
[--normal] gets the diskstring from gPnP profile and ASM instance.
[--profile] retrieves the diskstring from gPnP profile.
[-f] retrieves the diskstring from local gPnP profile.
used only with --profile
cluster stack should not be up while using this option
[--parameter] Retrieves the ASM_DISKSTRING parameter from ASM instance.
dsget [--normal|--parameter|--profile [-f]]
Retrieve the diskstring value from the ASM server and gPnP profile;
[--normal] gets the diskstring from gPnP profile and ASM instance.
[--profile] retrieves the diskstring from gPnP profile.
[-f] retrieves the diskstring from local gPnP profile.
used only with --profile
cluster stack should not be up while using this option
[--parameter] Retrieves the ASM_DISKSTRING parameter from ASM instance.
4,asmcmd instance management command
dsget :retrieves the discovery diskstring value that is used by the oracle asm instance and its clients
dsset :set the discovery diskstring value that is used by the oracle asm instance and its clients
lsct :list information about current oracle asm instance client
information from v$asm_client
lsop :list current operation on a disk group or oracle asm instance
information from v$asm_operation
lspwusr :lists the users from an oracle asm password file
orapwusr :adds,drops,or changes an oracle asm password usr
ASMCMD> orapwusr --add --privilege sysdba hr
Enter password: ******ASMCMD> lspwusr
Username sysdba sysoper sysasm
SYS TRUE TRUE TRUE
ASMSNMP TRUE FALSE FALSE
ASM FALSE FALSE TRUE
HR TRUE FALSE FALSE
shutdown :shuts down an oracle asm instance
spbackup :backs up an oracle asm spfile
spbackup can backup an oracle asm spfile from a disk group to a disk groupor to an operating system file or an operating system file to diskgroupASMCMD [+data/asm/asmparameterfile] > spbackup REGISTRY.253.801072449 +data/asmspfilebackup.bakASMCMD [+data/asm/asmparameterfile] > spbackup REGISTRY.253.801072449 /oradata/asmspfilebackup.bak
spcopy : copies an oracle asm spfile
ASMCMD [+data/asm/asmparameterfile] > spcopy REGISTRY.253.801072449 +data/asmspfilecp.back
ORA-15056: additional error message
ORA-17502: ksfdcre:4 Failed to create file +data/asmspfilecp.back
ORA-15268: internal Oracle file +DATA.253.1 already exists.
ORA-06512: at line 7 (DBD ERROR: OCIStmtExecute)present this error because of spcopy cannot make multiple copies of an oracle asm spfilein the same disk group(can use spbackup for this purpose)ASMCMD [+data/asm/asmparameterfile] > spcopy REGISTRY.253.801072449 +flash/asmspfilecp.bakASMCMD [+data/asm/asmparameterfile] > spcopy REGISTRY.253.801072449 /oradata/asmspfilecp.bakASMCMD [+data/asm/asmparameterfile] > spcopy -u REGISTRY.253.801072449 +flash/asmspfilecp25.bak
spget : retrieve the location of the oracle asm spfile
ASMCMD [+] > spget
+flash/asmspfilecp25.bak
spmove :move an oracle asm spfile
spset : sets the location of the oracle asm spfile
startup :starts up an oracle asm instance
5,asmcmd file management commands
cd :changes the current directory to the specified directorycp :enables you to copy files between disk groups,and between a disk group and the operation system
cp [-i][-f] src_file[rem_connect_str:] tgt_filecp [-i][-f] [rem_connect_str:]src_file tgt_file-i :specifies the interactive option,promts before copying or overwriting a file-f :specifies the force option,if the destination file exists,remove it and then try again without usr interactionrem_connect_str :specifies the connection string for a remote instancesrc_file :name of the source file to copy. must be either a fully qualified file name or an oracle asm aliastgt_file :a user alias for the created target file name or alias directory namerem_connect_str :user@host[.part_number].SIDsome file bypes cannot be the source or destination of the cp command,these file types includeOCR and OCR backup file types. to backup,copy,or move an oracle asm spfile,use the spbakup,spcopy,or spmove command.ASMCMD [+data/asm] > cp users01.dbf +data/users01.dbf.cpASMCMD [+data/asm] > cp users01.dbf /oradataASMCMD [+data/asm] > cp /oradata/users01.dbf +flash
du :displays the total disk space occupied by files in the specified oracle asm directory and all ofits subdirectories,recursively,
ASMCMD [+data/asm] > du +data
Used_MB Mirror_used_MB
1501 1501
ASMCMD [+data/asm] > cd datafile
ASMCMD [+data/asm/datafile] > du
Used_MB Mirror_used_MB
1283 1283
find :lists the paths of all occurrences of the specified name(with wildcards) under the specified directory
ASMCMD [+] > find +data user*ASMCMD [+] > find --type datafile +data user*
ls : lists the contents of an oracle asm directory,attributes of the specified file,orthe names and attributes of all disk groups
ASMCMD [+data/asm/datafile] > ls -lASMCMD [+data/asm/datafile] > ls -ltASMCMD [+data/asm/datafile] > ls -sASMCMD [+data/asm/datafile] > ls --permission
lsof :list the open filesmkalias :creates an alias for system-generaterd filenames
ASMCMD [+data/asm] > mkalias +DATA/ASM/DATAFILE/USERS.265.806511631 users01.dbf
mkdir : creates oracle asm directoriespwd :displays the path of the current oracle asm directoryrm : deletes the specified oracle asm files or directories.rmalias : deletes the specified alias,retaining the file that the alias points to.
ASMCMD [+data/asm] > rmalias users01.dbf
6,asmcmd disk group management commands
chdg :change a disk group(add,drop or rebalance)chkdg : check or repairs a disk group
ASMCMD> chkdg --repair flash
dropdg :drops a disk groupiostat :displays I/O statistics of disks
ASMCMD> help iostat
iostat [-etH][--io][--region] [-G dgname] [interval]
Report statistics and input/output statistics. The statistics
are reported just for mounted devices.
[interval] Refresh interval.
[--io] Display information in IOs, instead of bytes.
[--region] Display regions information
[-e] Display error statistics.
[-t] Display time statistics.
[-G] List statistics for a specific disk group.
[-H] Suppress column headers.
ASMCMD> iostat 3 --region
lsattr :lists the attributes of a disk group
ASMCMD> lsattr -lName Valueaccess_control.enabled FALSEaccess_control.umask 066au_size 1048576cell.smart_scan_capable FALSEcompatible.asm 11.2.0.0.0compatible.rdbms 10.1.0.0.0disk_repair_time 3.6hsector_size 512access_control.enabled FALSEaccess_control.umask 066au_size 1048576cell.smart_scan_capable FALSEcompatible.asm 11.2.0.0.0compatible.rdbms 10.1.0.0.0disk_repair_time 3.6hsector_size 512
lsdg :list disk groups and their information
ASMCMD> lsdg --discovery
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 6134 4579 0 4579 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 4094 4026 0 4026 0 N FLASH/
lsdsk :list disks oracle asm disks
ASMCMD> lsdsk -t -p -G data
Group_Num Disk_Num Incarn Mount_Stat Header_Stat Mode_Stat State Create_Date Mount_Date Repair_Timer Path
1 0 3915912477 CACHED MEMBER ONLINE NORMAL 03-DEC-12 05-FEB-13 0 ORCL:DATA01
1 1 3915912478 CACHED MEMBER ONLINE NORMAL 03-DEC-12 05-FEB-13 0 ORCL:DATA02
lsod :lists open devices
ASMCMD> lsod -G data --process LGWR
Instance Process OSPID Path
1 oracle@asm (LGWR) 4076 ORCL:DATA01
1 oracle@asm (LGWR) 4076 ORCL:DATA02
md_backup :create a backup of the metadata of mounted disk groups
ASMCMD> md_backup /oradata/disk_md_backup
Disk group metadata to be backed up: DATA
Disk group metadata to be backed up: FLASH
Current alias directory path: users01-a
Current alias directory path: ASM/ONLINELOG
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: ASM/CONTROLFILE
Current alias directory path: ASM
Current alias directory path: ASM/PARAMETERFILE
Current alias directory path: ASM/DATAFILE
Current alias directory path: ASM/TEMPFILE
Current alias directory path: ASM
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: ASM/DATAFILE
ASMCMD> md_backup /oradata/disk_md_backup_data -G data
Disk group metadata to be backed up: DATA
Current alias directory path: users01-a
Current alias directory path: ASM/ONLINELOG
Current alias directory path: ASM/ASMPARAMETERFILE
Current alias directory path: ASM/CONTROLFILE
Current alias directory path: ASM
Current alias directory path: ASM/PARAMETERFILE
Current alias directory path: ASM/DATAFILE
Current alias directory path: ASM/TEMPFILE
md_restore :restore disk group from a backup of the metadatamkdg :create a disk group;mount : mount a disk groupoffline :offlines a disk or a failure grouponline :onlines a disk or a failure grouprebal :rebalance a disk groupremap :relocates data in a range of physical blocks on a disksetattr : set attributes a disk groupumount : diskmount a diskgroup
7,asmcmd template management commands
chtmpl : change the attribute of a template
lstmpl : lists disk group templates
ASMCMD> lstmpl -l -G data
Group_Name Group_Num Name Stripe Sys Redund PriReg MirrReg
DATA 1 ARCHIVELOG COARSE Y UNPROT COLD COLD
DATA 1 ASMPARAMETERBAKFILE COARSE Y UNPROT COLD COLD
DATA 1 ASMPARAMETERFILE COARSE Y UNPROT COLD COLD
DATA 1 ASM_STALE COARSE Y UNPROT COLD COLD
DATA 1 AUTOBACKUP COARSE Y UNPROT COLD COLD
DATA 1 BACKUPSET COARSE Y UNPROT COLD COLD
DATA 1 CHANGETRACKING COARSE Y UNPROT COLD COLD
DATA 1 CONTROLFILE FINE Y UNPROT COLD COLD
DATA 1 DATAFILE COARSE Y UNPROT COLD COLD
DATA 1 DATAGUARDCONFIG COARSE Y UNPROT COLD COLD
DATA 1 DUMPSET COARSE Y UNPROT COLD COLD
DATA 1 FLASHBACK COARSE Y UNPROT COLD COLD
DATA 1 FLASHFILE COARSE Y UNPROT COLD COLD
DATA 1 OCRBACKUP COARSE Y UNPROT COLD COLD
DATA 1 OCRFILE COARSE Y UNPROT COLD COLD
DATA 1 ONLINELOG COARSE Y UNPROT COLD COLD
DATA 1 PARAMETERFILE COARSE Y UNPROT COLD COLD
DATA 1 TEMPFILE COARSE Y UNPROT COLD COLD
DATA 1 XTRANSPORT COARSE Y UNPROT COLD COLD
mktmpl : adds a template to a disk group
ASMCMD> mktmpl -G data --redundancy unprotected --striping coarse mytemplate
rmtmpl :removes a template from a disk group
ASMCMD> rmtmpl -G data mytemplate
8,asmcmd file access control commands
chgrp : changes the user group of a file or list of fileschmod : change permissions of a file or list of fileschown : change the owner of a file or list of filesgroups : lists the user groups to which a user belongsgrpmod : adds or removes users from an existing user grouplsgrp : lists user groupslsusr : lists users in a disk groupmkgrp : creates a new nusr groupmkusr : adds a user to disk grouppasswd : changes the password of a userrmgrp : deletes a user grouprmusr : deletes a user from a disk group
9,asmcmd volume management commands
volcreate : create an oracle advm volume in the specified groupvoldelete : deletes an oracle advm volumevoldisable :disable oracle advm volumes in mounted disk groupsvolenable :enables oracle advm volumes in mounted disk groupsvolinfo :diskplays information about oracle advm volumesvolresize :resize an oracle advm volumevolset : sets attributes of an oracle advm volume in mounted disk groupsvolstat : reports volume i/o statistics.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1060202/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【asmcmd】使用asmcmd工具管理ASMASM
- ASM工具asmcmdASM
- Oracle 12C ASM asmcmd amdu_extractOracleASM
- 【ASM】ASMCMD cp 命令ASM
- Oracle IZ0-053 Q36(ASM ASMCMD REMAP)OracleASMREM
- 【ASM】ASMCMD chtmpl 更改ASM 模版的屬性ASM
- [zt] ORACLE 10g中ASMCMD使用及ASM檔案Oracle 10gASM
- ASMCMD - ASM command line utility .ASM
- ASM命令列管理工具asmcmdASM命令列
- OCP(11g)------> ASM Command-Line Utility (ASMCMD)和 使用 ASMCMDASM
- Oracle ASM使用asmcmd中的cp命令來執行遠端複製OracleASM
- 學習ASM技術(六)-- ASMCMD命令列ASM命令列
- rac環境 asmcmd用法;首先設定oracle_home oracle_sid(asm例項)ASMOracle
- ORACLE 10g中ASMCMD使用及ASM檔案XML DB訪問-1Oracle 10gASMXML
- 使用 ASMCMD 工具管理ASM目錄及檔案ASM
- Oracle ASMCMD命令參考OracleASM
- 【ASM】ASMCMD 之md_backup,md_restore介紹ASMREST
- 用asmcmd 的rebal 代替 ASM_POWER_LIMIT 引數ASMMIT
- ASMCMD執行ASM後設資料備份與還原ASM
- asmcmdASM
- 【ASM】ASMCMD 磁碟後設資料的備份與恢復實踐ASM
- oracle asmOracleASM
- solaris10上oracle10g之asm_asmcmd和rman歸檔日誌資料不同學習OracleASM
- ASMCMD命令ASM
- ASMCMD - cpASM
- 使用asmcmdASM
- oracle 11gR2 asmcmd工具增加 cp命令OracleASM
- 【ORACLE ASM】ASM 支援工具簡介OracleASM
- oracle asm命令OracleASM
- Oracle ASM 管理OracleASM
- Oracle ASM 限制OracleASM
- asmcmd詳解ASM
- ASMCMD +ASM 例項 Connected to an idle instance. 一個 / 導致的問題ASM
- 通過asmcmd進入asm例項時可能會遇到的一些問題ASM
- Oracle ASM Disk DirectoryOracleASM
- Oracle ASM File DirectoryOracleASM
- Oracle ASM Allocation TableOracleASM
- Oracle ASM Disk PartnerOracleASM