Environment –
SAP Distributed Installation – ASCS, DB & PAS running on separate host
Issue – DB13 Jobs(check DB & Update stats etc) are not running due to distributed installation.
Solution – Requires SAP gateway on DB Host to run the SAPXPG RFC. As per SAP recommendation we requires to install SAP Standalone Gateway with new SID.
SAPSID – SAP System SID
GWSID – Gateway SID
This document is separated with 4 phases – (Unix Installation)
Preparation
1. Identify the DB physical hostname for GW server installation
2. Identify the (SID) of GW server – i.e. – G30, G50 etc
3. Create local Mount Point request for new identified GW SID (if requires or else sapinst will create)
/usr/sap/(GW SID) – 5GB
/sapmnt/(GW SID) – 5 GB
4. Permission for mount point – (gwsid)adm:sapsys (full permission & others read only)
5. Download SWPM & Non Unicode Kernel for GW installation
6. Verify /tmp should have enough space to complete the installation (as SAPINST extract in /tmp by default)
Installation
1. Login via root & run SWPM in putty with command “./sapinst SAPINST_USE_HOSTNAME=db
2. Type GWSID(G30)
3. SAP Mount Directory – /usr/sap/ (As it will pick automatically new created mount point identified earlier)
4. Master Password for users
5. Provide SAPEXE.SAR & SAPHOSTAGENT.SAR (from Kernel directory)
6. Parameter Summary – Verify Details & Click on Show Details – Select Gateway Instance & Click Revise (if requires)
7. Successful installation will start the Gateway Service in host & Verify the same.
8. Specify Issues Encountered (Verify the installation error logs in /tmp directory & take corrective action.)
Post Installation Steps (Configuration)
1. login to (gwsid)adm & stopsap to stop the gateway server
2. Navigate to /usr/sap/(GWSID)/
vi reginfo
vi secinfo
Paste the below contents in 2 files –
TP=* USER=* USER-HOST=* HOST=*
3. Copy below files from SAP exe(kernel) directory to GATEWAY exe(kernel) folder –
sapxpg
libsapnwrfc.so
BR* (all BRTOOLS binaries)
4. Set the below BRTOOLS permission in GATEWAY exe(kernel) folder –
brarchive, brbackup, and brconnect belong to ora(sid) : sapsys and have authorization 4774
brrestore, brrecover, brspace, and brtools belong to (sapdsid)adm : sapsys and have authorization 755
5. Set below parameters in Gateway Instance Profile –
SETENV_04 = PATH=$(DIR_EXECUTABLE):/usr/sap/SAPSID/SYS/exe/run:/oracle/SAPSID/121
SETENV_06 = ORACLE_SID=SAPSID
SETENV_07 = SAPDATA_HOME=/oracle/SAPSID
(Replace SAPSID to respective SAP system name)
6. Set below parameters in Gateway ENV variable file – Verify SHELL = echo $SHELL & create a copy of existing ENV file & edit the same.
(.sapenv_(hostname).csh or .sapenv_(hostname).sh or .sapenv.sh)
(Replace SAPSID with respective SAP System Name)
setenv SAPDATA_HOME /oracle/SAPSID
setenv ORACLE_SID SAPSID
setenv PATH /oracle/SAPSID/121
setenv ORACLE_HOME /oracle/SAPSID/121(oracle version)
setenv USER (sapsid)adm
setenv dbs_ora_schema SAPSR3(schema user)
setenv NLS_LANG AMERICAN_AMERICA.UTF8
setenv DB_SID (SAPSID)
setenv dbs_ora_tnsname (SAPSID)
setenv dbms_type ORA
setenv SAPDATA_HOME /oracle/(SAPSID)
setenv SAPSID (SAPSID)
setenv LD_LIBRARY_PATH /usr/sap/
Save the file, Log off & Login & verify the Environment Variables.
7. Start the gateway server by startsap
8. Login into ABAP System – SM59 – TCP/IP – SAPXPG_DBEST_DB(SID)
Program – sapxpg
Target Host – DB Hostname
Gateway Host – DB Hostname
Gateway Service – sapgw(GW instance number)
Save the RFC & Verify the Connection Test
9. DB13 – Choose update optimizer statistics & check DB & run immediately to verify SAPXPG is connecting to DB successfully with correct authorizations.
Troubleshooting
1. Installation Error TST_ERROR while installing the GW service
Generic error – it failed while starting the GW service in respective time frame, please crosscheck all the folders created in /usr/sap/GWSID & try to start the same directly from OS level.
startsap
if GW started successfully then ignore the installation error.”
“SAPXPG RFC Connection Error
2. Error – SAPXPG RFC not working – is SAP gateway started
Please check SAP Gateway should be started & in running status.
3. Error – SAXPG RFC not working – Storage allocation error
Please check whether it’s reading reginfo & secinfo file or restart the GW server
4. Error – SAPXPG RFC not working – Getting Timeout
Please check if you have copied the LIB file in GW exe folder, mentioned in Post Installation Steps”
5. Error – Permission denied to read log file in sapcheck directory
Login via ora(sid) & give 775 permission to respective connection file in sapcheck directory
6. Error – Invalid username / password
Please check the environment variables should be corrected & try to run BRCONNECT from OS level, sometime there will be issue at OPS$ mechanism, verify BRCONNECT from SAP
7. Error – No Valid License Found
Please check the below ENV variable should exists for GW user.
setenv SAPSID
Please share your comments –
very nice blog, i followed the steps and it worked like a charm
Thanks for awesome document, I am still getting RFC error and DB13 check failed.
Error Details Error when opening an RFC connection (CPIC-CALL: ‘ThSAPOCMINIT’, communication r
I am trying this with distributed DB which is on oracle RAC.
Please advice.
Thanks,
Gokul
Hi Gokul,
Thanks for the same.
Regarding your error, there might be multiple things which need to check –
1. Firewall Ports between hosts?
2. is Gateway running on DB host?
3. ABAP GW ACL mode (reginfo/secinfo)?
You need to troubleshoot 1 by 1 on all the options then you can find the solution.
Thanks