cancel
Showing results for 
Search instead for 
Did you mean: 

How to run an arbtrary sql in a DB or ST transacation

Former Member
0 Kudos

I know in some DB or ST transaction, one can run an arbitray sql. Can someone provide the transaction and detail on how to do it. Thanks a lot.,

Accepted Solutions (0)

Answers (2)

Answers (2)

sunny_pahuja2
Active Contributor
0 Kudos

ya.. you can run sql statements from sap..please find below tha path

DB02 transaction --> Performence --> Additional functions --> SQL command editor.

thanks sunny

Former Member
0 Kudos

I am n BI 7 using Oracle. I am unable to find Additional Functions. May be it is some other DB transaction.

sunny_pahuja2
Active Contributor
0 Kudos

hi

Go to DB02 transaction..on lefthand side there is a tab Performence and in that there is one tab additional function and under that SQL Command Editor..

its same for ECC or BW etc..

thanks sunny

Former Member
0 Kudos

Sorry, I do not see it. When run DB02 it shows Performanec Analysis of Tables and Inexes, it does not show me Performance Tab to left etc. May be, I do not have some permissions, that's why tab is not shown.

0 Kudos

Hi,

The transaction mentioned is not "really" DB02. It is a new transaction called DBACOCKPIT that replaces ST04, DB03, DB13, DB14 and perhaps others.

Therefore, if you do not have at least basis 700 patch 13 (I think) that will not work.

In addition, the mentioned SQL editor does not allow you to select from the SAP* schema, only from sys. it is meant mainly for support for monitoring oracle.

former_member204746
Active Contributor
0 Kudos

try the same trick with transaction DB02OLD.

good luck.

0 Kudos

Hi

But in DB02OLD you do not get the "SQL Editor" because it belongs to the DBACOCKPIT.

You can get similar tool on ST04N in not so recent systems. I'm not sure of the exact path (I do not have any at hand to check it) but you should look for a menut with "arbitrary Joins".

Same restrictions apply, only SELECT on SYS tables/views

Additionaly, you can use SE38 and report RSORADJV. Also with the same restrictions

Former Member
0 Kudos

Hi Fidel,

mainly that's true - but it works for some tables against the ABAP data dictionary

(i.e. you have to check some values from SAPR3 tables against data dictionary views:

Here I use RSTODS ( a BW table stroing ODS table information) as an input source for my IN clause on a DBA table in RSORADVJ to know the exact partition counts on every ODS table.

Ex.:


select table_name,
            replace(To_char((sum(blocks) * 8192) / 1024/1024,'99999.99' ),'.',',') Mbyte,
            sum(num_rows) numrows, sum(blocks) blocks ,
            count(*) num_part
from dba_tab_partitions  " <--------------------------- Oracle dict table
where table_owner ='SAPR3' and
          TABLE_NAME in 
                         ( select odsname_tech from rstsods)  " <----------------- BW table
group by table_name having ((sum(blocks) * 8192) / 1024/1024) >= 1
order by blocks desc

ok - it's somewhat limited what you can do (and it may a feature or a security bug )

but it works for me

bye yk

0 Kudos

Hi,

Well, I have not tried all options and rsoradjv does not allow all possible operations (it also depends on the versions ...)

AFAIK, it is a security bug. But I have not played much with it (outside the "dba_" and "v$"), perhaps there are some tables allowed or so

rdiger_plantiko2
Active Contributor
0 Kudos

... it would be a security issue if everybody had the ST04 authority.

The possibility to select the Oracle administrative tables has proven to be useful in many cases.

For example, with the statement

select count(*) num_sessions from v$session

I retrieve the number of DB sessions that are currently in use.

- Rüdiger

former_member204746
Active Contributor
0 Kudos

try SQVI

or search Google with keywords:

run sql command from sapgui