Вы здесь
ASMCMD
Start asmcmd
The ASM Command Line Utility can be started by executing the asmcmd command. Here is a Linux/Unix example:
$ export ORACLE_SID=+ASM
$ cd $ORACLE_HOME/bin
$ asmcmd
ASMCMD> exit
$
The asmcmd utility also provides a useful "-p" option that will display the current path in the prompt. Here is an example:
$ asmcmd -p
ASMCMD [+] > cd FLASH
ASMCMD [+FLASH] >
Asmcmd commands
Some of the more interesting commands are described below -
Getting some help:
ASMCMD> help
Help for a spesific command:
ASMCMD> help ls
Navigating through the structure using "cd", "ls" and "pwd" commands:
ASMCMD> ls -l
State Type Rebal Unbal Name
MOUNTED EXTERN N N DISKGROUP1/
MOUNTED EXTERN N N FLASH/
ASMCMD> cd DISKGROUP1
ASMCMD> ls -l
Type Redund Striped Time Sys Name
Y SALES/
ASMCMD> cd SALES
ASMCMD> ls -l
Type Redund Striped Time Sys Name
Y CONTROLFILE/
Y DATAFILE/
Y ONLINELOG/
Y PARAMETERFILE/
Y TEMPFILE/
N spfilesales.ora => +DISKGROUP1/SALES/PARAMETERFILE/spfile.268.569267897
ASMCMD> cd DATAFILE
ASMCMD> pwd
+DISKGROUP1/SALES/DATAFILE
Find files:
ASMCMD> find / spfile*
+DISKGROUP1/SALES/PARAMETERFILE/spfile.268.569267897
+DISKGROUP1/SALES/spfilesales.ora
List all connected instances:
ASMCMD> lsct
DB_Name Status Software_Version Compatible_version Instance_Name
sales CONNECTED 10.2.0.1.0 10.2.0.1.0 sales1
sales CONNECTED 10.2.0.1.0 10.2.0.1.0 sales2
List all diskgroups:
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 11264 9885 0 9885 0 DISKGROUP1/
MOUNTED EXTERN N N 512 4096 1048576 10240 9906 0 9906 0 FLASH/
Check used space:
ASMCMD> du
Used_MB Mirror_used_MB
1523 1523
Delete files (be careful!!!):
ASMCMD> rm *
Are you sure? (y/n) y
Metadata (ASM superblocks) backup and recovery (Oracle 11g and above):
ASMCMD> md_backup –b /tmp/dg.backup –g DATA –g RECOVER
ASMCMD> md_restore –t full –g RECOVER /tmp/dg.backup
Post new comment