cancel
Showing results for 
Search instead for 
Did you mean: 

Get Java Schema/User from a script

jochen_willeke
Explorer
0 Kudos

Hey SAP-Community,

I am new to the whole SAP Netweaver thing and currently I am working on a script and need to find out (automatically) which User/Schema is used by a given Netweaver AS Java System. I know about the naming rules (SAPSR3DB and/or SAP<SID>DB) but just in case someone has messed around with that (e.g. due to systemcopies) I want to check. My idea is, to check for some core-tables which MUST belong to the used Schema.

select OWNER,OBJECT_NAME from dba_objects where OBJECT_NAME = '<table name>';

First of all, do you think this is a good idea, and second which table may I use? I am thankfull for any thoughts on this.

Best regards,

Jochen

Accepted Solutions (1)

Accepted Solutions (1)

Reagan
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

The database schema for the Java stack is also maintained in the Configtool secure store.

Also you may use these queries.

SELECT USERNAME FROM DBA_USERS;

This will provide you the list of users and there you can find the schema name for Java.

SELECT DISTINCT OWNER, OBJECT_NAME FROM DBA_OBJECTS WHERE OWNER = 'SAPSR3DB';

This will show you the list of objects owned by the schema.

The SVERS table wont list any schema information and I doubt whether the table is available on a Java stack

Cheers
RB

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

    I think we can make it simple by just finding out what is the name of the schema that is mapped for the default temporary tablespace for Java DB.

PLease find the attached screenshot...

You can use this way to find out what is the schema for java in this way too I believe.

Thanks and Regards,

Vimal

jochen_willeke
Explorer
0 Kudos

Thanks to all repliers,

Maria Joseph, your answer seems to be the most helpfull for my purpose. I will stick with this.

Best Regards,

Jochen

Former Member
0 Kudos

Thanks Jochen.

Kindly close the thread if your query is answered.

Thanks and Regards,

Vimal

former_member188883
Active Contributor
0 Kudos

Hi Jochen,

SQL command mentioned by you looks good.

Additionally you may check following scrips

Select username from dba_users; -> This will list down all the database users include schema user.

  1. select OWNER,OBJECT_NAME from dba_objects where OBJECT_NAME = '<table name>'

First of all, do you think this is a good idea, and second which table may I use? I am thankfull for any thoughts on this.

You may go with table SVERS as starting points.

Regards,

Deepak Kori