SAS/使用rsubmit连接到Oracle [英] SAS/Connect to Oracle with rsubmit

查看:320
本文介绍了SAS/使用rsubmit连接到Oracle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从本地计算机连接到Oracle DB,并且使用以下libname语句.

I am trying to connect to Oracle DB from my local computer and I use the following libname statement.

libname liblibb oracle path='galaxy' defer=no
                  connection=globalread readbuff=4000 ;

这有效...因为它使用Windows AD详细信息进行登录. 但是,问题是当我使用rsubmit(server UNIX)运行此libname语句时.

this works... as it uses the windows AD details to login. However, the problem is when i run this libname statement with rsubmit(server UNIX).

rsubmit;
libname liblibb oracle path='galaxy' defer=no
                  connection=globalread readbuff=4000 ;

endrsubmit;

错误:

ORA-01017 Invalid Username/Password
Error in the LIBNAME statement

但是当我将其与用户名和密码一起使用时,它可以工作.

But when I use it with username and password it works.

rsubmit;
libname liblibb oracle path='galaxy' user=xxxx password='xxxx'       
defer=no
                  connection=globalread readbuff=4000 ;
endrsubmit; 

是否有可能在rsubmit上登录到Oracle,而无需在用户名和密码的dbprompt之类的libname语句中写入用户和密码的详细信息呢?或者我们如何使UNIX与Windows AD一起与Oracle同步工作,从而采用单一登录概念.

Is there any possible way to logon to Oracle on rsubmit without writing the user and password details in the libname statement or atleast like a dbprompt for the username and password? or how can the we make UNIX work with the windows AD in sync with Oracle so it takes the single sign on concept.

推荐答案

在使用rsubmit时,您正在将该语句传递给远程服务器,并且该语句正在远程服务器上运行.所以 1.您的凭据应可用于远程服务器上的语句 2.您的远程服务器应该可以访问oracle

When you are using rsubmit, you are passing the statement to the remote server and the statement is running on the remote server. Therefore 1. Your credentials should be available to the statement on the remote server 2.Your remote server should have access to oracle

在第一种情况下,当您在本地计算机上使用libname语句时,odbc连接必须在连接配置文件中保存了uid和密码.因此无需指定. 在第二种情况下,配置文件中没有保存您的凭据.因此,您需要在远程计算机上使它们可用. 一种方法是将用户名和密码另存为宏,并在服务器上可用. 一个典型的场景将是这样的 %let dbpw = your_db_passwd; %let usrid = your_user_id; 它们可以放置在您认为安全的任何位置,可能在登录脚本中,也可以在本地计算机上程序外部的任何位置.将此包含在%include语句中.

In the first case when you use libname statement on the local machine the odbc connection must be having uid and password saved in the connection profile. So no need to specify. In the second case the profile does not have your credentials saved.Therefore you need to have them available there on the remote machine. One approach is to save user name and password as macros and make available on server. A typical scenario will be like this %let dbpw= your_db_passwd; %let usrid= your_user_id; These could be placed anywhere you feel secure may be in the sign on script or some where outside your program on the local machine. Include this with %include statement.

%include passwd_file.sas;

现在使它们作为

%syslput dpw=&dbpw;
%syslput userid=&userid;
rsubmit;
libname liblibb oracle path='galaxy' user=&userid password="&dbpw"       
defer=no
                  connection=globalread readbuff=4000 ;
your_program_statements_here;
endrsubmit; 

这就是我的用法.

这篇关于SAS/使用rsubmit连接到Oracle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