WEB开发网
开发学院数据库Oracle ASM工具asmcmd 阅读

ASM工具asmcmd

 2008-09-08 12:51:14 来源:WEB开发网   
核心提示:感觉Oracle的ASM一直很不透明,不过Oracle还是提供了一些工具来访问ASM磁盘组的,ASM工具asmcmd,asmcdm就是其中一个工具, 如果不做任何配置,直接调用asmcmd,多半会碰到下面的错误:$asmcmdASMCMD-08103:failedtoconnecttoASM;ASMCMDrunning

感觉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

1 2 3  下一页

Tags:ASM 工具 asmcmd

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接