更新
XML Schema注册需要以下权限:
grant alter session to; grant create type to ; /* required when gentypes => true */ grant create table to ; /* required when gentables => true */
由于某些原因,如果通过角色间接授予这些权限是不够的,但需要直接向模式/用户授予权限.
原始答案
我也注意到参数的默认值gentables
并gentypes
引发insufficient privileges
异常.可能我只是缺乏使用这些功能的一些特权,但目前我还没有很好地理解他们做了什么.我很高兴禁用它们,验证似乎工作正常.
我正在使用Oracle Database 11g第11.2.0.1.0版
dbms_xmlschema.registerschema(schemaurl => name, schemadoc => xmltype(schema), local => true --gentypes => false, --gentables => false ); ORA-01031: insufficient privileges ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 55 ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 159 ORA-06512: at "JANI.XML_VALIDATOR", line 38 ORA-06512: at line 7
dbms_xmlschema.registerschema(schemaurl => name, schemadoc => xmltype(schema), local => true, gentypes => false --gentables => false ); ORA-31084: error while creating table "JANI"."example873_TAB" for element "example" ORA-01031: insufficient privileges ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 55 ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 159 ORA-06512: at "JANI.XML_VALIDATOR", line 38 ORA-06512: at line 7
dbms_xmlschema.registerschema(schemaurl => name, schemadoc => xmltype(schema), local => true, --gentypes => false gentables => false ); ORA-01031: insufficient privileges ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 55 ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 159 ORA-06512: at "JANI.XML_VALIDATOR", line 38 ORA-06512: at line 7
dbms_xmlschema.registerschema(schemaurl => name, schemadoc => xmltype(schema), local => true, gentypes => false, gentables => false ); PL/SQL procedure successfully completed.