Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

1,258 views
Skip to first unread message

thtsa...@yahoo.com.hk

unread,
Jun 2, 2005, 11:45:02 AM6/2/05
to
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

thtsa...@yahoo.com.hk

unread,
Jun 15, 2005, 2:46:19 PM6/15/05
to
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

asi...@gmail.com

unread,
Dec 31, 2013, 7:20:26 AM12/31/13
to
hi
can you please explain how did you make the copy and how you used it?
0 new messages