ORA-29283 when writing file to server

I am trying to setup procedure that writes the result of a query to a file on the database server. I am currently testing the writing of file using some generic code.
The database is on Red Hat Linux. The directory was created on the server as the mfts_user account and the oracle user granted read/write access. This was verified by logging into the server as oracle and creating a file via "touch test.txt".
The following 2 procedures/functions were created to test utl_file:
create or replace FUNCTION dump_csv ( p_query IN VARCHAR2
, p_separator IN VARCHAR2 DEFAULT ','
, p_dir IN VARCHAR2
, p_filename IN VARCHAR2)
RETURN NUMBER
AS
l_output utl_file.file_type;
l_thecursor INTEGER DEFAULT dbms_sql.open_cursor;
l_columnvalue VARCHAR2(2000);
l_status INTEGER;
l_colcnt NUMBER DEFAULT 0;
l_separator VARCHAR2(10) DEFAULT '';
l_cnt NUMBER DEFAULT 0;
BEGIN
l_output := utl_file.fopen(p_dir, p_filename, 'w');
dbms_sql.parse(l_thecursor, p_query, dbms_sql.native);
FOR i IN 1 .. 255
LOOP
BEGIN
dbms_sql.define_column(l_thecursor, i, l_columnvalue, 2000);
l_colcnt := i;
EXCEPTION
WHEN others
THEN
IF(SQLCODE = -1007) THEN
EXIT;
ELSE
RAISE;
END IF;
END;
END LOOP;
dbms_sql.define_column(l_thecursor, 1, l_columnvalue, 2000);
l_status := dbms_sql.EXECUTE(l_thecursor);
LOOP
EXIT WHEN(dbms_sql.fetch_rows(l_thecursor) <= 0);
l_separator := '';
FOR i IN 1 .. l_colcnt
LOOP
dbms_sql.column_value(l_thecursor, i, l_columnvalue);
utl_file.put(l_output, l_separator || l_columnvalue);
l_separator := p_separator;
END LOOP;
utl_file.new_line(l_output);
l_cnt := l_cnt + 1;
END LOOP;
dbms_sql.close_cursor(l_thecursor);
utl_file.fclose(l_output);
RETURN l_cnt;
END dump_csv;
create or replace PROCEDURE TEST_DUMP_CSV
AS
l_count NUMBER;
l_fn VARCHAR2(30);
BEGIN
SELECT TO_CHAR(SYSDATE,'YYYYMMDDHH24MISS') INTO l_fn FROM DUAL;
l_count := dump_csv( p_query => 'select * from coreq',
p_separator => ',',
p_dir => 'OUTBOUND_NEW_DIR',
p_filename => 'dump_csv' || l_fn || '.csv' );
dbms_output.put_line( to_char(l_count) || ' rows extracted to file dump_csv' || l_fn || '.csv.' );
END TEST_DUMP_CSV;
To test utl_file, I execute as the MAXIMO user:
CREATE OR REPLACE DIRECTORY outbound_new_dir AS '/home/mfts_user/Maximo/outbound_new';
select dump_csv('select * from coreq', ',', 'OUTBOUND_NEW_DIR', 'dump_csv.csv' ) from dual;
Here is the error I get:
ORA-29283: invalid file operation
ORA-06515: at "SYS.UTL_FILE", line 449
ORA-29283: invalid file operation
ORA-06512: at "MAXIMO.DUMP_CSV", line 15
ORA-06512: at line 1
This same setup works on Windows XP when logged in as an Admin user, which tells me that the syntax and logic is correct.
What could be wrong with the Linux setup?

Yes. I read that read/write is automatically granted to the user that creates the DIRECTORY object.
The result of the query you gave was 2 records:
GRANTOR GRANTEE TABLE_SCHEMA TABLE_NAME PRIVILEGE GRANTABLE HIERARCHY
SYS     MAXIMO     SYS     OUTBOUND_NEW_DIR     READ     YES     NO
SYS     MAXIMO     SYS     OUTBOUND_NEW_DIR     WRITE     YES     NO

