cancel
Showing results for 
Search instead for 
Did you mean: 

Finding info about the database

Former Member
0 Kudos

I need to write a program to find out which database server is used, its ip address, its version and the databases within the server. How can i do that? Is there a config file or something similar which has all the information. Are there any APIs which i can use?

Please help me out here.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Its simple if you look at System >>> Status >>> Database information area on SAP screen.

Regards,

Nick Loy

Answers (3)

Answers (3)

Former Member

Hi

Call "RFC_SYSTEM_INFO" by using SAP RFC C++ SDK and read the info

Best regards,

Orkun Gedik

volker_borowski2
Active Contributor
0 Kudos

Hi,

for an ABAP stack system, you need to define wich SID you like to query.

Then switch to user sidadm and execute "R3trans -d".

You can parse the resultfile "trans.log" for a lot of your required information.

Additional options are to switch to orasid and execute


sqlplus -s / as sysdba <<EndOfSql
select * from v\$version;
exit
EndOfSql

and parse the output.

Volker

former_member204746
Active Contributor
0 Kudos

these scripts look interesting, but if they are not running on Oracle?

volker_borowski2
Active Contributor
0 Kudos

Good point Eric,

well, in that case he is busted

But at least he is asking in the Oracle Forum, and depending on the trans.log output, he could open a switchcase with

sqlplus ...

xsql ...

dbaccess ...

Whatever the other DBs have as query tools

Volker

P.S.:

wait ... wasn't there a "tp getdbinfo ..." ? I'm @ HOME now, so no system to test... Can somebody fill in ?

Edited by: Volker Borowski on Aug 24, 2011 9:01 PM

markus_doehr2
Active Contributor
0 Kudos

You can also run transaction DBACOCKPIT or use RZ20.

Markus

Former Member
0 Kudos

Thanks Nick and Markus,

I can get the database info by the ways you suggested. But i am getting it manually. Is there a way i can get this from a c/c++ program?

markus_doehr2
Active Contributor
0 Kudos

> I can get the database info by the ways you suggested. But i am getting it manually. Is there a way i can get this from a c/c++ program?

I'm not sure what you're asking here.

You want to write a program that connects to the SAP system and gets the data? Why do you want to do that? I'm trying to understand the context of the requirement.

There is a complete monitoring infrastructure available (CCMS) to "push" the data to a central system.

Markus

former_member204746
Active Contributor
0 Kudos

you could create an ABAP program that would fetch that info, write this in a text file and have or C+ program read that text file.

the ABAP program can be scheduled in SM36/SM37 and triggered by an event, you can call program SAPEVT at OS level to trigger your event.

There are no API for this.

there are a lot of interesting ABAP programs at http://www.kabai.com/abaps/q.htm

markus_doehr2
Active Contributor
0 Kudos

> I can get the database info by the ways you suggested. But i am getting it manually. Is there a way i can get this from a c/c++ program?

...or you can omit the SAP part alltogether and write a program using Oracles interface (OCI). You can also write a few sql scripts (e. g. select * from v$version) to get the information.

It's all a question on what you want to achieve.

Markus