ORA-31000 using global XML schema
Hi
I've got a problem with some global XML schemas in my database (version 10.1.0.3.0).
I registered these schemas using the Enterprise Manager Console.
I was logged into EM as user SYS but registered the schemas as owner TOOLS and scope visible to public.
I pasted the schema text directly into EM not using files or URLs.
As options I had only checked "Generate object types" option. I did not generate tables or beans. (I have the data in relational tables.)
That should give me schemas accessible to PUBLIC.
When I check in EM the schemas are correctly placed under /sys/schemas/PUBLIC.
I did not create specific ACL so the default all_all_acl.xml seems to be in effect.
When I check the XML tab of user PUBLIC in the EM it has all priviliges to all the schemas I created.
As a third user I now try to select an XMLTYPE instance like this:
SQL> select
2 /* Select XLMTYPE object */
3 xmlelement("Invoice",
4 xmlattributes(
5 'http://rep.oio.dk/ubl/xml/schemas/0p71/pie/' as "xmlns",
6 'http://rep.oio.dk/ubl/xml/schemas/0p71/common/' as "xmlns:com",
7 'http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/' as "xmlns:main",
8 'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
9 'http://rep.oio.dk/ubl/xml/schemas/0p71/pie/piestrict.xsd' as "xsi:schemaLocation",
10 'http://www.w3.org/1999/xhtml' as "xmlns:h"
11 ),
12 xmlforest(
<... large select omitted ... >
247 )
248 ).createSchemaBasedXML('http://rep.oio.dk/ubl/xml/schemas/0p71/pie/piestrict.xsd')
249 from xal_supervisor.debfakjour f, xal_supervisor.adresse a, xal_supervisor.firmaoplysninger o,
250 where f.dataset = 'DAT'
251 and f.fakturanummer = 2722310
252 and a.dataset(+) = f.dataset
253 and a.adrfileid(+) = 41
254 and a.adrrecid(+) = f.lxbenummer
255 and o.dataset = f.dataset
256 and m.dataset(+) = f.dataset
257 and m.medarbejder(+) = f.ordrebehandler;
ERROR:
ORA-31000: Resource 'http://rep.oio.dk/ubl/xml/schemas/0p71/pie/piestrict.xsd'
is not an XDB schema document
ORA-06512: at "SYS.XMLTYPE", line 208
ORA-06512: at line 1
I have no idea why this does not work.
If I query DBA_XML_SCHEMAS I get this:
SQL> select owner, local, schema_url
2 from dba_xml_schemas
3 where owner = 'TOOLS';
OWNER LOC SCHEMA_URL
-------- --- --------------------------------------------------------------------------------
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pieStrict.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/pie/pieLax.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/pcm/pcmStrict.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/pcm/pcmLax.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/common/CoreComponentTypesDk.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/common/CoreComponentParametersDk.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/common/0p70dk_Reusable.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/common/PIECOMredefines.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/reusabletypes.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/nonCardinalTypes.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/maindoc/Invoice.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/pie/PIECOMredefines.xsd
TOOLS NO http://rep.oio.dk/ubl/xml/schemas/0p71/pie/PIEredefines.xsd
13 rows selected.
So the schema is registered and it is global (LOCAL=NO).
But when I query ALL_XML_SCHEMAS instead of DBA_XML_SCHEMAS, then I get nothing??
Any ideas, anyone?
Regards
Kim Berg Hansen
Senior System Developer
T. Hansen Gruppen A/S