2010. 8. 24. 11:03

Note 128126 - Database Connect for external tools

Summary

Symptom

The Connect of the SAP programs tp, r3trans and saplicense to the SQL Server only works if corresponding environment variables are set.

Other terms

ERROR: environment variable dbms_type is not set
SQL Server does not exist or access denied
Msg 208, Level 16 Invalid object name

Reason and Prerequisites

The external R/3 tools, such as saplicense, do not read the R/3 profile parameters but rely on correctly set Windows environment variables. Usually, it is sufficient to log in with the Windows account <sid>adm. The environment variables for <sid>adm are automatically set correctly by r3setup and sapinst. If you do not log in using <sid>adm or start the tools on any other computer (not on an R/3 application server), you need to set the environment variables yourself.

Important environment variables for SQL Server
  • dbms_type
    Must be always set to "mss" for SQL Server.
  • MSSQL_SERVER
    Name of the SQL Server instance. E.g. "SQLSERVER" (default instance on server "SQLSERVER") or "SAPSQL\PRD" (named instance "PRD" on server "SAPSQL")
  • MSSQL_DBNAME
    Name of the database, usually <SID> in uppercase letters.
  • MSSQL_SCHEMA
    Name of the database schema, usually "dbo" in lowercase letters. With an MCOD system, the database schema is <sid> in lowercase letters.
  • MSSQL_USER
    For R/3 3.X only: Name of the database login, usually "sapr3".
  • MSSQL_PASSWD
    For R/3 3.X only: Password of the database login, default is "sap".
Setting the environment variables in Windows 2000
1. Log in as <sid>adm, and open "Contol Panel" => "System" => "Advanced" => "Environment Variables".
2. Change the "User variables for <sid>adm".
Setting the environment variables in the command prompt

You can also change the environment variables using the SET command in
a "Windows Command Prompt" windowr (cmd.exe). These changes are then
only valid for that single window! For this reason, we do not recommend
this procedure.

Setting the environment variables for the SAP Service

All tools started from R/3 do not get their environment variables from the logged-in user but from the SAP Service SAP<SID>_<instance>. This does not only apply to SQL Server but to all R/3 versions on Windows. The environment variables are stored in the registry at

  • HKEY_LOCAL_MACHINE/Software/SAP/<SID>/Environment


As of R/3 4.5B, it is sufficient if the following registry entry is set:

  • Key:        HKEY_LOCAL_MACHINE/Software/SAP/<SID> Data Type:  REG_SZ
    Value Name: AdmUser
    String:     <DOMAIN>\<sid>adm


This has the effect that when starting the SAP Service, the environment variables are read from <DOMAIN>\<sid>adm and written to the registry at HKEY_LOCAL_MACHINE/Software/SAP/<SID>/Environment.

Solution

The following example explains the call of saplicense. The other SAP tools are called the same way.

  • Example for R/3 3.X:   SET dbms_type=mss
      SET MSSQL_SERVER=SQLSERVER
      SET MSSQL_DBNAME=TST
      SET MSSQL_USER=sapr3
      SET MSSQL_PASSWD=sap
      saplicense -show
  • Example as of R/3 4.X:   SET dbms_type=mss
      SET MSSQL_SERVER=DBSERVER
      SET MSSQL_DBNAME=PRD
      SET MSSQL_SCHEMA=dbo
      saplicense -show

 

Header Data

   
Release Status:
Released on: 07.10.2002  13:53:11
Master Language: 독어
Priority:
Category:
Primary Component: BC-DB-MSS

Affected Releases

Release-Independent

Related Notes

   
555223 - FAQ: Microsoft SQL Server

 

이 글은 스프링노트에서 작성되었습니다.

'4 Jobs > SAP' 카테고리의 다른 글

Required Basis Background Jobs  (0) 2010.08.24
Note 16083 - Standard jobs, reorganization jobs  (0) 2010.08.24
index rebuild 절차  (0) 2010.08.24
hostname을 변경한 경우  (0) 2010.08.24
EU_INIT  (0) 2010.08.24