Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Copy a file to DB server from a remote machine using plsql+java

853678Apr 7 2011 — edited Oct 2 2013
Hi!

I've been past the last 2 days trying to test a file transfer between two machines in the same domain. But this been a nasty job by now...

The SO's of both machines is Windows.

One machine have Oracle installed and from there I'm invoking a prompt command as you can see below:

BEGIN
host_command (p_command => 'copy "\\<ip>\tests\test.pdf" "C:\oracle\ora92\database"');
END;
*/*

I've followed this [ article|http://www.dba-oracle.com/t_execute_operating_system_os_command_oracle.htm] before that :p

The directory *"\tests\test.pdf"* in the remote machine have all permissions to "Everyone" for now. Yes, I've a problem: When I run the "host_command" I'm getting this message:

*"Method called.*
*Process out :Access is denied.*
*PL/SQL procedure successfully completed."*

I've tried the below command with sucess to check if I can use the "copy" command:
host_command (p_command => 'host_command (p_command => 'copy "C:\oracle\ora92\database\sqlnet.log" "C:\oracle\ora92\database\sqlnet1.log"');

I think when I invoke the command prompt from Java, Windows use a "Default User". But, I don't know exactly where is the problem here. Permissions of this user, of the Oracle service...

Please, any help will be appreciated.

Cheers,
VĂ­tor Reis

Edited by: user8493834 on Apr 7, 2011 8:57 AM

Edited by: user8493834 on Apr 7, 2011 8:57 AM

Edited by: user8493834 on Apr 7, 2011 9:21 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 30 2013
Added on Apr 7 2011
8 comments
859 views