通过 Oracle 的 Unix 命令

发布于 2024-11-30 18:39:34 字数 253 浏览 1 评论 0原文

我已经创建了一个 PL/SQL Java 源,并且已授予权限。

PL/SQL 过程正在执行,没有出现错误。 在 JavaSource 中有以下 unix 命令:

ls -al > /orion/list/list.txt

未在目录中创建文件 List.txt。

如果没有出现错误,我怎么知道问题所在? 这会不会是unix赋予oracle权限的问题。

Oracle是在unix sun Solaris上

I have created a PL/SQL a Java Source, and privileges have been granted.

The PL/SQL procedure is executing and no error is coming up.
Within the JavaSource there is the following unix command:

ls -al > /orion/list/list.txt

the file List.txt is not being created within the directory.

How would i know the problem if no errors are coming up?
Could this be a problem of rights being given to oracle from unix.

Oracle is on unix sun solaris

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

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

发布评论

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

评论(2

仅此而已 2024-12-07 18:39:34

从遥远的记忆中,我相当确定您需要向执行 Java 的用户授予一些权限,然后才允许其执行 unix 命令。

看看 http://download.oracle.com /docs/cd/B28359_01/java.111/b31225/chten.htm

我认为你需要给它java.io.FilePermission 权限。执行此操作的一种方法是将角色 JAVASYSPRIV 授予您的用户。我目前没有地方可以对此进行测试,但如果这不正确,上面的链接应该为您指明正确的方向。

From a distant memory, I am fairly certain you need to grant some privileges to the user executing the Java before it is allowed to execute unix commands.

Have a look at http://download.oracle.com/docs/cd/B28359_01/java.111/b31225/chten.htm

I think you need to give it java.io.FilePermission permission. One way to do this is to grant the role JAVASYSPRIV to your user. I have nowhere to test this out at the moment, but if that is not correct the link above should point you in the correct direction.

雾里花 2024-12-07 18:39:34

我同意斯蒂芬·奥唐纳的观点。

我最近实现了完全相同的 Java 功能(创建包含目录列表的文件)。

我需要授予以下内容:

-- this grants read privilege on STDIN
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.lang.RuntimePermission', 
   permission_name => 'readFileDescriptor', 
   permission_action => null
);

-- this grants write permission on STDOUT
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.lang.RuntimePermission', 
   permission_name => 'writeFileDescriptor', 
   permission_action => null
);

-- this grants execute privilege for the 'ls' command
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.io.FilePermission', 
   permission_name => '/bin/ls', 
   permission_action => 'execute'
);

-- this grants read, write, delete and execute on all 
-- of the referenced directories (subdirectories of <directory>)
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.io.FilePermission', 
   permission_name => '<directory>/-', 
   permission_action => 'read,write,delete,execute'
);

-- this grants execute on sh
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.io.FilePermission', 
   permission_name => '/bin/sh', 
   permission_action => 'read,execute' 
);

希望这有帮助。
奥利。

I concur with Stephen ODonnell.

I have implemented the exact same Java functionality (creating a file containing a directory listing) recently.

I needed to grant the following:

-- this grants read privilege on STDIN
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.lang.RuntimePermission', 
   permission_name => 'readFileDescriptor', 
   permission_action => null
);

-- this grants write permission on STDOUT
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.lang.RuntimePermission', 
   permission_name => 'writeFileDescriptor', 
   permission_action => null
);

-- this grants execute privilege for the 'ls' command
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.io.FilePermission', 
   permission_name => '/bin/ls', 
   permission_action => 'execute'
);

-- this grants read, write, delete and execute on all 
-- of the referenced directories (subdirectories of <directory>)
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.io.FilePermission', 
   permission_name => '<directory>/-', 
   permission_action => 'read,write,delete,execute'
);

-- this grants execute on sh
EXEC dbms_java.grant_permission(
   grantee => '<username>', 
   permission_type => 'SYS:java.io.FilePermission', 
   permission_name => '/bin/sh', 
   permission_action => 'read,execute' 
);

Hope this helps.
Ollie.

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