如何在 Oracle 视图中查看数据,就像通过应用程序查看数据一样?

发布于 2024-08-31 21:10:47 字数 433 浏览 7 评论 0原文

当我与我的应用程序用户和正确的职责一起浏览 Oracle 应用程序时,我看到了数据。
我使用“记录历史记录”菜单来查看应用程序使用哪个表/视图。
所以,我得到了 PA_EXPEND_ITEMS_ADJUST2_V

当我在 sqlplus 会话中与 apps 用户连接时,

SELECT * FROM PA_EXPEND_ITEMS_ADJUST2_V

给我 0 行。

我猜想 apps 有一些配置错误,但是什么?

如何在 sqlplus 会话中使用 apps 用户查看 PA_EXPEND_ITEMS_ADJUST2_V 的行?

如何在 Oracle 视图中查看数据,就像通过应用程序查看数据一样?

When I navigate through the Oracle application with my application user and the right responsibility, I see the data.
I use the "record history" menu to see which table/view is used by application.
So, I got PA_EXPEND_ITEMS_ADJUST2_V.

When I'm connected with apps user in a sqlplus session,

SELECT * FROM PA_EXPEND_ITEMS_ADJUST2_V

gives me 0 rows.

I guess that there's something is misconfigurated with the apps but what ?

How may I view the rows of PA_EXPEND_ITEMS_ADJUST2_V using apps user in a sqlplus session ?

How may I see the data in the Oracle view like I see it through the application ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

楠木可依 2024-09-07 21:10:47

这里可能发生了一些行级安全性。可能基于视图,可能是内置的 RLS/FGAC/VPD(或者他们在该版本中给出的任何缩写词)。这就是数据库在幕后重写查询以添加过滤器的地方。

一般是基于SYS_CONTEXT值。

There is probably some row-level security happening here. Possibly based on views, possibly the built-in RLS/FGAC/VPD (or whatever acronym they give it with that version). That's where the database rewrites the query behind the scenes to add in filters.

Generally there are based on SYS_CONTEXT values.

逆夏时光 2024-09-07 21:10:47

在 Oracle 应用程序中,您必须执行 APPS.FND_GLOBAL.apps_initialize 过程才能在 SQL*Plus 会话中拥有相同的上下文。我使用以下脚本来启动会话:

SET SERVEROUTPUT ON
DECLARE
   l_user_id   NUMBER;
   l_resp_id   NUMBER;
   l_app_id    NUMBER;
   l_resp_name VARCHAR2(100) := '<Name of your responsibility>';
   l_login VARCHAR2(30) := '<USERLOGIN>'
BEGIN
   SELECT user_id INTO l_user_id FROM fnd_user WHERE user_name = l_login;
   SELECT application_id, responsibility_id
     INTO l_app_id, l_resp_id
     FROM fnd_responsibility_vl
    WHERE responsibility_name = l_resp_name;
   apps.fnd_global.apps_initialize(l_user_id, l_resp_id, l_app_id);
   dbms_output.put_line('l_user_id = '||l_user_id);
   dbms_output.put_line('l_resp_id = '||l_resp_id);
   dbms_output.put_line('l_app_id = '||l_app_id);
END;
/

In Oracle Applications you have to execute the APPS.FND_GLOBAL.apps_initialize procedure to have the same context in a SQL*Plus session. I use the following script to start a session:

SET SERVEROUTPUT ON
DECLARE
   l_user_id   NUMBER;
   l_resp_id   NUMBER;
   l_app_id    NUMBER;
   l_resp_name VARCHAR2(100) := '<Name of your responsibility>';
   l_login VARCHAR2(30) := '<USERLOGIN>'
BEGIN
   SELECT user_id INTO l_user_id FROM fnd_user WHERE user_name = l_login;
   SELECT application_id, responsibility_id
     INTO l_app_id, l_resp_id
     FROM fnd_responsibility_vl
    WHERE responsibility_name = l_resp_name;
   apps.fnd_global.apps_initialize(l_user_id, l_resp_id, l_app_id);
   dbms_output.put_line('l_user_id = '||l_user_id);
   dbms_output.put_line('l_resp_id = '||l_resp_id);
   dbms_output.put_line('l_app_id = '||l_app_id);
END;
/
ゝ杯具 2024-09-07 21:10:47

您需要使用与应用程序所使用的用户相同的用户(或具有相同权限/角色的用户)登录 Oracle。

您需要与您的 DBA 交谈。

You will need to log into oracle with the same user ( or a user with the same rights/roles ) as what the application is using.

You need to talk to your DBA.

旧城空念 2024-09-07 21:10:47

另一种可能性(除了可能涉及的行级安全性之外)是视图基于一个或多个全局临时表 - 这意味着除非您从插入数据的同一会话中查询,否则您将看不到数据。

或者,应用程序可能会在完成数据后删除数据;)

Another possibility (apart from row-level security, which may be involved) is that the view is based on one or more global temporary tables - which means you won't see the data unless you query from within the same session that inserts it.

Or, perhaps, the app is deleting the data after it's finished with it ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文