cancel
Showing results for 
Search instead for 
Did you mean: 

There is a way to get the SQL command running in a TASK IO Wait ?

Former Member
0 Kudos

Hi,

some times, using x_cons sh ac 1 i get the follow output:

T359   9     -1 User         0* IO Wait (R)           0 0      4        154805(s)

there is a way using x_cons or other tool to get the current SQL command that was running by T359? without using analyser, but something to get only this command in that moment?

thanks for any tip

Clóvis

Accepted Solutions (1)

Accepted Solutions (1)

markus_doehr2
Active Contributor
0 Kudos

If you enabled the command monitor you can do a

select * from running_commands

Markus

Former Member
0 Kudos

hi Marcus,

is this what i need, to share with community or to check if i'm doing this at right way, to activate command monitor i used follow commands in dbmcli:

sql_execute diagnose monitor clear
sql_execute diagnose monitor time 2000
sql_execute diagnose monitor data on

and to easy use of the query you show me, and as i want to use that in parallel with x_cons, i created follow linux bash script:

#!/bin/bash
#set -x
export PATH=$PATH:/opt/sdb/programs/bin
execute(){
  setVars
  createCmd
  executeCmd
}
setVars(){
  cmd="/home/sdb/scripts/tmp/taskRunningCommand.cmd"
  dbName="DBNAME"
  dbmUser="dbm"
  dbmPwd="secret"
}
createCmd(){
  echo "sql_execute select * from running_commands ">$cmd
}
executeCmd(){
  dbmcli -d $dbName -u $dbmUser,$dbmPwd -i $cmd
}
execute

this cause me to think, dont you MaxDB expert guys have script like this? you can share that with community?

best regards.

Clóvis

markus_doehr2
Active Contributor
0 Kudos

> is this what i need, to share with community or to check if i'm doing this at right way, to activate command monitor i used follow commands in dbmcli:

<...>

Looks good!

> this cause me to think, dont you MaxDB expert guys have script like this? you can share that with community?

Well - most of that functionality is "built in" in transactions on SAP systems (where e. g. I use MaxDB)

Markus

Answers (0)