ASM工具asmcmd
2008-09-08 12:51:14 来源:WEB开发网感觉Oracle的ASM一直很不透明,不过Oracle还是提供了一些工具来访问ASM磁盘组的,asmcdm就是其中一个工具。
如果不做任何配置,直接调用asmcmd,多半会碰到下面的错误:
$asmcmd
ASMCMD-08103:failedtoconnecttoASM;ASMCMDrunninginnon-connectedmode
要连接ASM,其实只需要做两件事情,确保$ORACLE_HOME和$ORACLE_SID的设置正确既可:
ASMCMD>exit
$bash
bash-3.00$env|grepORACLE_
ORACLE_SID=rac11g1
ORACLE_BASE=/data/oracle
ORACLE_HOME=/data/oracle/product/11.1/database
bash-3.00$exportORACLE_SID=+ASM1
bash-3.00$asmcmd
ASMCMD>ls
DATA/
现在已经成功的连接到ASM磁盘组。
ASMCMD>help
asmcmd[-v][-a][-p][command]
TheenvironmentvariablesORACLE_HOMEandORACLE_SIDdeterminethe
instancetowhichtheprogramconnects,andASMCMDestablishesa
bequeathconnectiontoit,inthesamemannerasaSQLPLUS/AS
SYSDBA.TheusermustbeamemberoftheSYSDBAgroup.
Specifyingthe-voptionprintstheasmcmdversionnumberand
exitsimmediately.
Specifythe-aoptiontochoosethetypeofconnection.Thereare
onlytwopossibilities:connectingas"sysasm"oras"sysdba".
Thedefaultvalueifthisoptionisunspecifiedis"sysasm".
Specifyingthe-poptionallowsthecurrentdirectorytobedisplayed
inthecommandprompt,likeso:
ASMCMD[+DATAFILE/ORCL/CONTROLFILE]>
[command]specifiesoneofthefollowingcommands,alongwithits
parameters.
Type"help[command]"togethelponaspecificASMCMDcommand.
commands:
--------
help
cd
cp
du
find
ls
lsct
lsdg
mkalias
mkdir
pwd
rm
rmalias
md_backup
md_restore
lsdsk
remap
ASMCMD>pwd
+
ASMCMD>cdDATA
ASMCMD>ls
RACTEST/
ASMCMD>cdRACTEST
ASMCMD>ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileractest.ora
ASMCMD>du
Used_MBMirror_used_MB
24572457
ASMCMD>lsct
DB_NameStatusSoftware_VersionCompatible_versionInstance_NameDisk_Group
ractestCONNECTED11.1.0.6.011.1.0.0.0ractest1DATA
ASMCMD>lsdg
StateTypeRebalSectorBlockAUTotal_MBFree_MBReq_mir_free_MBUsable_file_MBOffline_disksName
MOUNTEDEXTERNN5124096104857696350396094409609440DATA/
ASMCMD>lsdsk
Path
/dev/rdsk/emcpower0b
/dev/rdsk/emcpower0e
/dev/rdsk/emcpower0g
- ››ASM工具asmcmd
- ››ASM2.0字节码框架介绍
- ››工具提示控件介绍
- ››工具条控件和自定义报表
更多精彩
赞助商链接