Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    34

    Unanswered: utl_file - network copy problem

    Hi all

    I have 2 windows2000 machines & i am trying to use the network copy feature of oracle9i.

    One win2k pc has the oracle9i database installed.

    Both the machines are in 2 different workgroups(windows workgorup) & not in the same domain(windows domain).

    I have created 2 directories from the sys database login

    -- source directory
    create or replace directory dbdir as 'C:\TEMP\LOC1\';

    -- destination directory
    create or replace directory networkdir as '\\ORCL8i\TEMP';

    I have given appropriate privileges to scott user
    ************************************************
    grant read on directory networkdir to scott;
    Grant read on directory dbdir to Scott;
    ************************************************

    -- the code
    ************************************************


    Create or Replace procedure UTLTESTCOPY as

    f1 utl_file.file_type;

    begin

    f1 := utl_file.fopen('DBDIR','NEWFILE.TXT','R');

    UTL_FILE.FCOPY(SRC_LOCATION=>'DBDIR',

    SRC_FILENAME=>'NEWFILE.TXT',

    DEST_LOCATION=>'NETWORKDIR',

    DEST_FILENAME=>'NEWFILECOPY.TXT');

    UTL_FILE.FCLOSE(F1);

    END;

    ************************************************

    This code compiles properly but gives a runtime error

    ERROR at line 1:
    ORA-29283: invalid file operation
    ORA-06512: at "SYS.UTL_FILE", line 18
    ORA-06512: at "SYS.UTL_FILE", line 1064
    ORA-06512: at "SCOTT.UTLTESTCOPY", line 9
    ORA-06512: at line 1


    Is it that the source & destination directories (i.e the windows machines holding these directories) have to be a part of the same windows domain.

    Can some help me out


    Rgrds

  2. #2
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    I ran into a similar problem using NT and Ora8i. Oracle "officially" does not support networked drives with the UTL_FILE package.

    Problem is that networked drives are mapped when a user logs into the OS. Oracle, since it runs as a process (without need of an named OS user), it will not find the network drive.

    Our only solution was to leave a user logged into Windows...

    One thing to remember... Oracle is running as a Windows process with credentials as "System User". If you connect to the network drive as a Network User, and start Oracle as the System User, you will still have problems. You will have to do one of two things: 1) change the "start service as" to match the Network User, or 2) give the System User ("administrator") privileges to the mapped directory.

    Hope this helps!

    JoeB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •