Question : The asmcmd command execution is slow. How to trace the asmcmd command?
Answer:
You are seeing some errors or slow performance issue with command execution on asmcmd. And you wish to get more information on the command execution. The exception raised from asmcmd is not very descriptive and more of generic errors are reported for different issues. Below are some of the ways in which you can trace the asmcmd command to troubleshoot the performance issues with the execution of the asmcmd command.
1. Setting the DBI_TRACE environment variable
The main script asmcmdcore is a perl script. We can use DBI_TRACE to get more information by setting it in the environment:
$ export DBI_TRACE=1 $ asmcmd ASMCMD>
2. using oradebug
When you connect to asmcmd it connects to the ASM Instance with SYSDBA or SYSASM privilege, and a local BEQ process is started. After identifying the process ( ps -ef | grep beq and check the process starttime ), you can attach to the process using oradebug and run ‘errorstack’ , ‘12223’ etc.
Note that on 11g you can run asmcmd in non-connected mode, and then this tracing would not be useful.
3. truss/strace
We can of course take truss/strace of the asmcmd and its forked processes.
$ strace -aeft -o /tmp/asmcmd.log asmcmd ASMCMD>