Unix Technical Forum

ORA-22288 when DBMS_LOB.FILEOPEN even if server can see the file

This is a discussion on ORA-22288 when DBMS_LOB.FILEOPEN even if server can see the file within the Oracle Miscellaneous forums, part of the Oracle Database category; --> I have created a BFILE. Most DBMS_LOB functions works. However, FILEOPEN does not work. Any solution? Same output from ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 06:54 AM
thtsang_yh@yahoo.com.hk
 
Posts: n/a
Default ORA-22288 when DBMS_LOB.FILEOPEN even if server can see the file

I have created a BFILE. Most DBMS_LOB functions works. However,
FILEOPEN does not work. Any solution?

Same output from SQLPLUS:
SQL> desc x
Name Null? Type
----------------------- -------- ----------------
Y BINARY FILE LOB

(Table x has a BFILE column Y)

1 declare
2 xx bfile;
3 a varchar2(100);
4 b varchar2(100);
5 c varchar2(100);
6 begin
7 select y into xx from x;
8 dbms_lob.filegetname(xx,c,b);
9 select directory_path into a
10 from all_directories
11 where directory_name=c;
12 dbms_output.put_line('Directory: ' || c);
13 dbms_output.put_line('Full Name: ' || a || '/' || b);
14 dbms_output.put_line('File Length: ' || dbms_lob.getlength(xx));
15 dbms_output.put_line('File Exists? ' || dbms_lob.fileexists(xx));
16 dbms_lob.fileclose(xx);
17 dbms_lob.fileopen(xx);
18* end;
SQL> /
Directory: XMLDIR
Full Name: /opt/oracle/ora_dir/xml_dir/glossary.xml
File Length: 28420
File Exists? 1
declare
*
ERROR at line 1:
ORA-22288: file or LOB operation FILEOPEN failed
ORA-06512: at "SYS.DBMS_LOB", line 523
ORA-06512: at line 17


SQL> !ls -la /opt/oracle/ora_dir/xml_dir/
Total 36
drwxrwxrwx 2 oracle oradba 4096 2005-06-02 23:26 .
drwxr-xr-x 6 oracle oradba 4096 2005-05-31 23:07 ..
-rwxrwxrwx 2 oracle oradba 28420 2002-08-01 09:20 glossary.xml

SQL> grant all on directory xmldir to system
2 /
grant all on directory xmldir to system
*
ERROR at line 1:
ORA-01749: you may not GRANT/REVOKE privileges to/from yourself

(Observations:
1. BFILE exists. Oracle is able to detect the file and find its size.
It can even close the file but cannot open it.
2. The physical file exists, owned by oracle. Both the file and the
directory is world accessible.
3. The code was run by a DBA (system) who is also the owner of
directory
4. Tried restart the db, no help
)

Any idea?

Oracle version: Oracle 10g 10.1.0.2.0 on Linux

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 07:01 AM
thtsang_yh@yahoo.com.hk
 
Posts: n/a
Default Re: ORA-22288 when DBMS_LOB.FILEOPEN even if server can see the file

I've eventually found out the cause: Oracle does not support hard link!
(Is this a bug or work as expected?) When I remove the hard link and
make a copy of the file, the procedure works!

This is the first time hard link works differently as normal file in my
linux history... Dare not test what happen if symbolic link is used :P

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:01 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com