当前位置: 首页 > news >正文

如何从SAP中连接其他数据库

 
1.       工作环境需求
    A . The operating system user <sid>adm must be able to log on to the secondary database.
    B. The R/3 table DBCON must be maintained.
    C . The correct database library 'dboraslib.<ext>' must exist in the kernel directory. 
Connect  to SQL Server database Prerequisite: At least one Windows application server must be available on the R/3 system and the DBSL dynamic library (DLL) dbmssslib.dll must be installed on this server. This dll can be downloaded from the SAP Service Marketplace.
dbmssslib.dll
2.       配置连接信息
配置TCODE: dbco
任何配置信息都存储在DBCON表中.
配置示例:
A.      访问MSSQL的配置示例(参见SAP Notes 178949)
CON_NAME: <my_conn_name>
DBMS: MSS
USER_NAME: <db_user>
PASSWORD:  <password>
CON_ENV: MSSQL_SERVER=<server_name> MSSQL_DBNAME=<db_name>
   db_user could be sapr3 for example if the server is running R/3.  The password field may be blocked from view by asterisks in sm30. USER_NAME can be left blank in order to use integrated security (4.6d kernel and later).  In that case make sure that the OS User running R/3 has the required privilege on the remote server.  A dummy password must be entered in sm30, it will not be used when the user name is blank.
  • Specifying the server name

           The server name is simply the name of the SQL Server or named instance i.e. the hostname (for a default instance), or <host>/<instname>
Starting with release 6.40 however there are some special considerations that should be taken into account.  When running with kernel release 6.40 or later, the R/3 system will prepend a protocol specifier to the server name.  Example:
   1. For a server running on the same server:
            np:<servername>
  2. For a remote server:
            tcp:<servername>
This forces the connection to be made with a named pipes and tcp/ip protocols respectively.
When specifying the server name you can override this by setting your own protocol (tcp: or np:), or you can make R/3 avoid setting any prefix by using simply :<servername> - a colon in front of the server name.

B.      访问ORACLE的配置示例()
   Connection name        logical name of the connection
     DBMS                   ORA
     User name              Oracle users
     DB password            password for the above-mentioned Oracle user
     Conn.info              TNS alias
     Permanent              Usually should not be set for a secondary connection.
 
3.       程序中如何使用

例程一
report zdbcon .
data: dbn(128).
EXEC SQL.
CONNECT TO 'DAN1'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'DAN1'
ENDEXEC.
EXEC SQL.
SELECT db_name() INTO :DBN FROM SVERS
ENDEXEC.
write: / 'current database name', dbn. 
DAN1在DBCON表中配置
CON NAME DAN1
DBMS MSS
USER NAME iis_log
PASSWORD CON ENV
MSSQL_SERVER=tcp:###.###.###.### MSSQL_DBNAME=iislog


例程二
Here is an example for how to connect to another server with CON_NAME=BSK.  The example assumes BSK is running R/3:

 EXEC SQL.
  CONNECT TO 'BSK'
ENDEXEC.
EXEC SQL.
  SET CONNECTION 'BSK'
ENDEXEC.
EXEC SQL.
  SELECT db_name() INTO :DBN FROM SVERS
ENDEXEC.
WRITE: / 'current database name', DBN.
EXEC SQL.
  SET CONNECTION DEFAULT
ENDEXEC.
EXEC SQL.
  SELECT db_name() INTO :DBN FROM SVERS
ENDEXEC.
WRITE: / 'current database name', DBN.

notes: https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=178949&nlang=EN&smpsrv=https%3a%2f%2fwebsmp103%2esap-ag%2ede

转载于:https://www.cnblogs.com/duadu/archive/2006/08/30/6166930.html

相关文章:

  • SQL简繁转换函数
  • 政府部门信息化人员的定位
  • 世界上最成功的人一开始是个程序员-《程序员大本营》1999版
  • 【Vegas原创】asp.net页面作为邮件正文发送
  • bp网络参数说明
  • ASP.NET 2.0发送电子邮件全面剖析之二
  • 构建高性能web之路------读《构建高性能web站点》有感
  • js中for循环的问题
  • Windows Phone 7程序独立存储空间容量测试
  • JS弹出窗口的运用与技巧
  • 英国Windows Phone 7 Tech Day上的演讲概述
  • 我的2006
  • 在内核模块中通过系统调用ioctl获取ATA/SCSI硬盘序列号
  • 【转】GTD,高效的时间管理系统
  • 应用了归一化的预测
  • [nginx文档翻译系列] 控制nginx
  • [译] 怎样写一个基础的编译器
  • 2017届校招提前批面试回顾
  • canvas绘制圆角头像
  • JavaScript 奇技淫巧
  • JavaScript服务器推送技术之 WebSocket
  • Mysql优化
  • node学习系列之简单文件上传
  • react-core-image-upload 一款轻量级图片上传裁剪插件
  • Spring Cloud Feign的两种使用姿势
  • tweak 支持第三方库
  • TypeScript实现数据结构(一)栈,队列,链表
  • Vue.js 移动端适配之 vw 解决方案
  • Vue官网教程学习过程中值得记录的一些事情
  • 从 Android Sample ApiDemos 中学习 android.animation API 的用法
  • 从零开始的webpack生活-0x009:FilesLoader装载文件
  • 道格拉斯-普克 抽稀算法 附javascript实现
  • 工作中总结前端开发流程--vue项目
  • 解析 Webpack中import、require、按需加载的执行过程
  • 批量截取pdf文件
  • 如何实现 font-size 的响应式
  • 如何使用 OAuth 2.0 将 LinkedIn 集成入 iOS 应用
  • 手写一个CommonJS打包工具(一)
  • 微信支付JSAPI,实测!终极方案
  • 我是如何设计 Upload 上传组件的
  • 再次简单明了总结flex布局,一看就懂...
  • 正则与JS中的正则
  • [地铁译]使用SSD缓存应用数据——Moneta项目: 低成本优化的下一代EVCache ...
  • 正则表达式-基础知识Review
  • ​VRRP 虚拟路由冗余协议(华为)
  • ​无人机石油管道巡检方案新亮点:灵活准确又高效
  • (ctrl.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MDd_DynamicDebug”不匹配值“
  • (Java)【深基9.例1】选举学生会
  • (pytorch进阶之路)CLIP模型 实现图像多模态检索任务
  • (附源码)ssm航空客运订票系统 毕业设计 141612
  • (亲测)设​置​m​y​e​c​l​i​p​s​e​打​开​默​认​工​作​空​间...
  • (五) 一起学 Unix 环境高级编程 (APUE) 之 进程环境
  • (一)Thymeleaf用法——Thymeleaf简介
  • (转)fock函数详解
  • (转)nsfocus-绿盟科技笔试题目