cancel
Showing results for 
Search instead for 
Did you mean: 

Gateway for multiple databases in distributed installation

Former Member
0 Kudos

Hi,

We have 2 databases installed on same host. We have installed a SAP Gateway in this database host. How can we configure the environment of the user that starts the gateway to run DB13 tasks in the 2 systems?

If we configure ORACLE_SID and SAPDATA_HOME for the first system it works perfectly and if we configure ORACLE_SID and SAPDATA_HOME for the second system it works perfectly also. But the problem is to work the 2 systems at the same time.

Regards,

Enrique Rodríguez

Accepted Solutions (1)

Accepted Solutions (1)

former_member189725
Active Contributor
0 Kudos

Please install 2 standalone gateway instances on the same machine with different instance numbers. You can operate both the gateways together ,one for each incoming RFC requests.

Answers (1)

Answers (1)

former_member188883
Active Contributor
0 Kudos

Hi,

You can define an RFC connection using SM59 TCP/IP from each system to respective databases.

Use the gateway parameter for the installed gateway.

Hope this is useful.

Regards,

Deepak Kori

Former Member
0 Kudos

Hi Deepak,

I don't understand when you sais "Use the gateway parameter for the installed gateway". Can I define in the RFC connection environment parameters for the users starting the gateway??

Now I have the environment of the gateway user in database host with the environment of the first system (ORACLE_SID=SY1 and SAPDATA_HOME=D:oracleSY111202), and the database tasks form DB13 works ok, the RFC is working from application server.

Now, I don't know what to do to use this gateway for a second database of another SAP distributed system (SY2) working in same database host than SY1.

If I change ORACLE_SID=SY2 and SAPDATA_HOME=D:oracleSY211202, I can start database tasks from application server of system 2 without problems.

The question is What I have to do to configure the gateway to work with 2 databases?

Thanks,

Enrique Rodríguez

former_member188883
Active Contributor
0 Kudos

Hi Enrique,

When you create an RFC connection using SM59, There are fields for maintaining gateway host and gateway service .

Here i am asking you to maintain the gateway parameters.

Hope this is useful.

Regards,

Deepak Kori

Former Member
0 Kudos

Hi,

Yes, I have maintained gateway host and gateway service and the RFC works correctly, and DB13 works OK, but only for one system at same time.

Regards,

Enrique Rodríguez.

nicholas_chang
Active Contributor
0 Kudos

Hi,

why not you install a second gw with different gw number? As far as i know, you can can maintain one sapdata_home and oracle_home in one gw profile.

i believe is more easier to install a second gw.

Cheers,

Nicholas Chang

Former Member
0 Kudos

Hi Nicholas,

I've been thinking about this solution but in fact I don't have 2 databases, I have 4 databases, and not just one database server, it is a Oracle RAC with 2 nodes. Therefore we have to install 8 gateways.

For the moment, we have implemented scripts at OS level (Windows) to execute statistics, but when we restart the database, in pfile is added the line:

SPFILE='D:oracle<SID>11202databaseSPFILE<SID>.ORA' # line added by Agent

This lines causes the brconnect scripts not work whit the error:

BR0162E Parameter 'spfile' in file D:ORACLE<SID>11202databaseinit<SID>2.ora not supported

Regards,

Enrique Rodríguez

nicholas_chang
Active Contributor
0 Kudos

Hi Enrique Rodríguez,

if that's the case have you try to set below in your GWadm Env?

ORACLE_SID=SY1;SY2;SY3;..............................

SAPDATA_HOME=D:oracleSY111202;D:oracleSY211202;.........................

Please try and see if the trick work, and do let me know the outcome.

Cheers,

Nicholas Chang

Former Member
0 Kudos

Hi Nicholas,

No luck,

BR0152E Environment variable ORACLE_SID is not set

In SAP Note 1025707 - DBA Cockpit: Planning calendar and remote Oracle databases

we can read the following

Note 5:

If multiple databases exist on the same remote server that you want to control from the "CEN" DBA Cockpit system, you must set the following <(><<)>SAPSID<(>><)>-specific variables in the "cenadm" environment, for example:

setenv EX1_ORACLE_HOME /oracle/EX1/<db_vers>

setenv EX1_SAPDATA_HOME /oracle/EX1

setenv EX2_ORACLE_HOME /oracle/EX2/<db_vers>

setenv EX2_SAPDATA_HOME /oracle/EX2

setenv EX3_ORACLE_HOME /oracle/EX3/<db_vers>

setenv EX3_SAPDATA_HOME /oracle/EX3

For Windows, maintain the corresponding environment variables for user "cenadm".

And in SAP Note 853610 - Configuring transaction DB13C for Oracle

we can read:

Caution 4:

If multiple databases exist on the same remote server that you want to control by using transaction DB13C on the central system, you must set the following <(><<)>SAPSID<(>><)>-specific variables in the "cenadm" environment, for example:

setenv JV1_ORACLE_HOME /oracle/JV1/<db_vers>

setenv JV1_SAPDATA_HOME /oracle/JV1

setenv JV2_ORACLE_HOME /oracle/JV2/<db_vers>

setenv JV2_SAPDATA_HOME /oracle/JV2

setenv JV3_ORACLE_HOME /oracle/JV3/<db_vers>

setenv JV3_SAPDATA_HOME /oracle/JV3

