Determine size of big files in XDB
Lars73Aug 28 2006 — edited Aug 30 2006Hello,
my target is to determine the size of a file in the xdb (10.2.0.1).
The file was uploaded with ftp to the xdb. In the sample Content Management Systen (http://www.oracle.com/technology/sample_code/tech/xml/xmldb/cmsxdb/index.html) I have found the following statement:
SELECT TO_CHAR(extractvalue(res, '/Resource/Owner/text()'))
,SUBSTR(TO_CHAR(extractvalue(res, '/Resource/CreationDate/text()'), 'DD-MON-YYYY'), 1, 12)
,SUBSTR(TO_CHAR(extractvalue(res, '/Resource/ModificationDate/text()'), 'DD-MON-YYYY'), 1, 12)
,TO_CHAR(extractvalue(res, '/Resource/Language/text()'))
,TO_CHAR(extractvalue(res, '/Resource/ContentType/text()'))
,TO_CHAR(NVL(extractvalue(res, '/Resource@VersionID'), '-1') )
,TO_CHAR(NVL(DBMS_LOB.GETLENGTH(XDBUriType(any_path).getclob()), 0) )
FROM XDB.resource_view
WHERE any_path LIKE ('/%')
The statement works correct.
But for a big file (100 MB), the statement is very slow.
All I want is the size. Is there a faster way (PL/SQL, Java, SQL).
Regards Lars