<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: possible file lock error in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125085#M727428</link>
    <description>hi,&lt;BR /&gt;&lt;BR /&gt;Normally, the oracle user should have read privileges on that directory at the OS level ..&lt;BR /&gt;&lt;BR /&gt;can you confirm this?&lt;BR /&gt;&lt;BR /&gt;revert&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
    <pubDate>Mon, 07 Jan 2008 17:54:38 GMT</pubDate>
    <dc:creator>Yogeeraj_1</dc:creator>
    <dc:date>2008-01-07T17:54:38Z</dc:date>
    <item>
      <title>possible file lock error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125081#M727424</link>
      <description>Hi,&lt;BR /&gt;I am trying to create a file dynamically on a unix server using plsql.&lt;BR /&gt;When i run the procedure,i am getting the below error.&lt;BR /&gt;"ORA-20103: Invalid Operation"&lt;BR /&gt;I also created a temporary file (with permissions 777) and yet nothing was written in the file.&lt;BR /&gt;Please find the plsql procedure below:&lt;BR /&gt;&lt;BR /&gt;CREATE OR REPLACE procedure schema.WriteProcedure&lt;BR /&gt;is&lt;BR /&gt;f UTL_FILE.FILE_TYPE;&lt;BR /&gt;var_id number(22);&lt;BR /&gt;var_intid varchar2(20);&lt;BR /&gt;&lt;BR /&gt;cursor file_cur is select col1,col2 from schema.table;&lt;BR /&gt;&lt;BR /&gt;begin&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;f := UTL_FILE.FOPEN('/home/gyan/tst','Dynamic-file-'|| to_char(sysdate, 'mm-dd-yyyy'),'W');&lt;BR /&gt;&lt;BR /&gt;open file_cur;&lt;BR /&gt;loop&lt;BR /&gt;fetch file_cur into var_id,var_intid;&lt;BR /&gt;exit when file_cur%notfound;&lt;BR /&gt;&lt;BR /&gt;UTL_FILE.PUT_LINE(f,var_id || '|' || var_intid );&lt;BR /&gt;&lt;BR /&gt;end loop;&lt;BR /&gt;close file_cur;&lt;BR /&gt;UTL_FILE.FCLOSE(f);&lt;BR /&gt;UTL_FILE.FCLOSE_ALL;&lt;BR /&gt;&lt;BR /&gt;EXCEPTION&lt;BR /&gt;WHEN UTL_FILE.INVALID_PATH THEN&lt;BR /&gt;RAISE_APPLICATION_ERROR(-20100,'Invalid Path');&lt;BR /&gt;WHEN UTL_FILE.INVALID_MODE THEN&lt;BR /&gt;RAISE_APPLICATION_ERROR(-20101,'Invalid Mode');&lt;BR /&gt;WHEN UTL_FILE.INVALID_FILEHANDLE THEN&lt;BR /&gt;RAISE_APPLICATION_ERROR(-20102,'Invalid Filehandle');&lt;BR /&gt;WHEN UTL_FILE.READ_ERROR THEN&lt;BR /&gt;RAISE_APPLICATION_ERROR(-20104,'Read Error');&lt;BR /&gt;WHEN UTL_FILE.WRITE_ERROR THEN&lt;BR /&gt;RAISE_APPLICATION_ERROR(-20105,'Write Error');&lt;BR /&gt;WHEN UTL_FILE.INTERNAL_ERROR THEN&lt;BR /&gt;RAISE_APPLICATION_ERROR(-20106,'Internal Error');&lt;BR /&gt;WHEN VALUE_ERROR THEN&lt;BR /&gt;RAISE_APPLICATION_ERROR(-20108,'Value Error');&lt;BR /&gt;WHEN UTL_FILE.INVALID_OPERATION THEN&lt;BR /&gt;RAISE_APPLICATION_ERROR(-20103,'Invalid Operation ');&lt;BR /&gt;when others then &lt;BR /&gt;dbms_output.put_line('done');&lt;BR /&gt;&lt;BR /&gt;end;&lt;BR /&gt;/&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gyan</description>
      <pubDate>Sun, 06 Jan 2008 17:42:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125081#M727424</guid>
      <dc:creator>Gyankr</dc:creator>
      <dc:date>2008-01-06T17:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: possible file lock error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125082#M727425</link>
      <description>Hi Gyan&lt;BR /&gt;&lt;BR /&gt;This is a user specified error message &lt;BR /&gt;&lt;BR /&gt;I think you can contact with your application vendor.&lt;BR /&gt;&lt;BR /&gt;This is mostly happen in application.</description>
      <pubDate>Sun, 06 Jan 2008 17:59:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125082#M727425</guid>
      <dc:creator>Jeeshan</dc:creator>
      <dc:date>2008-01-06T17:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: possible file lock error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125083#M727426</link>
      <description>Hi Gyan,&lt;BR /&gt;&lt;BR /&gt;Some suggestions:&lt;BR /&gt;&lt;BR /&gt;-- Before opening the files, check if they aren't already open:&lt;BR /&gt;&lt;BR /&gt;if TEXT_IO.IS_OPEN(f) then&lt;BR /&gt;  TEXT_IO.FCLOSE(f);&lt;BR /&gt;end if;&lt;BR /&gt;&lt;BR /&gt;-- Check if you have write permissions all the way to /home/gyan/tst&lt;BR /&gt;&lt;BR /&gt;-- Try the fopen command this way (added a slash after /home/gyan/tst and lowered the "W" case:&lt;BR /&gt;&lt;BR /&gt;f := UTL_FILE.FOPEN('/home/gyan/tst/','Dynamic-file-'|| to_char(sysdate, 'mm-dd-yyyy'),'w');&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Jan 2008 10:43:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125083#M727426</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2008-01-07T10:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: possible file lock error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125084#M727427</link>
      <description>Hi Eric,&lt;BR /&gt;&lt;BR /&gt; Before opening the files, check if they aren't already open:&lt;BR /&gt;&lt;BR /&gt;I am dynamically creating the file(with timestamp),so this would not apply for my case&lt;BR /&gt;&lt;BR /&gt;-- Check if you have write permissions all the way to /home/gyan/tst&lt;BR /&gt;&lt;BR /&gt;I am logging in as user gyan and have write permissions(umask 022)&lt;BR /&gt;&lt;BR /&gt;Try the fopen command this way (added a slash after /home/gyan/tst and lowered the "W" case:&lt;BR /&gt;&lt;BR /&gt;I did the same but still no success.&lt;BR /&gt;&lt;BR /&gt;I tried to remove all the exception statements and got the below error&lt;BR /&gt;&lt;BR /&gt;ORA-29283: invalid file operation&lt;BR /&gt;&lt;BR /&gt;Does the above exception mean i am having privilege problems to execute the procedure?&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gyan</description>
      <pubDate>Mon, 07 Jan 2008 16:44:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125084#M727427</guid>
      <dc:creator>Gyankr</dc:creator>
      <dc:date>2008-01-07T16:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: possible file lock error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125085#M727428</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Normally, the oracle user should have read privileges on that directory at the OS level ..&lt;BR /&gt;&lt;BR /&gt;can you confirm this?&lt;BR /&gt;&lt;BR /&gt;revert&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Mon, 07 Jan 2008 17:54:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125085#M727428</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2008-01-07T17:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: possible file lock error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125086#M727429</link>
      <description>Hi Yogeeraj,&lt;BR /&gt;the db username (eaxee) is the owner of the procedure.I am logging in as user "gyan" to the server(unix).My database resides on the same unix server(not somewhere remotely).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gyan&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Jan 2008 18:21:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125086#M727429</guid>
      <dc:creator>Gyankr</dc:creator>
      <dc:date>2008-01-07T18:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: possible file lock error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125087#M727430</link>
      <description>To add to the above the oracle user (eaxee) has read,write privileges on the directory created.&lt;BR /&gt;And the unix user (gyan) can create/delete/modify files under /home/gyan/tst&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Gyan</description>
      <pubDate>Mon, 07 Jan 2008 18:46:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125087#M727430</guid>
      <dc:creator>Gyankr</dc:creator>
      <dc:date>2008-01-07T18:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: possible file lock error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125088#M727431</link>
      <description>Hi Gyan,&lt;BR /&gt;&lt;BR /&gt;Try 3 more things:&lt;BR /&gt;&lt;BR /&gt;1- Please recheck the write permissions as gyan (I'm insisting this because /home... is a root path and you should consider using a no root directory) with the touch command:&lt;BR /&gt;&lt;BR /&gt;$touch /home/gyan/tst/x&lt;BR /&gt;&lt;BR /&gt;2- Ok, utl_file.fopen has 4 possible parameters and the last one can be null (I was relying on Reports text_io.fopen). Retry the function without the slash in the end of location parameter, with an extension in the filename parameter and with a lowered "w" at the open_mode parameter. Also add some debugging to have an idea where is the exception (make sure SERVEROUTPUT is ON):&lt;BR /&gt;&lt;BR /&gt;dbms_output.put_line('I am opening the following file: '||'/home/gyan/tst','Dynamic-file-'||to_char(sysdate, 'mm-dd-yyyy')||'.txt');&lt;BR /&gt;&lt;BR /&gt;f := UTL_FILE.FOPEN('/home/gyan/tst','Dynamic-file-'||to_char(sysdate, 'mm-dd-yyyy')||'.txt','w');&lt;BR /&gt;&lt;BR /&gt;dbms_output.put_line('I successfuly opened the following file: '||'/home/gyan/tst','Dynamic-file-'||to_char(sysdate, 'mm-dd-yyyy')||'.txt');&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Jan 2008 09:42:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/possible-file-lock-error/m-p/4125088#M727431</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2008-01-08T09:42:09Z</dc:date>
    </item>
  </channel>
</rss>