Similar Messages

  • Dreamweaver CS5 crashes when putting file to server.

    Recently I've had occational crashes when putting file to server, but it worked when I rebooted
    system. Now, even I reboot the system, whenever I try to put a file into the web server, it crashes.
    Message shows:
    Adobe Dreamweaver CS5 has stopped working
    A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available.
    Has anyone found a solution to this?
    FYI, I'm using windows 7 64bit on intel i7 machine with 12GB RAM.
    Your help is appreciated.

    Try restoring your preferences
    http://kb2.adobe.com/cps/839/cpsid_83912.html#main_Restore7V

  • Itunes 9.2.1.5 "Error when writing file C:\program files\apple software....

    Got an error message when installing itues 9.2.1.5 "Error when writing file C:\program files\apple software update\softwareupdate.exe you do not have admin right to read/write the menu." "寫入檔案時發生錯誤 C:\program files\apple software update\softwareupdate.exe 你沒有權限存取目錄"
    There is no "apple software update" folder in my C:\program files\
    I tried to uninstalled all apple related software, restart the computer and reinstall the itunes, I still get this error message.
    It appears that the installation of quicktime was successful.

    After the last update I get "QuickTime was not found" Error I have uninstalled and re-installed itunes 9.2.1.5. several times but the problem persists

  • Out of disk space when copying files from server to server

    Servers: NW 5.1.7
    Workstation: Windows 98SE with client32 v3.4
    There is a batch file that copies files from server A to server B. At certain point, the copying gets stuck and message is displayed on the workstation: ""Network Status. Client32: out of disk space writing file to server B." Unless I press OK, the copying will not continue. There's plenty of space and memory, no quotes or user restrictions on server B. This procedure worked for years without any problem and nothing was altered on the servers or workstation at time of occurrence.

    Did you purge the volumes ?
    How high is ratio between compressed and noncompressed data on volumes?
    I assume, that for this usage (copy one server to another) you should
    seek the different way (program), which transfer the compressed data
    with untouched state of compression.
    Jindrich Kovar
    Marty Fox napsal(a):
    > Servers: NW 5.1.7
    > Workstation: Windows 98SE with client32 v3.4
    > There is a batch file that copies files from server A to server B. At certain point, the copying gets stuck and message is displayed on the workstation: ""Network Status. Client32: out of disk space writing file to server B." Unless I press OK, the copying will not continue. There's plenty of space and memory, no quotes or user restrictions on server B. This procedure worked for years without any problem and nothing was altered on the servers or workstation at time of occurrence.

  • Slow response when updating files on server

    Hey there,
    I'm trying to pinpoint a problem I'm having with my Mac Pro and MacBook Pro regarding very slow page refreshes when modifying files on my server via browser. I'm using a software package called Photo Cart that is a shopping cart for my website. It uses a MySQL database and I seem to have the problem primarily when changes are made to the database. When I make a change to one of the settings on the web app admin, I am stuck waiting for the page to come back for exactly 2 minutes. The change I specify seems to update instantly, as I can see the updated settings on the client side from another computer during the wait time. Also, during the wait, I cannot access the admin area, or the store front from the offending computer. The result is the same on Safari 5.0.2 and Firefox 3.6 & 4b10.
    Any idea why this might be happening? A guy on the support forum for Photo Cart said, "A very few Macintosh users have experienced similar things. The problem APPEARS to be related to local network hardware (router and/or modem)."
    I'm using a Time Machine for my router and it's connected to a Motorola Surfboard cable modem. This problem did not always occur, however, I don't know when it started and there has been no change to my network equipment since the last working state.
    I have no problems with any other web apps, including my WordPress site which is hosted on the same server and also uses a MySQL db.
    For now, I'm stuck editing my Cart from a crappy old PC laptop running XP (using the exact same network setup as the Mac Pro.) Not fun. What Gives

    It looks like I found the problem. Not sure why but it seems to be connected to fonts. After going though font book and cleaning out any duplicates the problem seems to have stopped. I hate fonts!

  • Intermittent FileNotFoundException exception when writing files

    OS: Windows
    JRE 1.3.1
    I have an application that tries to write files to an existing folder (overwriting the files that are already there). This code is run very often at my site, and I�ve never had a problem. At some customer sites, we get an intermittent exception:
    java.io.FileNotFoundException (Cannot create a file when that file already exists).
    Each time it is run and the exception occurs, a different file takes the hit. Sometimes running against one folder works and against another doesn�t, on the same machine. I don�t think file protections are an issue (if I try to reproduce the problem by marking a file to be written over as read-only, I get an �access denied� exception on that file consistently).
    Of course, it is intermittent at just a few sites, and I can�t reproduce it myself.
    I�m wondering if it is possible that some other process (say a virus scan or back-up utility) is temporarily locking files in a way such that when I do my FileOutputStream.write() I catch this exception. Has anyone seen or heard of anything like this?
    Thanks,
    Paul

    Are you sure you are not accidently trying to open an output stream on a directory? From the API docs:
    FileOutputStream
    public FileOutputStream(File file)
                     throws FileNotFoundExceptionCreates a file output stream to write to the file represented by the specified File object. A new FileDescriptor object is created to represent this file connection.
    First, if there is a security manager, its checkWrite method is called with the path represented by the file argument as its argument.
    If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason then a FileNotFoundException is thrown.
    Parameters:
    file - the file to be opened for writing.
    Throws:
    FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
    SecurityException - if a security manager exists and its checkWrite method denies write access to the file.
    See Also:
    File.getPath(), SecurityException, SecurityManager.checkWrite(java.lang.String)Note the case where a FileNotFoundException will be thrown.
    - Saish

  • Servlet coding - writing file to server

    Hi,
    I am using IBM's RAD as my IDE. In my servlet, I have coded:
                        // set the filename for the server side repository ...
                        serverFileName = "/web/UserSource/" + user + "-" + shortFileName;
                        // Open up the output file on server ...
                        FileOutputStream fos = new FileOutputStream(serverFileName);
                        Writer outf = new OutputStreamWriter(fos,"Cp1047");The above logic is inside an "if" construct, as I only can set the file name after some information is retrieved.
    Afterwards, outside of this "if", I try to write to the file like so, (another "if"):
                   if (cnt > 4 && !prevLine.equals(boundary)) {
                        outf.write(prevLine);
                        out.println("<br>" + prevLine);
                   }The outf.write(prevLine) statement is flagged as "outf cannot be resolved"
    why, since I have previously defined it?

    The above logic is inside an "if" construct, as I
    only can set the file name after some information is
    retrieved.
    Afterwards, outside of this "if", I try to write to
    the file like so, (another "if"):
                   if (cnt > 4 && !prevLine.equals(boundary)) {
                        outf.write(prevLine);
                        out.println("<br>" + prevLine);
    The problem is the scope of outf. Since it is declared in an if block, it goes out of scope when that block is exited, so it's no longer available after the first if. Declare the variable outside the if, so that it's still in scope when you get to the next if block.
    FileOutputStream fos;
    if (whatever) {
        FileOutputStream fos = new FileOutputStream(serverFileName);
    if (whatever) {
        outf.write(prevLine);
    }Message was edited by:
    hunter9000

  • ORA-00955 when upgrading from Content Server 5.0.2 to Publisher?

    I am upgrading Content Server 5.0.2 to Publisher.
    After running the sw installation and having imported the publisher.pte file, I am starting the Publisher and receiving an Oracle error "ORA-00955: name is already used by an existing object". From the messages logged, it looks like the error is encountered when recreating the object PCSACTIVE.PK_PCSACTIVE (first SQL statement with "Recreating ...", all others before where "Adding ...".
    My questions:
    1. has somebody else encounteered the same error?
    2. does anybody know how to trap the SQL being executed?As the upgrade is done automatically by the Publisher when starting, I have found so far no way of checking the SQL or knowing which SQL statements are executed against the DB) when "Recreating" an object.
    Thanks in advance for your help.
    P.S. Customer Support has also been contacted, but it looks like noone else has reported this kind of problems.

    Pl post OS details - are you using DBUA to upgrade ? Are there any errors in the database alert log ?
    ORA-00600 [kodpunp-nulltds], ORA-00600 [kokeeiix1], [600] When Upgrading To 11GR2 [ID 1367827.1]     
    HTH
    Srini

  • Do I have to use certificates when writing an HTTPS server

    I'm writing a client app and a server app. The client will connect to the server via HTTPS. A browser will never connect to this HTTPS server, just the client I have written. Can I skip the step of using certificates? I've been told it isn't a requirement. I just want SSL communication, that is all.
    When I try to do this, I get a handshake error, "no cipher suites in common'' coming from the client. The client seems okay because I can get it to connect to other secure web sites.
    So, certificates...must use in this case, or no?
    Thanks!!!

    Hi,
    I think you must use certificates if you want to do SSL communication.
    When using Netscape Navigator or IE to access files on a server that only has DSA-based certificates, a runtime exception occurs indicating that there are
    no cipher suites in common .
    By default, certificates created with keytool use DSA public keys. Navigator and IE do not use DSA public keys in their enabled cipher suites.
    To interact with IE or Navigator, you should create certificates that use RSA-based keys. To do this, you need to specify the -keyalg RSA option when using keytool. For Example:
    keytool -genkey -alias duke -ketstore testkeys -keyalg rsa
    Hope this will help you.
    Regards,
    Anil.
    Technical Support Engineer.

  • Photoshop CS4 error since Mavericks when open file from Server: "file is empty"

    Since I upgraded to Mavericks I can't open files directly from a Server (smb://..), it says "file is empty". When I copy the PSD file to my local drive I can open it though. I tried already to remove the server and reconnect. I'm using the CS4. Any idea how to fix that?

    My solution from another thread:-
    Hello - I recently upgraded to Mavericks and have experienced a number of problems, one of which matches yours, and after some experimentation found a solution.
    Like you, whenever I tried to open a file held on the server in any Adobe software, I would get an error that the file is empty. However, if I copied the file to my desktop, it would open without issue. i then noticed that the server name, which has a space in it, had %20 instead of a space, which drew me to the conclusion that Mavericks was reading the server incorrectly. I ejected the mounted server icons, and then click 'Go', 'Connect to Server', and reconnected. The server reconnected (and this time that space was restored) and I could open all of my files without issue.
    Hope this helps

  • Strange characters when writing files

    I've made a program using a FileWriter. The program is coded and compiled on a Linux PC. I'm using the filewriter to dynamically write HTML-lines. I use "\r" to write returns. On my Linux PC and on my Windows XP sp2 laptop it works fine. On the PC of a friend it does not work correctly. It sees the "\r" as an unknown character. The browser also comments on that (illegal character). She also has Windows XP sp 2 installed running explorer 6. What could be the solution for this problem? Should I recompile on my friends PC? It is strange though. We use the same Java version (1.5).

    I don't know why you aren't using a print writer (with a println) method.
    Regardless with text files you will always find that they will render correctly on one system and not another because different systems have different line seperators and some software is pretty crappy when it comes to display and gets it's knickers in a knot when it sees line seperators it doesn't like. i.e. Notepad.

  • WebLogic server's charset for writing files

    Hi!
    I have the following situation. Webapp (servlet) instantiates a class, which periodically writes data to files. The data is written to a file using the following code:
    fos = new FileOutputStream(outfile);
    //Don't wanna specify charset here
    fos.write(line.getBytes());
    The question is, where do I specify the charset to be used? Weblogic-application.xml has the following definition:
    <application-param>
    <param-name>webapp.encoding.default</param-name>
    <param-value>UTF-8</param-value>
    </application-param>
    Should this define also the encoding used when writing files, or should I define it in the server startup somehow, or what?

    Hi!
    I have the following situation. Webapp (servlet) instantiates a class, which periodically writes data to files. The data is written to a file using the following code:
    fos = new FileOutputStream(outfile);
    //Don't wanna specify charset here
    fos.write(line.getBytes());
    The question is, where do I specify the charset to be used? Weblogic-application.xml has the following definition:
    <application-param>
    <param-name>webapp.encoding.default</param-name>
    <param-value>UTF-8</param-value>
    </application-param>
    Should this define also the encoding used when writing files, or should I define it in the server startup somehow, or what?

  • Crashing in PS CS and Quark when opening files over network

    Mac Pro and MacBook Pro 10.4.8 using Adobe Photoshop CS2 and Quark 6.52 will crash or become VERY unstable when opening files from server or remote machine. Server is 10.3.9 or remote Mac running 10.4.7, all works fine IF file are copied to client machine, but cannot use -File/Open dialog. This is a network isue in relation to Intel translation, is there a fix (Rosetta?)

    Try looking for some "special" characters in file or folder names ( e.g. / or ?).
    I had similar problems with PPC-Apps (InDesign CS2 and 4D Client 2003) since 10.4.7 and 10.4.8. App crashes or shows strange grey boxes on the screen when I tried to open files over the network, no probs with same files locally.
    MacBook Pro   Mac OS X (10.4.8)  

  • Errors when writing metadata to files on Windows Server

    Good day!
    I have an iMac running OSX 10.9 (Maverick) and Lightroom 5.2.
    My catalog is on the local iMac drive, and the images are on SMB shared drive (handled by Windows 2012 server).
    I decided to do the final layout of my album using InDesign, and for that I needed to access to images using Bridge. So selected all the images (the rated once...) and issue a Metadata/Save command.
    The system came back with errors on many of the files (such as Photos are read only, and unknown errors).
    Retrying to save the metadata on image that was flagged with an error usually (but not always) worked.
    I tried to select save the metadata for few (6) images in a time, many times it was ok, but sometimes, one or two of them failed (and retrying again usually solved the problem).
    It looks to me like a timing related issue.
    Any ideas?
    (After spending about an hour on this, I have exported the images to my local drive...). In general I don't have similar problems with other apps.
    Any ideas?
    Yuval

    I Yuval
    I'm experiencing more or less the same behavior (see Read-only error when writing metadata to file over network (Synology DS1315+ using AFP) ). For me however, the problem is more pronounced if I use the AFP protocol and is better (I think as you described) if I use SMB (all done on a Synology DS1315+). With SMB it most often works but in very rare cases I also get the "read only" message!
    Do you have solution to this? Or are you stuck as I am?
    Cheers, Chris

  • ORA-29283 invalid file operation

    NLSRTL      10.2.0.5.0     Production
    Oracle Database 10g Enterprise Edition      10.2.0.5.0     64bi
    PL/SQL      10.2.0.5.0     Production
    TNS for IBM/AIX RISC System/6000:      10.2.0.5.0     Productio
    I am trying to get the content of a trace file generated for me.
    Because I don't have privileges to log on the server and copy the trace file for me directly with some os user, I am doing the following:
    1. I alter my session trace identifier to easier identify the trace file
    ALTER SESSION SET TRACEFILE_IDENTIFIER = 'Func01';2. I invoke DBMS_MONITOR
    3. I run the procedure I want to monitor.
    4. I disable the monitoring by calling DBMS_MONITOR
    5. At this point I run the following query to identify my trace file:
    select u_dump.value || '/' || instance.value || '_ora_' || v$process.spid || nvl2(v$process.traceid, '_' || v$process.traceid, null ) || '.trc'"Trace File"
    from V$PARAMETER u_dump
    cross join V$PARAMETER instance
    cross join V$PROCESS
    join V$SESSION on v$process.addr = V$SESSION.paddr
    where 1=1
       and u_dump.name = 'user_dump_dest'
       and instance.name = 'instance_name'
       and V$SESSION.audsid=sys_context('userenv','sessionid');It gives me: /ORACLE/MYDB/trace/MYDB_ora_3616822_Func01.trc
    I have created directory in advanced on the path where the traces are stored:
    CREATE OR REPLACE DIRECTORY trace_dir AS '/ORACLE/MYDB/trace/';
    SELECT * FROM dba_directories WHERE directory_name = 'TRACE_DIR';
    Output:
    OWNER DIRECTORY_NAME DIRECTORY_PATH
    SYS     TRACE_DIR      /ORACLE/MYDB/trace/I don't have rights to grant read, write on TRACE_DIR to my user, as I am not logged with SYS.
    I created a table to store in it the lines from the trace file:
    CREATE TABLE tmp_traces_tab
      callnum NUMBER,
      line NUMBER,
      fileline CLOB
    );Then I run the following PL/SQL block to retrieve the content of the trace and store it in the table T:
    DECLARE
      l_file            UTL_FILE.file_type;
      l_location     VARCHAR2 (100) := 'TRACE_DIR';
      l_filename    VARCHAR2 (255) := 'MYDB_ora_3616822_Func01.trc';
      l_text           VARCHAR2 (32767);
      l_line           NUMBER := 1;
      l_call           NUMBER := 1;
    BEGIN
      -- Open file.
      l_file := UTL_FILE.fopen (l_location, l_filename, 'r', 32767);
      -- Read and output first line.
      UTL_FILE.get_line (l_file, l_text, 32767);
      INSERT INTO tmp_traces_tab (callnum, line, fileline) VALUES (l_call, l_line, l_text);
      l_line := l_line + 1;
      BEGIN
        LOOP
          UTL_FILE.get_line (l_file, l_text, 32767);
           INSERT INTO tmp_traces_tab (callnum, line, fileline) VALUES (l_call, l_line, l_text);
           l_line := l_line + 1;
        END LOOP;
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
          NULL;
      END;
      INSERT INTO tmp_traces_tab (callnum, line, fileline) VALUES (l_call, l_line, l_text);
      l_line := l_line + 1;
      UTL_FILE.fclose (l_file);
    END;
    /And when I run the code I get the error: ORA-29283 invalid file operation.
    Is it possible to a role my user to be able to get the content of the trace files in the directory TRACE_DIR without having explicit READ , WRITE privileges on it?
    My user currently has these roles:
    select * from dba_role_privs where grantee = USER;
    Output:
    U1     OPR_ROLE_LOSS_SNAPSHOT_READER     YES     YES
    U1     RESOURCE     NO     YES
    U1     CONNECT     NO     YES
    U1     DBA     NO     YES
    U1     OPR_ROLE_SUPPORT_USER     YES     YESI know that on another db with different user I hit no errors when doing completely the same (of course the program unit I monitor is different).
    That other user with which I have NO issues has these roles:
    select * from dba_role_privs where grantee = USER;
    Output:
    U2    DBA    NO    YES
    U2    EXEC_SYS_PACKAGES_ROLE    NO    YES
    U2    EXECUTE_CATALOG_ROLE    NO    YES
    U2    CONNECT    NO    YES

    Verdi wrote:
    NLSRTL      10.2.0.5.0     Production
    Oracle Database 10g Enterprise Edition      10.2.0.5.0     64bi
    PL/SQL      10.2.0.5.0     Production
    TNS for IBM/AIX RISC System/6000:      10.2.0.5.0     Productio
    And when I run the code I get the error: ORA-29283 invalid file operation.
    Is it possible to a role my user to be able to get the content of the trace files in the directory TRACE_DIR without having explicit READ , WRITE privileges on it?
    My user currently has these roles:
    select * from dba_role_privs where grantee = USER;
    Output:
    U1     OPR_ROLE_LOSS_SNAPSHOT_READER     YES     YES
    U1     RESOURCE     NO     YES
    U1     CONNECT     NO     YES
    U1     DBA     NO     YES
    U1     OPR_ROLE_SUPPORT_USER     YES     YESI know that on another db with different user I hit no errors when doing completely the same (of course the program unit I monitor is different).
    Thanks for posting version alongwith other details.
    TO my knowledge, No you cannot.
    Privileges acquired via a Role are not valid in PL/SQL. You need to have explicit privileges.

Maybe you are looking for

  • PO text transfer to Back-end in case of Extended Classic Scenario in SRM 4.

    Dear experts, My system is in SRM 4.0 in Extended Classic Scenario. We use in the PO internal note text and vendor But thses texts are not transfered to Back-end. Is it normal? Do I need to customize something? Can it be achieved by BADi? How then? O

  • What's wrong with my script?

    Can someone please look to see what's wrong with my navigation bar here: http://www.simple-it.us/index2.html. The links don't work. At the top of the page you can download my files. If you figure it out, please tell me in laymen's terms. Flash is NOT

  • Which table is the po total stored

    can some one tell me which tabe the po total are stored for both blanket & standard po's

  • Not able to connect to RAC Database with VIP entries

    Hi All, My RAC database run with Physical Host entries in listener and tnsnames files. But VIP services are running in both nodes. Now i want to use VIP enties to connect to the RAC database from client side. I have modified the both the listener and

  • ORA-27369: job of type EXECUTABLE failed with exit code: Is a name file

    I am getting this error when I try to execute a file using /bin/sh , I create the file, do a chmod on the file and remove the file but I am have trouble executing it even though I can execute it form the command line. ORA-27369: job of type EXECUTABL