This discussion is archived
6 Replies Latest reply: Mar 15, 2013 6:25 AM by 967476 RSS

dbms_scheduler.put_file Function

967476 Newbie
Currently Being Moderated
Hello everyone,

I want to copy a file from server to my client machine. Can I use dbms_scheduler.put_file for this action. And if your answer is yes how can I do this.
Or your answer is no why can' t I do and how can I copy file from server to my client?

Thank you all very much.
  • 1. Re: dbms_scheduler.put_file Function
    spajdy Pro
    Currently Being Moderated
    Probably yes. It is new feature of 11R2 I never saw this function before.
    Check documentation for details.
    But in general you DB server must have access to you client machine via network -> you have to create some shared network folder on you local machine and make it accessible for user under which DB is running on your server.
  • 2. Re: dbms_scheduler.put_file Function
    967476 Newbie
    Currently Being Moderated
    I have created a shared folder and all users on network can acces this folder. For example in my server I can copy a file with using command prompt, but I can' t do this with using database.
  • 3. Re: dbms_scheduler.put_file Function
    spajdy Pro
    Currently Being Moderated
    See this doc example http://docs.oracle.com/cd/E11882_01/server.112/e25494/dfiles008.htm#ADMIN11439
  • 4. Re: dbms_scheduler.put_file Function
    967476 Newbie
    Currently Being Moderated
    Thank you for reply, but I read it that link before. And I don't be able to copy still.

    Edited by: Siyah on 08.Mar.2013 00:28
  • 5. Re: dbms_scheduler.put_file Function
    978204 Newbie
    Currently Being Moderated
    Hi Siyah -

    Here is a example of a job I use to copy files on our UNIX server:

    begin
    dbms_scheduler.create_job (
    job_name => 'JOB_COPY_FILE',
    job_type => 'EXECUTABLE',
    job_action => '/bin/cp',
    number_of_arguments => 2,
    credential_name => 'COPY_FILE_CREDENTIAL');

    dbms_scheduler.set_job_argument_value(
    job_name => 'JOB_COPY_FILE',
    argument_position => 1,
    argument_value => '/from_directory/myfile');

    dbms_scheduler.set_job_argument_value(
    job_name => 'JOB_COPY_FILE',
    argument_position => 2,
    argument_value => '/to_directory/myfile');
    end;

    The UNIX user set up for the Oracle Database does not have access to the directories, so a CREDENTIAL has been set up using a different UNIX user which does have this access. This is a security feature which allows us to limit access to the UNIX server.

    This is not exactly what you are asking for ... but maybe you can modify it to meet your needs. Is there a UNIX command that would let you copy from the server to your client? All I can think of is FTP

    Edited by: 975201 on Mar 11, 2013 2:48 PM
  • 6. Re: dbms_scheduler.put_file Function
    967476 Newbie
    Currently Being Moderated
    Thank you for reply.
    I am a little bit busy nowadays but I will try your comment when I have a time.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points