oracle 10R2推出了asmcmd這個工具,可以用來管理asm存儲上的文件。
1.使用asmcmd命令必須先啟動asm實例,不然會有以下報錯:rac2-> asmcmd -p
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory (DBD ERROR: OCISessionBegin)2.使用asmcmd必須先指定ORACLE_HOME和ORACLE_SID,注意此處ORACLE_SID是asm的sid,不然會報錯:rac2-> asmcmd -p
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory (DBD ERROR: OCISessionBegin)3.asmcmd命令帶p參數和不帶p參數的作用:
帶p,使用asmcmd將顯示當前路徑:rac2-> asmcmd -p
ASMCMD [+] > ls
DG1/
RECOVERDEST/
ASMCMD [+] > cd DG1
ASMCMD [+DG1] > ls
DEVDB/
ASMCMD [+DG1] > cd DEVDB
ASMCMD [+DG1/DEVDB] >不帶p,不顯示當前路徑:rac2-> asmcmd
ASMCMD> ls
DG1/
RECOVERDEST/
ASMCMD> cd DG1
ASMCMD> ls
DEVDB/
ASMCMD> cd DEVDB
ASMCMD>4.其他相關參數,可使用help查看ASMCMD [+] > help
asmcmd [-p] [command]
The environment variables ORACLE_HOME and ORACLE_SID determine the
instance to which the program connects, and ASMCMD establishes a
bequeath connection to it, in the same manner as a SQLPLUS / AS
SYSDBA. The user must be a member of the SYSDBA group.
Specifying the -p option allows the current directory to be displayed
in the command prompt, like so:
ASMCMD [+DATAFILE/ORCL/CONTROLFILE] >
[command] specifies one of the following commands, along with its
parameters.
Type "help [command]" to get help on a specific ASMCMD command.
commands:
--------
cd
find
help
ls
lsct
lsdg
mkalias
mkdir
pwd
rm
rmalias