暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle Pro * C: 如何为代理连接设置USERID预编译器选项

askTom 2017-09-12
352

问题描述

嗨,

有没有办法为代理连接设置Pro * C USERID预编译器选项?

例如,我有一个经过操作系统身份验证的用户GEORGE,他被授予 “通过” 用户GEORGE_P的连接,并且可以在SQL * Plus中执行与GEORGE_P的代理连接:

> whoami
乔治
> sqlplus/
SQL> 显示用户
用户是 “乔治”
SQL> 连接 [乔治 _ p]/
连接。
SQL> 显示用户
用户是 “乔治 _ p”

User 乔治 also needs to run the Pro*C precompiler against the database objects (tables, etc.) that GEORGE_P owns, but must not know GEORGE_P's password. Is there a way to set the USERID Pro*C precompiler option in order to achieve this?

> whoami
乔治
> proc INAME = sample1.pc错误 = 是用户id = ?????SQLCHECK = 满

谢谢!

专家解答

你只是使用相同的语法,例如

SQL> alter user scott grant connect through "XPS13\CONNOR";

User altered.


C:\temp>sqlplus [scott]/

SQL*Plus: Release 12.2.0.1.0 Production on Fri Sep 15 10:51:13 2017

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Last Successful login time: Fri Sep 15 2017 10:11:57 +08:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SQL> show user
USER is "SCOTT"
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


C:\temp>touch x.pc

C:\temp>proc userid=[scott]/ sqlcheck=full iname=x.pc oname=x.c

Pro*C/C++: Release 12.2.0.1.0 - Production on Fri Sep 15 10:52:12 2017

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

System default option values taken from: C:\oracle\product\12.2.0.1\precomp\admin\pcscfg.cfg


C:\temp>proc userid=[blah]/ sqlcheck=full iname=x.pc oname=x.c

Pro*C/C++: Release 12.2.0.1.0 - Production on Fri Sep 15 10:52:20 2017

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

System default option values taken from: C:\oracle\product\12.2.0.1\precomp\admin\pcscfg.cfg

PCC-F-02104, Unable to connect to Oracle
复制


「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论