For Windows, maintain the corresponding environment variables for the user "cenadm".

If directory-specific environment variables are required (SAPARCH, SAPBACKUP, SAPCHECK, SAPREORG, or SAPTRACE), they must receive the prefix <(><<)>SAPSID<(>><)>, similar to SAPDATA_HOME. On the Windows platform, for example:

set JV1_SAPDATA_HOME=D:oracleJV1

set JV1_SAPARCH=E:oracleJV1saparch

set JV1_SAPREORG=F:oracleJV1sapreorg

set JV2_SAPDATA_HOME=D:oracleJV2

set JV2_SAPARCH=E:oracleJV2saparch

set JV2_SAPREORG=F:oracleJV2sapreorg

set JV3_SAPDATA_HOME=D:oracleJV3

set JV3_SAPARCH=E:oracleJV3saparch

set JV3_SAPREORG=F:oracleJV3sapreorg

But if I maintain the environment variables

SY1_SAPDATA_HOME and SY1_ORACLE_HOME

the error is the same (ORACLE_SID is not set)

Regards,

Enrique Rodríguez

nicholas_chang
Active Contributor
0 Kudos

Hi Enrique Rodríguez,

How do you set the env in your GWadm user? Are you system running on Windows? If yes, were you do it in System Properties -> Advanced -> Environment Variables -> and add the value in user variable?

After adding, try to restart gateway and gateway service. let me know how it goes.

Hope it helps,

Nicholas Chang

Former Member
0 Kudos

Hi Nicholas,

You are right, I haven't restarted the service. Now the changes in environment are applied but not luck again. This is the error:

Job started

Step 001 started (program RSDBAJOB, variant &0000000000022, user ID xxxxxxx)

No application server found on database host - rsh/gateway will be used

Execute logical command BRCONNECT On host scan

Parameters: -u / -jid STATS20111219121256 -c -f stats -t ALL

BR0801I BRCONNECT 7.20 (20)

BR0252E Function fopen() failed for 'D:\oracle\SY1\11202;D:\oracle\SY2\11202;D:\oracle\SY3\11202\database\initSY1;SY2;SY3.sap' a

BR0253E errno 22: Invalid argument

BR0159E Error reading BRTools profile D:\oracle\SY1\11202;D:\oracle\SY2\11202;D:\oracle\SY3\11202\database\initSY1;SY2;SY3.sap*

BR0280I BRCONNECT time stamp: 2011-12-19 12.13.00

BR0301E SQL error -12557 at location db_connect-2, SQL statement:

'CONNECT /'

Error while trying to retrieve text for error ORA-12557

BR0310E Connect to database instance SY1;SY2;SY3 failed

BR0806I End of BRCONNECT processing: cehlyroy.log2011-12-19 12.12.56

BR0280I BRCONNECT time stamp: 2011-12-19 12.13.00

BR0804I BRCONNECT terminated with errors

External program terminated with exit code 3

BRCONNECT returned error status E

Job finished

nicholas_chang
Active Contributor
0 Kudos

Hi Enrique,

Have you grant the access to GWadm to the database Instance?

If no, try to add as below with your orasid user:

Replace the SID and passoword accordingly.

CREATE USER "OPS$SIDADM" DEFAULT TABLESPACE PSAPSR3USR

TEMPORARY TABLESPACE PSAPTEMP IDENTIFIED EXTERNALLY;

grant unlimited tablespace to "OPS$EGWADM" with admin option;

grant connect to "OPS$SIDADM" with admin option;

grant resource to "OPS$SIDADM" with admin option;

grant connect to "OPS$SIDADM" with admin option;

grant resource to "OPS$SIDADM" with admin option;

grant sapdba to "OPS$SIDADM" with admin option;

CREATE TABLE "OPS$SIDADM".SAPUSER

(USERID VARCHAR2(256), PASSWD VARCHAR2(256));

INSERT INTO "OPS$SIDADM".SAPUSER VALUES ('SAPSR3',

'Password');

Let me know how it goes.

Cheers,

Nicholas Chang

Former Member
0 Kudos

Hi Nicholas,

Thanks again. I have created the user and granted the access to databases. This is not a problem, we can execute statistics from a script or from DB13 if we configure the environment variables for an specific system.

Regards,

Enrique Rodríguez

nicholas_chang
Active Contributor
0 Kudos

do you grant GWadm access those file and folders?

Former Member
0 Kudos

Hi,

Yes, the user has granted access to database and file systems.

Now I'm creating a script (sapxpg_SY1.bat) for executing from RFC connection. I will explain if I can execute DB13 tasks with this method.

The script contains:

SET ORACLE_SID=SY11 (or SY12 in RAC node 2)

SET SAPDATA_HOME=D:\ORACLE\SY1

SET ORACLE_HOME=D:\ORACLE\SY1\11202

D:\usr\sap\GW2\SYS\exe\nuc\NTAMD64\sapxpg.exe %*

I will post if this works, with one script per system.

Regards,

Enrique Rodru00EDguez

Former Member
0 Kudos

It works!

Changing the program sapxpg in RFC SAPXPG_DBDEST_<dbhost-vip> for the script mentioned in previous message it works!

Thanks for your help.

Regards,

Enrique Rodríguez

nicholas_chang
Active Contributor
0 Kudos

Hi,

nice to hear that, nice one!

and perhaps you can closed the thread now

Cheers,

Nicholas Chang