ADF BC against XMLDB XMLType
XMLType object based storage provide updateXML(), InsertChildXML(), appendChildXML() deleteXML() methods.
Are these methods generated natively in ADF BC ?
Is it somewhere described how XML DB is implemented in ADF BC ?
Please see my reply in your similar thread in the XMLDB forum. Thanks.
XML DB vs Berkeley XML
Similar Messages
-
ADF Security against external source
HI. I want to manage my users and roles in the custom table in Oracle DB, but still use all security features of ADF. I mean I will not define user and roles in ADF, but ADF will be able to authenticate against my table and populate all security attributes (e.g #{securityContext.userName}) . Can it be done?
I think I found the problem not the solution.
First of all I do see in WL the user "test" and group "EnterpriseAdmin".
And of course "EnterpriseAdmin". assigned to "test" user.
But after I run the login page I go back to WL I see that "EnterpriseAdmin" group was unassigned from "test" user!!!!!
If I assign in again (after the application is loaded , but before I click the login button) I can use the application as I designed it (access the page which is protected by EnterpriseAdmin)
But at some point the following error message appears in the Jdeveloper console
[Another instance of application Sec3 is running on the server. JDeveloper will redeploy the application.]
[Running application Sec3 on Server Instance IntegratedWebLogicServer...]
[07:09:59 AM] Web Module ViewControllerWebApp.war recognized in project ViewController.jpr
[07:09:59 AM] ---- Deployment started. ----
[07:09:59 AM] Target platform is (Weblogic 10.3).
[07:09:59 AM] Retrieving existing application information
[07:09:59 AM] Running dependency analysis...
[07:09:59 AM] Deploying 2 profiles...
[07:10:00 AM] Wrote Web Application Module to C:\Users\mshapira04\AppData\Roaming\JDeveloper\system11.1.2.3.39.62.76.1\o.j2ee\drs\Sec3\ViewControllerWebApp.war
[07:10:00 AM] Wrote Enterprise Application Module to C:\Users\mshapira04\AppData\Roaming\JDeveloper\system11.1.2.3.39.62.76.1\o.j2ee\drs\Sec3
[07:10:00 AM] Redeploying Application...
<FeatureUtils> <_resolveFeatures> Ignoring feature-dependency on feature "AdfDvtCommon". No such feature exists.
<FeatureUtils> <_resolveFeatures> Ignoring feature-dependency on feature "AdfDvtCommon". No such feature exists.
<FeatureUtils> <_resolveFeatures> Ignoring feature-dependency on feature "DvtDiagram". No such feature exists.
[07:10:09 AM] Application Redeployed Successfully.
[07:10:09 AM] The following URL context root(s) were defined and can be used as a starting point to test your application:
[07:10:09 AM] http://10.15.8.180:7501/Sec3-ViewController-context-root
[07:10:09 AM] Uploading jazn-data roles.
[07:10:09 AM] Removing existing group "EnterpriseAdmin".
[07:10:09 AM] Creating group for role "EnterpriseAdmin".
[07:10:09 AM] Elapsed time for deployment: 10 seconds
[07:10:09 AM] ---- Deployment finished. ----
Run startup time: 9784 ms.
[Application Sec3 deployed to Server Instance IntegratedWebLogicServer]
Target URL -- http://127.0.0.1:7501/Sec3-ViewController-context-root/login.html
<Aug 28, 2013 7:10:16 AM EDT> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 127.0.0.1:65,365 during the configured idle timeout of 5 secs>
<Aug 28, 2013 7:10:16 AM EDT> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 127.0.0.1:65,362 during the configured idle timeout of 5 secs>
<Aug 28, 2013 7:10:16 AM EDT> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 127.0.0.1:65,361 during the configured idle timeout of 5 secs>
<Aug 28, 2013 7:10:16 AM EDT> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 127.0.0.1:65,366 during the configured idle timeout of 5 secs>
<Aug 28, 2013 7:10:16 AM EDT> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 127.0.0.1:65,363 during the configured idle timeout of 5 secs>
<Aug 28, 2013 7:10:16 AM EDT> <Warning> <Socket> <BEA-000449> <Closing socket as no data read from it on 127.0.0.1:65,364 during the configured idle timeout of 5 secs>
<Aug 28, 2013 7:11:09 AM EDT> <Error> <Console> <BEA-240003> <Console encountered the following error weblogic.security.providers.authentication.DBMSSQLAuthenticatorDelegateException: [Security:090279]Error listing users *
at weblogic.security.providers.authentication.DBMSSQLReadOnlyAuthenticatorDelegateImpl.listUsers(DBMSSQLReadOnlyAuthenticatorDelegateImpl.java:368)
at weblogic.security.providers.authentication.ReadOnlySQLAuthenticatorImpl.listUsers(ReadOnlySQLAuthenticatorImpl.java:117)
at weblogic.security.providers.authentication.SQLAuthenticatorMBeanImpl.listUsers(SQLAuthenticatorMBeanImpl.java:281)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.management.jmx.modelmbean.WLSModelMBean.invoke(WLSModelMBean.java:437)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$16.run(WLSMBeanServerInterceptorBase.java:449)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.invoke(WLSMBeanServerInterceptorBase.java:447)
at weblogic.management.mbeanservers.internal.JMXContextInterceptor.invoke(JMXContextInterceptor.java:263)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$16.run(WLSMBeanServerInterceptorBase.java:449)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase.invoke(WLSMBeanServerInterceptorBase.java:447)
at weblogic.management.mbeanservers.internal.SecurityInterceptor.invoke(SecurityInterceptor.java:444)
at weblogic.management.jmx.mbeanserver.WLSMBeanServer.invoke(WLSMBeanServer.java:323)
at weblogic.management.mbeanservers.internal.JMXConnectorSubjectForwarder$11$1.run(JMXConnectorSubjectForwarder.java:663)
at java.security.AccessController.doPrivileged(Native Method)
at weblogic.management.mbeanservers.internal.JMXConnectorSubjectForwarder$11.run(JMXConnectorSubjectForwarder.java:661)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.management.mbeanservers.internal.JMXConnectorSubjectForwarder.invoke(JMXConnectorSubjectForwarder.java:654)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1427)
at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1265)
at java.security.AccessController.doPrivileged(Native Method)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1367)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
at javax.management.remote.rmi.RMIConnectionImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:222)
at javax.management.remote.rmi.RMIConnectionImpl_1035_WLStub.invoke(Unknown Source)
at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.invoke(RMIConnector.java:993)
at weblogic.management.jmx.MBeanServerInvocationHandler.doInvoke(MBeanServerInvocationHandler.java:544)
at weblogic.management.jmx.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:380)
at $Proxy168.listUsers(Unknown Source)
at com.bea.console.utils.security.UserUtils.getUsers(UserUtils.java:78)
at com.bea.console.actions.security.users.UserTableAction.getCollection(UserTableAction.java:100)
at com.bea.console.actions.security.ManagementBaseTableAction.execute(ManagementBaseTableAction.java:82)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.access$201(PageFlowRequestProcessor.java:97)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor$ActionRunner.execute(PageFlowRequestProcessor.java:2044)
at org.apache.beehive.netui.pageflow.interceptor.action.internal.ActionInterceptors.wrapAction(ActionInterceptors.java:91)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionPerform(PageFlowRequestProcessor.java:2116)
at com.bea.console.internal.ConsolePageFlowRequestProcessor.processActionPerform(ConsolePageFlowRequestProcessor.java:261)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:556)
at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853)
at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631)
at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158)
at com.bea.console.internal.ConsoleActionServlet.process(ConsoleActionServlet.java:262)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at com.bea.console.internal.ConsoleActionServlet.doGet(ConsoleActionServlet.java:134)
at org.apache.beehive.netui.pageflow.PageFlowUtils.strutsLookup(PageFlowUtils.java:1199)
at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.executeAction(ScopedContentCommonSupport.java:686)
at com.bea.portlet.adapter.scopedcontent.ScopedContentCommonSupport.renderInternal(ScopedContentCommonSupport.java:266)
at com.bea.portlet.adapter.scopedcontent.StrutsStubImpl.render(StrutsStubImpl.java:107)
at com.bea.netuix.servlets.controls.content.NetuiContent.preRender(NetuiContent.java:292)
at com.bea.netuix.nf.ControlLifecycle$6.visit(ControlLifecycle.java:428)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:727)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walkRecursivePreRender(ControlTreeWalker.java:739)
at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:146)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:395)
at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:208)
at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:162)
at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:388)
at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:258)
at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:211)
at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:196)
at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:251)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at com.bea.console.utils.MBeanUtilsInitSingleFileServlet.service(MBeanUtilsInitSingleFileServlet.java:47)
at weblogic.servlet.AsyncInitServlet.service(AsyncInitServlet.java:130)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.sql.SQLException: TBDI18N: Connection was not found for null
at weblogic.security.providers.authentication.DBMSDatabaseConnectionPoolImpl.getRawConnection(DBMSDatabaseConnectionPoolImpl.java:136)
at weblogic.security.providers.authentication.DBMSSQLDatabaseConnectionPoolImpl.checkoutConnection(DBMSSQLDatabaseConnectionPoolImpl.java:25)
at weblogic.security.providers.authentication.DBMSSQLReadOnlyAuthenticatorDelegateImpl.getReadOnlyConnection(DBMSSQLReadOnlyAuthenticatorDelegateImpl.java:570)
at weblogic.security.providers.authentication.DBMSSQLReadOnlyAuthenticatorDelegateImpl.listUsers(DBMSSQLReadOnlyAuthenticatorDelegateImpl.java:346)
... 119 more
>
It says something about listing the users, so I checked my "SQL List Users:" statement and it should be just fine:
SELECT username FROM jhs_users WHERE username LIKE ?
If fact I double checked all SQL statement that list something in the provider and they are all fine
I have to remind that my application is empty and all pages (login , error , welcome) are autogenerated
Thank you for you help. Can you see the problem? -
ADF Security against database?
I am working with JDeveloper 10.1.3.4 on a project which uses adf/bc and adf faces/jsf 1.1; the application is deploying to iAS 10.1.3.4 and is hooked as a mid-tier instance via SSO to an infra iAS instance on another machine.
How do you change ADF Security to reference a database table to find out settings for page/iterator/attribute security settings?
Most of the existing code in this environment is Web Pl/sql toolkit and portal work. I am adding ADF apps. They would like to control what the different roles have access to via the database...hence this question.
Normally with ADF Security you use an editor in JDeveloper which you can access from within the page def file in the structure pane within JDeveloper; I think this changes system-jazn.xml. If you, instead, want these settings to be located within a database table, what do you have to do?
In my initial research I am thinking somehow I must create an override for ADFPermission.getContext() somehow...but I have not figured out if that is right or not yet.
It may just be easier to re-invent the wheel: just do things programmatically using Java; but there is a lot of structure inherant in ADF Security that I would be reproducing if I go that route, I think.
Anybody have any ideas?
I am continuing to research this issue, but I think this is an unusual use-case; so I am not expecting to find this answer anywhere in particular. Maybe somebody knows this off the top of their head.Right, Frank; I mostly meant that it would help me learn more about the subject of J2EE permissions. Vik has pointed me in the direction of the Sun Java Forums for more information on this topic, which I will hopefully get a chance to pursue.
Thank you for getting back to me. Thank you again, also, for all your work on custom login modules; I have used that work of yours several times professionally. It is just that this client I am working with now is satisfied with their SSO/LDAP setup...they just want to store permissions in the database also. -
XQUERY against an XMLTYPE variable
I have a procedure which gets xmltype instance and i have to use xquery upon that variable.
declare
myxml xmltype;
s varchar2(20);
begin
myxml:=xmltype('<person><name id="1" age="23"/><name id="2" age="25"/></person>');
SELECT
XMLQuery(
'for $i in /person
where $i/age > 24
return $i/id'
PASSING myxml RETURNING CONTENT) into s
FROM DUAL;
end;
BUT i get this error
ORA-06550: line 6, column 1:
PLS-00801: internal error [*** ASSERT at file pdw4.c, line 793; Cannot coerce
between type 43 and type 30; anon_68F441E0__AB[6, 1]]
Please help it is urgentNot sure if you ever received your answer regarding how to pass an XMLType variable in PLSQL to an XQuery command.
Here is an example of what I've been using... in Oracle 10.2.0.1
SET SERVEROUTPUT ON SIZE 200000
DECLARE
l_result XMLType;
l_xxDoc XMLType := XMLType(
<root>
<things>
<somestuff>12345</somestuff>
<morestuff>12345</morestuff>
</things>
<things>
<somestuff>dfgdfg</somestuff>
<morestuff>werwer</morestuff>
</things>
</root>
PROCEDURE printClobOut
(p_result IN CLOB)
IS
v_xmlstr VARCHAR2(32767);
v_line VARCHAR2(2000);
BEGIN
v_xmlstr := DBMS_LOB.SUBSTR(p_result,32767);
LOOP
EXIT WHEN v_xmlstr IS NULL;
v_line := SUBSTR(v_xmlstr,1,INSTR(v_xmlstr,CHR(10))-1);
DBMS_OUTPUT.PUT_LINE('| '||v_line);
v_xmlstr := SUBSTR(v_xmlstr,INSTR(v_xmlstr,CHR(10))+1);
END LOOP;
END;
BEGIN
select XMLQUERY(
'for $a in $TheDoc/root
return <theresult>
{$a/things}
</theresult>
PASSING l_xxDoc as "TheDoc"
RETURNING CONTENT) into l_result
from dual;
printClobOut(l_result.extract('/').getClobVal());
END;
Kevin -
Hello,
I am trying to reproduce the following XPath query using XDB functionality against a XMLType column:
//AtomicPart[@MyID='190' or @MyID='495' or @MyID='1662']
If I do the following I do get all AtomicParts:
select X.xml.extract('//AtomicPart') FROM TEST X
But I havent figured out how to do the or operation. Is it possible or does it require views?
Thank you,
RobertRobert
Need to see the instance document in order to answer this.. -
Insert XML file into Relational database model - no XMLTYPE!
Dear all,
How can I store a known complex XML file into an existing relational database WITHOUT using xmltypes in the database ?
I read the article on DBMS_XMLSTORE. DBMS_XMLSTORE indeed partially bridges the gap between XML and RDBMS to a certain extent, namely for simply structured XML (canonical structure) and simple tables.
However, when the XML structure will become arbitrary and rapidly evolving, surely there must be a way to map XML to a relational model more flexibly.
We work in a java/Oracle10 environment that receives very large XML documents from an independent data management source. These files comply with an XML schema. That is all we know. Still, all these data must be inserted/updated daily in an existing relational model. Quite an assignment isn't it ?
The database does and will not contain XMLTYPES, only plain RDBMS tables.
Are you aware of a framework/product or tool to do what DBMS_XMLSTORE does but with any format of XML file ? If not, I am doomed.
Cheers.
Luc.
Edited by: user6693852 on Jan 13, 2009 7:02 AMIn case you decide to follow my advice, here's a simple example showing how to do this.. (Note the XMLTable syntax is the preferred approach in 10gr2 and later..
SQL> spool testase.log
SQL> --
SQL> connect / as sysdba
Connected.
SQL> --
SQL> set define on
SQL> set timing on
SQL> --
SQL> define USERNAME = XDBTEST
SQL> --
SQL> def PASSWORD = XDBTEST
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> drop user &USERNAME cascade
2 /
old 1: drop user &USERNAME cascade
new 1: drop user XDBTEST cascade
User dropped.
Elapsed: 00:00:00.59
SQL> grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASS
ORD
2 /
old 1: grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &
ASSWORD
new 1: grant create any directory, drop any directory, connect, resource, alter session, create view to XDBTEST identified by XDB
EST
Grant succeeded.
Elapsed: 00:00:00.01
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
2 /
old 1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
new 1: alter user XDBTEST default tablespace USERS temporary tablespace TEMP
User altered.
Elapsed: 00:00:00.00
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> var SCHEMAURL varchar2(256)
SQL> var XMLSCHEMA CLOB
SQL> --
SQL> set define off
SQL> --
SQL> begin
2 :SCHEMAURL := 'http://xmlns.example.com/askTom/TransactionList.xsd';
3 :XMLSCHEMA :=
4 '<?xml version="1.0" encoding="UTF-8"?>
5 <!--W3C Schema generated by XMLSpy v2008 rel. 2 sp2 (http://www.altova.com)-->
6 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" xdb:storeVarrayAsTable="true">
7 <xs:element name="TransactionList" type="transactionListType" xdb:defaultTable="LOCAL_TABLE"/>
8 <xs:complexType name="transactionListType" xdb:maintainDOM="false" xdb:SQLType="TRANSACTION_LIST_T">
9 <xs:sequence>
10 <xs:element name="Transaction" type="transactionType" maxOccurs="unbounded" xdb:SQLCollType="TRANSACTION_V"
>
11 </xs:sequence>
12 </xs:complexType>
13 <xs:complexType name="transactionType" xdb:maintainDOM="false" xdb:SQLType="TRANSACTION_T">
14 <xs:sequence>
15 <xs:element name="TradeVersion" type="xs:integer"/>
16 <xs:element name="TransactionId" type="xs:integer"/>
17 <xs:element name="Leg" type="legType" maxOccurs="unbounded" xdb:SQLCollType="LEG_V"/>
18 </xs:sequence>
19 <xs:attribute name="id" type="xs:integer" use="required"/>
20 </xs:complexType>
21 <xs:complexType name="paymentType" xdb:maintainDOM="false" xdb:SQLType="PAYMENT_T">
22 <xs:sequence>
23 <xs:element name="StartDate" type="xs:date"/>
24 <xs:element name="Value" type="xs:integer"/>
25 </xs:sequence>
26 <xs:attribute name="id" type="xs:integer" use="required"/>
27 </xs:complexType>
28 <xs:complexType name="legType" xdb:maintainDOM="false" xdb:SQLType="LEG_T">
29 <xs:sequence>
30 <xs:element name="LegNumber" type="xs:integer"/>
31 <xs:element name="Basis" type="xs:integer"/>
32 <xs:element name="FixedRate" type="xs:integer"/>
33 <xs:element name="Payment" type="paymentType" maxOccurs="unbounded" xdb:SQLCollType="PAYMENT_V"/>
34 </xs:sequence>
35 <xs:attribute name="id" type="xs:integer" use="required"/>
36 </xs:complexType>
37 </xs:schema>';
38 end;
39 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> set define on
SQL> --
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(:XMLSCHEMA);
4 begin
5 dbms_xmlschema.registerSchema
6 (
7 schemaurl => :schemaURL,
8 schemadoc => xmlSchema,
9 local => TRUE,
10 genTypes => TRUE,
11 genBean => FALSE,
12 genTables => TRUE,
13 ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
14 );
15 end;
16 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.26
SQL> desc LOCAL_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.example.com/askTom/TransactionList.xsd" Element "TransactionList") STORAGE Object-rela
ional TYPE "TRANSACTION_LIST_T"
SQL> --
SQL> create or replace VIEW TRAN_VIEW
2 as
3 select
4 extractvalue(x.column_value,'/Transaction/TradeVersion/text()') tradeversion,
5 extractvalue(x.column_value,'/Transaction//text()') transactionid
6 from
7 local_table,
8 table(xmlsequence(extract(OBJECT_VALUE,'/TransactionList/Transaction'))) x
9 /
View created.
Elapsed: 00:00:00.01
SQL> create or replace VIEW TRAN_LEG_VIEW
2 as
3 select
4 extractvalue(x.column_value,'/Transaction/TransactionId/text()') transactionid,
5 extractvalue(y.column_value,'/Leg/Basis/text()') leg_basis,
6 extractValue(y.column_value,'/Leg/FixedRate/text()') leg_fixedrate
7 from
8 local_table,
9 table(xmlsequence(extract(OBJECT_VALUE,'/TransactionList/Transaction'))) x,
10 table(xmlsequence(extract(x.column_value,'/Transaction/Leg'))) y
11 /
View created.
Elapsed: 00:00:00.01
SQL> create or replace VIEW TRAN_LEG_PAY_VIEW
2 as
3 select
4 extractvalue(x.column_value,'/Transaction/TransactionId/text()') transactionid,
5 extractvalue(y.column_value,'/Leg/LegNumber/text()') leg_legnumber,
6 extractvalue(z.column_value,'/Payment/StartDate/text()') pay_startdate,
7 extractValue(z.column_value,'/Payment/Value/text()') pay_value
8 from
9 local_table,
10 table(xmlsequence(extract(OBJECT_VALUE,'/TransactionList/Transaction'))) x,
11 table(xmlsequence(extract(x.column_value,'/Transaction/Leg'))) y,
12 table(xmlsequence(extract(y.column_value,'/Leg/Payment'))) z
13 /
View created.
Elapsed: 00:00:00.03
SQL> desc TRAN_VIEW
Name Null? Type
TRADEVERSION NUMBER(38)
TRANSACTIONID VARCHAR2(4000)
SQL> --
SQL> desc TRAN_LEG_VIEW
Name Null? Type
TRANSACTIONID NUMBER(38)
LEG_BASIS NUMBER(38)
LEG_FIXEDRATE NUMBER(38)
SQL> --
SQL> desc TRAN_LEG_PAY_VIEW
Name Null? Type
TRANSACTIONID NUMBER(38)
LEG_LEGNUMBER NUMBER(38)
PAY_STARTDATE DATE
PAY_VALUE NUMBER(38)
SQL> --
SQL> create or replace VIEW TRAN_VIEW_XMLTABLE
2 as
3 select t.*
4 from LOCAL_TABLE,
5 XMLTable
6 (
7 '/TransactionList/Transaction'
8 passing OBJECT_VALUE
9 columns
10 TRADE_VERSION NUMBER(4) path 'TradeVersion/text()',
11 TRANSACTION_ID NUMBER(4) path 'TransactionId/text()'
12 ) t
13 /
View created.
Elapsed: 00:00:00.01
SQL> create or replace VIEW TRAN_LEG_VIEW_XMLTABLE
2 as
3 select t.TRANSACTION_ID, L.*
4 from LOCAL_TABLE,
5 XMLTable
6 (
7 '/TransactionList/Transaction'
8 passing OBJECT_VALUE
9 columns
10 TRANSACTION_ID NUMBER(4) path 'TransactionId/text()',
11 LEG XMLType path 'Leg'
12 ) t,
13 XMLTABLE
14 (
15 '/Leg'
16 passing LEG
17 columns
18 LEG_NUMBER NUMBER(4) path 'LegNumber/text()',
19 LEG_BASIS NUMBER(4) path 'Basis/text()',
20 LEG_FIXED_RATE NUMBER(4) path 'FixedRate/text()'
21 ) l
22 /
View created.
Elapsed: 00:00:00.01
SQL> create or replace VIEW TRAN_LEG_PAY_VIEW_XMLTABLE
2 as
3 select TRANSACTION_ID, L.LEG_NUMBER, P.*
4 from LOCAL_TABLE,
5 XMLTable
6 (
7 '/TransactionList/Transaction'
8 passing OBJECT_VALUE
9 columns
10 TRANSACTION_ID NUMBER(4) path 'TransactionId/text()',
11 LEG XMLType path 'Leg'
12 ) t,
13 XMLTABLE
14 (
15 '/Leg'
16 passing LEG
17 columns
18 LEG_NUMBER NUMBER(4) path 'LegNumber/text()',
19 PAYMENT XMLType path 'Payment'
20 ) L,
21 XMLTABLE
22 (
23 '/Payment'
24 passing PAYMENT
25 columns
26 PAY_START_DATE DATE path 'StartDate/text()',
27 PAY_VALUE NUMBER(4) path 'Value/text()'
28 ) p
29 /
View created.
Elapsed: 00:00:00.03
SQL> desc TRAN_VIEW_XMLTABLE
Name Null? Type
TRADE_VERSION NUMBER(4)
TRANSACTION_ID NUMBER(4)
SQL> --
SQL> desc TRAN_LEG_VIEW_XMLTABLE
Name Null? Type
TRANSACTION_ID NUMBER(4)
LEG_NUMBER NUMBER(4)
LEG_BASIS NUMBER(4)
LEG_FIXED_RATE NUMBER(4)
SQL> --
SQL> desc TRAN_LEG_PAY_VIEW_XMLTABLE
Name Null? Type
TRANSACTION_ID NUMBER(4)
LEG_NUMBER NUMBER(4)
PAY_START_DATE DATE
PAY_VALUE NUMBER(4)
SQL> --
SQL> set long 10000 pages 100 lines 128
SQL> set timing on
SQL> set autotrace on explain
SQL> set heading on feedback on
SQL> --
SQL> VAR DOC1 CLOB
SQL> VAR DOC2 CLOB
SQL> --
SQL> begin
2 :DOC1 :=
3 '<TransactionList>
4 <Transaction id="1">
5 <TradeVersion>1</TradeVersion>
6 <TransactionId>1</TransactionId>
7 <Leg id="1">
8 <LegNumber>1</LegNumber>
9 <Basis>1</Basis>
10 <FixedRate>1</FixedRate>
11 <Payment id="1">
12 <StartDate>2000-01-01</StartDate>
13 <Value>1</Value>
14 </Payment>
15 <Payment id="2">
16 <StartDate>2000-01-02</StartDate>
17 <Value>2</Value>
18 </Payment>
19 </Leg>
20 <Leg id="2">
21 <LegNumber>2</LegNumber>
22 <Basis>2</Basis>
23 <FixedRate>2</FixedRate>
24 <Payment id="1">
25 <StartDate>2000-02-01</StartDate>
26 <Value>10</Value>
27 </Payment>
28 <Payment id="2">
29 <StartDate>2000-02-02</StartDate>
30 <Value>20</Value>
31 </Payment>
32 </Leg>
33 </Transaction>
34 <Transaction id="2">
35 <TradeVersion>2</TradeVersion>
36 <TransactionId>2</TransactionId>
37 <Leg id="1">
38 <LegNumber>21</LegNumber>
39 <Basis>21</Basis>
40 <FixedRate>21</FixedRate>
41 <Payment id="1">
42 <StartDate>2002-01-01</StartDate>
43 <Value>21</Value>
44 </Payment>
45 <Payment id="2">
46 <StartDate>2002-01-02</StartDate>
47 <Value>22</Value>
48 </Payment>
49 </Leg>
50 <Leg id="22">
51 <LegNumber>22</LegNumber>
52 <Basis>22</Basis>
53 <FixedRate>22</FixedRate>
54 <Payment id="21">
55 <StartDate>2002-02-01</StartDate>
56 <Value>210</Value>
57 </Payment>
58 <Payment id="22">
59 <StartDate>2002-02-02</StartDate>
60 <Value>220</Value>
61 </Payment>
62 </Leg>
63 </Transaction>
64 </TransactionList>';
65 :DOC2 :=
66 '<TransactionList>
67 <Transaction id="31">
68 <TradeVersion>31</TradeVersion>
69 <TransactionId>31</TransactionId>
70 <Leg id="31">
71 <LegNumber>31</LegNumber>
72 <Basis>31</Basis>
73 <FixedRate>31</FixedRate>
74 <Payment id="31">
75 <StartDate>3000-01-01</StartDate>
76 <Value>31</Value>
77 </Payment>
78 </Leg>
79 </Transaction>
80 </TransactionList>';
81 end;
82 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01
SQL> insert into LOCAL_TABLE values ( xmltype(:DOC1))
2 /
1 row created.
Elapsed: 00:00:00.01
Execution Plan
Plan hash value: 1
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
| 1 | LOAD TABLE CONVENTIONAL | LOCAL_TABLE | | | | |
SQL> insert into LOCAL_TABLE values ( xmltype(:DOC2))
2 /
1 row created.
Elapsed: 00:00:00.01
Execution Plan
Plan hash value: 1
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | INSERT STATEMENT | | 1 | 100 | 1 (0)| 00:00:01 |
| 1 | LOAD TABLE CONVENTIONAL | LOCAL_TABLE | | | | |
SQL> select * from TRAN_VIEW_XMLTABLE
2 /
TRADE_VERSION TRANSACTION_ID
1 1
2 2
31 31
3 rows selected.
Elapsed: 00:00:00.03
Execution Plan
Plan hash value: 650975545
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 168 | 3 (0)| 00:00:01 |
| 1 | NESTED LOOPS | | 3 | 168 | 3 (0)| 00:00:01 |
|* 2 | TABLE ACCESS FULL| SYS_NTGgl+TKyhQnWoFRSrCxeX9g== | 3 | 138 | 3 (0)| 00:00:01 |
|* 3 | INDEX UNIQUE SCAN| SYS_C0010174 | 1 | 10 | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter("SYS_NC_TYPEID$" IS NOT NULL)
3 - access("NESTED_TABLE_ID"="LOCAL_TABLE"."SYS_NC0000800009$")
Note
- dynamic sampling used for this statement
SQL> select * from TRAN_LEG_VIEW_XMLTABLE
2 /
TRANSACTION_ID LEG_NUMBER LEG_BASIS LEG_FIXED_RATE
1 1 1 1
1 2 2 2
2 21 21 21
2 22 22 22
31 31 31 31
5 rows selected.
Elapsed: 00:00:00.04
Execution Plan
Plan hash value: 1273661583
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 5 | 560 | 7 (15)| 00:00:01 |
|* 1 | HASH JOIN | | 5 | 560 | 7 (15)| 00:00:01 |
| 2 | NESTED LOOPS | | 3 | 159 | 3 (0)| 00:00:01 |
|* 3 | TABLE ACCESS FULL| SYS_NTGgl+TKyhQnWoFRSrCxeX9g== | 3 | 129 | 3 (0)| 00:00:01 |
|* 4 | INDEX UNIQUE SCAN| SYS_C0010174 | 1 | 10 | 0 (0)| 00:00:01 |
|* 5 | TABLE ACCESS FULL | SYS_NTUmyermF/S721C/2UXo40Uw== | 5 | 295 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - access("SYS_ALIAS_1"."NESTED_TABLE_ID"="SYS_ALIAS_0"."SYS_NC0000800009$")
3 - filter("SYS_NC_TYPEID$" IS NOT NULL)
4 - access("NESTED_TABLE_ID"="LOCAL_TABLE"."SYS_NC0000800009$")
5 - filter("SYS_NC_TYPEID$" IS NOT NULL)
Note
- dynamic sampling used for this statement
SQL> select * from TRAN_LEG_PAY_VIEW_XMLTABLE
2 /
TRANSACTION_ID LEG_NUMBER PAY_START PAY_VALUE
1 1 01-JAN-00 1
1 1 02-JAN-00 2
1 2 01-FEB-00 10
1 2 02-FEB-00 20
2 21 01-JAN-02 21
2 21 02-JAN-02 22
2 22 01-FEB-02 210
2 22 02-FEB-02 220
31 31 01-JAN-00 31
9 rows selected.
Elapsed: 00:00:00.07
Execution Plan
Plan hash value: 4004907785
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 9 | 1242 | 10 (10)| 00:00:01 |
|* 1 | HASH JOIN | | 9 | 1242 | 10 (10)| 00:00:01 |
|* 2 | HASH JOIN | | 5 | 480 | 7 (15)| 00:00:01 |
| 3 | NESTED LOOPS | | 3 | 159 | 3 (0)| 00:00:01 |
|* 4 | TABLE ACCESS FULL| SYS_NTGgl+TKyhQnWoFRSrCxeX9g== | 3 | 129 | 3 (0)| 00:00:01 |
|* 5 | INDEX UNIQUE SCAN| SYS_C0010174 | 1 | 10 | 0 (0)| 00:00:01 |
|* 6 | TABLE ACCESS FULL | SYS_NTUmyermF/S721C/2UXo40Uw== | 5 | 215 | 3 (0)| 00:00:01 |
|* 7 | TABLE ACCESS FULL | SYS_NTelW4ZRtKS+WKqCaXhsHnNQ== | 9 | 378 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - access("NESTED_TABLE_ID"="SYS_ALIAS_1"."SYS_NC0000900010$")
2 - access("SYS_ALIAS_1"."NESTED_TABLE_ID"="SYS_ALIAS_0"."SYS_NC0000800009$")
4 - filter("SYS_NC_TYPEID$" IS NOT NULL)
5 - access("NESTED_TABLE_ID"="LOCAL_TABLE"."SYS_NC0000800009$")
6 - filter("SYS_NC_TYPEID$" IS NOT NULL)
7 - filter("SYS_NC_TYPEID$" IS NOT NULL)
Note
- dynamic sampling used for this statement
SQL>Out of interest why are you so against using XMLType...
Edited by: mdrake on Jan 13, 2009 8:25 AM -
Hello,
I want to authenticate users of my adf application against OID.
But it doesn't work.
The users wich are created in the default authenticator of the weblogic server can be authenticated an everything works fine.
The users wich came from the OID cannot be authenticated!?!?
I can see all users and theirs roles from OID in the weblogic server.
I set the control flag of both, the default authenticator and my authenticator (OID) to sufficient.
Has anyone an idea?Hi,
works for me, so its definitively not a bug. Check this: http://oracle.com/technology/products/jdev/tips/fnimphius/oidconfig/index.html
Frank -
ADF pages autentication with OID
How to authenticate ADF application against Oracle Internet DIrectory. We are using Oracle Application Server 10.1.2.0.2 and JDeveloper 10.1.2. Basically in a simple scenario, we will have a login page where the user will enter username and password. It needs to authenticate against Oracle Internet Directory and if successful, it needs to forward to the next ADF page.
Thankshi bala
Maybe you can use the example code in CustomAuthorizationInUIStuff-v0.02.zip that I have recently posted in Re: ADF Faces: on page refresh, property is null. Why?, to work with together with the documentation.
It has been created using JDeveloper 10.1.3.3.0, so I'm not sure how it translates back to JDeveloper 10.1.2 you refer to.
success
Jan Vervecken -
Why Doesn't XMLIndex Create and Populate Upon Scale-Up For Eval Table?
Presently working with Oracle release 11.2.0.1 using xmltype securefile binary xml tables.
In a quandry here and hoping not to have to open an Oracle SR...
Able to create a working xmlindex against an 'Acme Eval' table in our development environment against an Acme eval table (estimate ~ 5GB) containing 325,550 rows. Creation takes about 10 mins. No partitioning is being used.
When trying the exact same xmlindex creation against our, much more powerful, pvs platform environment contaning 13,985,124 rows; the xmlindex object shows up as existing in the data dictionary, but the session never stops running after at least 24 hrs of runtime.
The pvs hardware environment uses: (1.) 24 processor, (2.) Solaris-64 OS, (3.) 128GB memory.
Two 1 hr AWR reports for the pvs environment shows a huge amount of logical read/writes. The foreground wait event; 'db file sequential read' dominates the DBTime @ 92%. There is about 4.6 GB physical reads/3.5GB physical writes - not too large relatively speaking. The I/O subsystem is having no problem handling the throughput. The top, by far,Time Model Statistics is the 'sql excute elapsed time' @ 99%. User I/O is the main foreground wait class @92%. These values are similar for both of the AWR report - except one report show the 'CREATE XMLINDEX...' statement as being the top sql. The other report shows ' INSERT INTO CROUTREACH.EVAL_IDX_TAB_I... ' As the top sql.
Been several days since this post. Hoping someone might be able to provide some insight or share their experiences on xmlindexes scaling up to millions of records in the 5 - 10 gb xmltype table range...
Regards,
Rick Blanchard
The frustration here is; there is no obvious database configuration, physical cpu, memory, or I/O issue - other than the logical gets centered around the db file sequential read' wait event.
Can't do much as far as adjusting the create index statement and underlying attendent Oracle xml operations - the main frustration factor here...
The xmlindex is still undergoing record insertions.
Additionally, in the pvs environment; no dml is allowed on the xmlindex and the select statement that works fine using the xmlindex via the optimizer in the development environment doesnt pick up the xmlindex in the pvs environment - as would be expected if the xmlindex wasn't completely populated.
Appears the xmlindex record population is stalled...
In the pvs environment, when performing the dml 'alter index croutreach.eval_xmlindex_ix noparallel';
get this error - typical when an xmlindex is being populated with records:
ALTER INDEX croutreach.eval_xmlindex_ix NOPARALLEL
Error report:
SQL Error: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
00054. 00000 - "resource busy and acquire with NOWAIT specified"
*Cause: Resource interested is busy.
*Action: Retry if necessary. xmlindex create statement used in both cases is
(The underlying eval table is also set to a dop of 20):
CREATE
INDEX "EVAL_XMLINDEX_IX" ON "EVAL"
OBJECT_VALUE
INDEXTYPE IS "XDB"."XMLINDEX" PARAMETERS
'XMLTable eval_idx_tab_I XMLNamespaces(''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7",
DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03''),''/eval''
COLUMNS
eval_catt VARCHAR2(50) path ''@category'',
acne_mbr_idd VARCHAR2(50) path ''@acmeMemberId'',
eval_idd VARCHAR2(50) path ''@evalId'',
eval_dtt TIMESTAMP WITH TIME ZONE path ''@eval_dt'',
derivedFact XMLTYPE path ''derivedFacts/ns7:derivedFact'' virtual
XMLTable eval_idx_tab_II XMLNamespaces(''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7",
DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03''),''/ns7:derivedFact'' passing derivedFact
COLUMNS
defId VARCHAR2(50) path ''ns7:defId'',
factSource VARCHAR2(50) path ''ns7:factSource'',
origInferred_dt TIMESTAMP WITH TIME ZONE path ''ns7:origInferred_dt'',
typee VARCHAR2(20) path ''ns7:factValue/ns7:type'',
valuee VARCHAR2(1000) path ''ns7:factValue/ns7:value'',
defUrn VARCHAR2(100) path ''ns7:defUrn'''
)parallel 20;The development environment eval table is:
CREATE
TABLE "N98991"."EVAL" OF XMLTYPE
CONSTRAINT "EVAL_ID_PK" PRIMARY KEY ("EVAL_ID") USING INDEX PCTFREE 10
INITRANS 4 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT
1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1
FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT) TABLESPACE "ACME_DATA" ENABLE
XMLTYPE STORE AS SECUREFILE BINARY XML
TABLESPACE "ACME_DATA" ENABLE STORAGE IN ROW CHUNK 8192 CACHE NOCOMPRESS
KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT)
ALLOW NONSCHEMA ALLOW ANYSCHEMA VIRTUAL COLUMNS
"EVAL_DT" AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03"; (::)
/eval/@eval_dt'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
WITH
TIME ZONE))),
"EVAL_CAT" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@category'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
"ACME_MBR_ID" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@acmeMemberId'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
"EVAL_ID" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@evalId'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50)))
PCTFREE 0 PCTUSED 80 INITRANS 4 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" PARALLEL 20 ;
CREATE
INDEX "N98991"."EVAL_XMLINDEX_IX" ON "N98991"."EVAL"
OBJECT_VALUE
INDEXTYPE IS "XDB"."XMLINDEX" PARAMETERS
'XMLTable eval_idx_tab_I XMLNamespaces(''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7",
DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03''),''/eval''
COLUMNS
eval_catt VARCHAR2(50) path ''@category'',
acne_mbr_idd VARCHAR2(50) path ''@acmeMemberId'',
eval_idd VARCHAR2(50) path ''@evalId'',
eval_dtt TIMESTAMP WITH TIME ZONE path ''@eval_dt'',
derivedFact XMLTYPE path ''derivedFacts/ns7:derivedFact'' virtual
XMLTable eval_idx_tab_II XMLNamespaces(''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7",
DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03''),''/ns7:derivedFact'' passing derivedFact
COLUMNS
defId VARCHAR2(50) path ''ns7:defId'',
factSource VARCHAR2(50) path ''ns7:factSource'',
origInferred_dt TIMESTAMP WITH TIME ZONE path ''ns7:origInferred_dt'',
typee VARCHAR2(20) path ''ns7:factValue/ns7:type'',
valuee VARCHAR2(1000) path ''ns7:factValue/ns7:value'',
defUrn VARCHAR2(100) path ''ns7:defUrn'''
CREATE UNIQUE INDEX "N98991"."SYS_C00415365" ON "N98991"."EVAL"
"SYS_NC_OID$"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE UNIQUE INDEX "N98991"."SYS_IL0000688125C00003$$" ON "N98991"."EVAL"
PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 NEXT 1048576
MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST
GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "ACME_DATA" PARALLEL (DEGREE 0 INSTANCES 0) ;
CREATE UNIQUE INDEX "N98991"."EVAL_ID_PK" ON "N98991"."EVAL" ("EVAL_ID")
PCTFREE 10 INITRANS 4 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536
NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1
FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT) TABLESPACE "ACME_DATA" ;The pvs environment's eval table and xmlindex defintion is:
CREATE
TABLE "CROUTREACH"."EVAL" OF XMLTYPE
CONSTRAINT "EVAL_ID_PK" PRIMARY KEY ("EVAL_ID") USING INDEX PCTFREE 10
INITRANS 4 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT
1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1
FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT) TABLESPACE "ACME_DATA" ENABLE
XMLTYPE STORE AS SECUREFILE BINARY XML
TABLESPACE "ACME_DATA" ENABLE STORAGE IN ROW CHUNK 8192 CACHE NOCOMPRESS
KEEP_DUPLICATES STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT)
ALLOW NONSCHEMA ALLOW ANYSCHEMA VIRTUAL COLUMNS
"EVAL_DT" AS (SYS_EXTRACT_UTC(CAST(TO_TIMESTAMP_TZ(SYS_XQ_UPKXML2SQL(
SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03"; (::)
/eval/@eval_dt'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2),'SYYYY-MM-DD"T"HH24:MI:SS.FFTZH:TZM') AS TIMESTAMP
WITH
TIME ZONE))),
"EVAL_CAT" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@category'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
"ACME_MBR_ID" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@acmeMemberId'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50))),
"EVAL_ID" AS (CAST(SYS_XQ_UPKXML2SQL(SYS_XQEXVAL(XMLQUERY(
'declare default element namespace "http://www.cigna.com/acme/domains/eval/2010/03";/eval/@evalId'
PASSING BY VALUE SYS_MAKEXML(128,"XMLDATA") RETURNING CONTENT ),0,0,
16777216,0),50,1,2) AS VARCHAR2(50)))
PCTFREE 0 PCTUSED 80 INITRANS 4 MAXTRANS 255 NOCOMPRESS LOGGING STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" PARALLEL 20 ;
CREATE
INDEX "CROUTREACH"."EVAL_IDX_MBR_ID_EVAL_CAT" ON "CROUTREACH"."EVAL"
"ACME_MBR_ID",
"EVAL_CAT"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" PARALLEL 16 ;
CREATE UNIQUE INDEX "CROUTREACH"."SYS_C0018448" ON "CROUTREACH"."EVAL"
"SYS_NC_OID$"
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE
INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0
FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT
CELL_FLASH_CACHE DEFAULT
TABLESPACE "ACME_DATA" ;
CREATE UNIQUE INDEX "CROUTREACH"."SYS_IL0000094844C00003$$" ON "CROUTREACH".
"EVAL"
PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING STORAGE(INITIAL 65536 NEXT
1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1
FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT) TABLESPACE "ACME_DATA" PARALLEL (DEGREE 0 INSTANCES 0) ;
CREATE UNIQUE INDEX "CROUTREACH"."EVAL_ID_PK" ON "CROUTREACH"."EVAL" ("EVAL_ID"
) PCTFREE 10 INITRANS 4 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536
NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1
FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT) TABLESPACE "ACME_DATA" PARALLEL 16 ;
CREATE
INDEX "CROUTREACH"."EVAL_XMLINDEX_IX" ON "CROUTREACH"."EVAL"
OBJECT_VALUE
INDEXTYPE IS "XDB"."XMLINDEX" PARAMETERS
'XMLTable eval_idx_tab_I XMLNamespaces(''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7",
DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03''),''/eval''
COLUMNS
eval_catt VARCHAR2(50) path ''@category'',
acne_mbr_idd VARCHAR2(50) path ''@acmeMemberId'',
eval_idd VARCHAR2(50) path ''@evalId'',
eval_dtt TIMESTAMP WITH TIME ZONE path ''@eval_dt'',
derivedFact XMLTYPE path ''derivedFacts/ns7:derivedFact'' virtual
XMLTable eval_idx_tab_II XMLNamespaces(''http://www.cigna.com/acme/domains/derived/fact/2010/03'' AS "ns7",
DEFAULT ''http://www.cigna.com/acme/domains/eval/2010/03''),''/ns7:derivedFact'' passing derivedFact
COLUMNS
defId VARCHAR2(50) path ''ns7:defId'',
factSource VARCHAR2(50) path ''ns7:factSource'',
origInferred_dt TIMESTAMP WITH TIME ZONE path ''ns7:origInferred_dt'',
typee VARCHAR2(20) path ''ns7:factValue/ns7:type'',
valuee VARCHAR2(1000) path ''ns7:factValue/ns7:value'',
defUrn VARCHAR2(100) path ''ns7:defUrn'''
PARALLEL 20 ;Wondering if anyone has run into xmlindex creation and populating problems similar to this, when scaling up from thousands of records to millions of records.
At this point, for my work to be useful; must be able to get the xmlindex to at least successfully create and populate @ the 13.9 million records.
Any suggestions, much appreciated.
Regards,
Rick Blanchard
Edited by: RickBlanchardSRS on May 29, 2012 1:03 PMWe didn't use "XMLDB XMLType partitioning" actually, but something simple like
CREATE TABLE P_DATA
( "ID" NUMBER(15,0),
"DOC" "SYS"."XMLTYPE"
) SEGMENT CREATION IMMEDIATE
NOCOMPRESS NOLOGGING
TABLESPACE "XML_DATA"
XMLTYPE COLUMN "DOC" STORE AS SECUREFILE BINARY XML
(TABLESPACE "XML_DATA"
NOCOMPRESS KEEP_DUPLICATES)
XMLSCHEMA "http://www.xxxxx.com/schema_v3.0.xsd"
ELEMENT "RECORD"
DISALLOW NONSCHEMA
PARTITION BY RANGE(ID)
(PARTITION Q_DATA_PART_01 VALUES LESS THAN (100000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_02 VALUES LESS THAN (200000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_03 VALUES LESS THAN (300000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_04 VALUES LESS THAN (400000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_05 VALUES LESS THAN (500000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_06 VALUES LESS THAN (600000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_07 VALUES LESS THAN (700000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_08 VALUES LESS THAN (800000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_09 VALUES LESS THAN (900000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_10 VALUES LESS THAN (1000000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_11 VALUES LESS THAN (1100000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_12 VALUES LESS THAN (1200000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_13 VALUES LESS THAN (1300000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_14 VALUES LESS THAN (1400000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_15 VALUES LESS THAN (1500000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_16 VALUES LESS THAN (1600000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_17 VALUES LESS THAN (1700000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_18 VALUES LESS THAN (1800000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_19 VALUES LESS THAN (1900000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_20 VALUES LESS THAN (2000000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_21 VALUES LESS THAN (2100000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_22 VALUES LESS THAN (2200000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_23 VALUES LESS THAN (2300000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_24 VALUES LESS THAN (2400000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_25 VALUES LESS THAN (2500000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_26 VALUES LESS THAN (2600000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_27 VALUES LESS THAN (2700000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_28 VALUES LESS THAN (2800000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_29 VALUES LESS THAN (2900000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_30 VALUES LESS THAN (3000000000) TABLESPACE "XML_DATA" NOCOMPRESS
,PARTITION Q_DATA_PART_MAX VALUES LESS THAN (MAXVALUE) TABLESPACE "XML_DATA" NOCOMPRESS
);Could be mistaken, but if I remember correctly we ended up with 10mill record id ranges. We needed to do this anyway (=using partitioning), otherwise we would have reached the maximum amount of records in a column physical limit (for our used db_block_size)
Edited by: Marco Gralike on May 29, 2012 10:02 PM -
CreateSchemaBasedXML using multiple schemas
I am trying to perform XSD validation against an XML document within PLSQL and I'm having an issue with getting it working.
I have created an XMLTYPE object, which when I call isSchemaBased() against it returns 0 (false). Now obviously the XMLTYPE needs to be schema based in order to be validated, I found that you can make a schema based version by calling createSchemaBasedXML against the XMLTYPE. The problem I am having is that my schema is broken into two parts (combining the schema files is not an option unfortunately), which means that when I try and createSchemaBasedXML specifying the main schema it fails because it is unable to resolve a reference which is imported from the second XSD document.
-- lxml is the XMLTYPE which has been populated with the XML before this point
dbms_xmlschema.registerSchema(
schemaURL => mainSchemaURL,
schemaDoc => mainSchemaDoc,
local => true,
genTypes => true,
genTables => false,
force => true,
enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE);
dbms_xmlschema.registerSchema(
schemaURL => importedSchemaURL,
schemaDoc => importedSchemaDoc,
local => true,
genTypes => true,
genTables => false,
force => true,
enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE);
if lxml.isSchemaBased() = 1 then
dbms_output.put_line('Schema based');
else
dbms_output.put_line('Non-schema based');
end if;
dbms_ouput.put_line('About to apply schema');
lxml := lxml.createSchemaBasedXML(mainSchemaURL);
dbms_ouput.put_line('We don't get this far');
lxml := lxml.createSchemaBasedXML(importedSchemaURL);
Is there any way of being able to import both the mainSchemaURL and the importedSchemaURL at the same time so that the imported schema references within the main schema don't cause the failure;
ORA-31079: unable to result reference to type [type containing imported type]
Any help or pointers would be greatly appreciated.the code now gets to where it is trying to register the mainSchema but fails with an exception "invalid XML document" (which is untrue as the XSD is valid).
This was probably not the complete error message.
When I run your example I get :
ORA-31154: invalid XML document
ORA-19202: Error occurred in XML processing
LSX-00023: unknown namespace URI "App1/ImportedNamespace"
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 3
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 14
ORA-06512: at line 4
Oracle is not able to resolve the definition of the imported type.
I know the specs don't make it mandatory but we also need to specify the schemaLocation in the import directive :
<xs:import namespace="App1/ImportedNamespace" schemaLocation="importedSchemaURL.xsd"/>
Complete test case :
-- Register the imported schema
begin
dbms_xmlschema.registerSchema(
schemaURL => 'importedSchemaURL.xsd',
schemaDoc => '<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="App1_ImportedNamespace_v0_1_1"
targetNamespace="App1/ImportedNamespace"
xmlns="App1/ImportedNamespace"
elementFormDefault="qualified"
version="0.1.1"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="ImportedType">
<xs:restriction base="xs:string">
<xs:minLength value="2" />
</xs:restriction>
</xs:simpleType>
</xs:schema>',
local => true,
genTypes => false,
genTables => false,
enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE
end;
-- Register the main schema
begin
dbms_xmlschema.registerSchema(
schemaURL => 'mainSchemaURL.xsd',
schemaDoc => '<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="App1_MainNamespace_v0_1_1"
targetNamespace="App1/MainNamespace"
xmlns="App1/MainNamespace"
elementFormDefault="qualified"
version="0.1.1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:Imported="App1/ImportedNamespace">
<xs:import namespace="App1/ImportedNamespace" schemaLocation="importedSchemaURL.xsd"/>
<xs:complexType name="mainComplexType">
<xs:sequence>
<xs:element name="JustAString" type="xs:string" />
<xs:element name="ImportedString" type="Imported:ImportedType" />
</xs:sequence>
</xs:complexType>
<xs:element name="root" type="mainComplexType"/>
</xs:schema>',
local => true,
genTypes => false,
genTables => false,
enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE
end;
Besides the schemaLocation attribute, I've just added a root element in the main schema, and registered both with genTypes = false (use that option if you don't intend to use object-relational storage).
Validation test :
SQL> declare
2
3 doc xmltype := xmltype(
4 '<root xmlns="App1/MainNamespace"
5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6 xsi:schemaLocation="App1/MainNamespace mainSchemaURL.xsd">
7 <JustAString>ABC</JustAString>
8 <ImportedString>X</ImportedString>
9 </root>');
10
11 begin
12
13 doc.schemaValidate();
14
15 end;
16 /
declare
ERROR at line 1:
ORA-31154: invalid XML document
ORA-19202: Error occurred in XML processing
LSX-00221: "X" is too short (minimum length is 2)
ORA-06512: at "SYS.XMLTYPE", line 354
ORA-06512: at line 13
Seems to work -
XML-25004: Could not acquire a database connection named: gksconnection
HI Gentlemen,
I am trying to build up an XSQL page with a query against an XMLTYPE table, to display the contents using a stylesheet. I have set up an IDE connection, the test was successful. Now I would like to start the page just to see if it works altogether. Now without a stylesheet, only that the page executes. And I am constantly running into
XML-25004: Could not acquire a database connection named: gksconnection
I entered the connection in the XSQLConfig file by manual editing--it did not help. Well, there is some stuff in the forum about setting some preferences for OC4J, but in my version of JDeveloper only Weblogic Server is available. So I am prevented from clearing the cause of the problem.
My JDeveloper is a Studio Edition Version 11.1.1.3.0, Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660.
Please help me if you can.
Many thanks in advance,
kind regards from
Miklos HERBOLYSorry, I found a solution in My Oracle Support which will suffice.
Thank you very much
Miklos -
Difference in registering versus not registering an XSD with xml files
SQL> select * from v$version ;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for 64-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
With the help of members of this forum, I have been able to successfully register an XSD, save xml files into tables with xmltype columns, and select data from the xml files. For this I am very grateful.
Forgive me not knowing this but, I can currently do these two things.
1. Register an XSD and create a table with an xmltype column based off of this XSD. Insert xml into this table that matches the format of the xsd.
2. Insert an xml document into a table with an xmltype column without registering it's corresponding XSD and then select data from this table too.
Is there a performance benefit to registering the XSD the xml file is based off of, when it comes to inserting into the table or selecting data from the tables after the insert ?
The xml files we insert could be anywhere from 1MB to beyond 500MB+ in size, as it depends on the amount of audit data generated. Is there a sweet spot as to how big or small you would keep the size of the xml files to avoid performance issues. If we need to do an audit in the future we would be inserting all the generated xml files into a table and run selects on that table. This data could be anywhere from a day's worth to everything from the time the system went live.
We want to avoid any over head associated with XSDs if they do hinder performance.
Thanks for your help in advance.
WallyThe xml files we insert could be anywhere from 1MB to beyond 500MB+ in size, as it depends on the amount of audit data generated.Schema-based XMLType (aka Object-Relational or structure storage) is exactly what you need in this case.
- When you register a schema within the database, Oracle automatically creates a set of object types, collections and tables that map the XML structure to the SQL data model.
- When you insert an XML instance document in the schema-based table, the XML content is then stored in the underlying relational structure.
- When you issue queries against the XMLType table, for example using XQuery and XMLTable, Oracle automatically rewrites the query to access the relational objects where the data resides. This process results in very efficient queries whose performance compares to queries against regular tables. The Object-Relational structure also supports indexing.
The documentation has whole chapters about it :
http://docs.oracle.com/cd/B28359_01/appdev.111/b28369/xdb05sto.htm#g1070409
http://docs.oracle.com/cd/B28359_01/appdev.111/b28369/xdb_rewrite.htm#BABHJECG
http://docs.oracle.com/cd/B28359_01/appdev.111/b28369/xdb06stt.htm#BABGFCFG -
DB2 on AS/400. SQL0418 error from Filter tables, advanced search.
We're using ADF 11g against an AS/400 Database.
When using a filter table, or using any advanced search with starts with , .... we are getting an SQL error SQL0418 -- "A statement contains a use of parameter marker that is not valid ..."
The generated SQL looks something like:
SELECT Customer.CGVMSTCST,
Customer.PARENTCUSTOMER, ...
FROM CSTTBLMP Customer,
NADADRMP Address
WHERE Customer.CGVADRLOC = Address.NADADRLOC
AND ( ( (Customer.CGVADRSTE LIKE ( ? || '%') ) ) )
Running this query in test tools confirms that this is not acceptable SQL. However, this is
SELECT Customer.CGVMSTCST,
Customer.PARENTCUSTOMER, ...
FROM CSTTBLMP Customer,
NADADRMP Address
WHERE Customer.CGVADRLOC = Address.NADADRLOC
AND ( ( (Customer.CGVADRSTE LIKE ( cast(? as varchar(255)) || '%' ) ) ) );
DB2 needs the parameter marker to be typed.
We've created CustomerViewImpll.java (view for above examples) and overridden buildWhereClause() to replace
with
cast(? as varchar(255)).
In debug, we verify that the buffer passed to buildWhereClause (1st param) is being changed,
but when the query runs, it is not reflecting the changed value.
Is there anything else we need to change?
CustomerViewImpl.java:
@Override
protected boolean buildWhereClause(java.lang.StringBuffer sqlBuffer, int noBindVars) {
// call ViewObjectImpl's buildWhereClause() to allow the framework to do its processing
boolean hasWhereClause = super.buildWhereClause(sqlBuffer, noBindVars);
if (hasWhereClause) { // framework added a WHERE clause
sqlBuffer = replace(sqlBuffer, "?", "cast(? as varchar(255))");
else { // framework did not add a WHERE clause, so we need to add it ourselves
hasWhereClause = true; // ensure that is set to notify the framework
return hasWhereClause; // return true/false to indicate whether a WHERE clause was added
public StringBuffer replace (StringBuffer strBuffer, String searchString, String newString) {
String str = strBuffer.toString();
// Need to use Regex functionality, or the '?' replacement parm is construed as a regex instead of a literal
String newStr = str.replaceFirst(Pattern.quote(searchString), Matcher.quoteReplacement(newString));
return new StringBuffer(newStr);
...Thanks Nick -- as you suggested, the problem was in my code.
For anyone who runs into this, here's my working example:
(in CustomerViewImpl.java -- the view object implementation)
@Override
protected boolean buildWhereClause(java.lang.StringBuffer sqlBuffer, int noBindVars) {
// call ViewObjectImpl's buildWhereClause() to allow the framework to do its processing
StringBuffer sqlADF = new StringBuffer();
boolean hasWhereClause = super.buildWhereClause(sqlADF, noBindVars);
if (hasWhereClause) {
String str = sqlADF.toString();
String strInit = "?";
String strReplace = "cast(? as varchar(255))";
str = str.replaceFirst(Pattern.quote(strInit), Matcher.quoteReplacement(strReplace));
sqlBuffer.append(str);
else {
hasWhereClause = false; // ensure that is set to notify the framework
return hasWhereClause; // return true/false to indicate whether a WHERE clause was added
Should probably override the View Object base classes and set up project defaults to use overridden versions. -
I have extended the transactionfactory and the dbtransactionimpl classes and updated the proper am configuration property so that I should be able to extend rollback().
How come a rollback accesses my new tranaction code in the AM tester tool when I hit the rollback button, but when I actually run my adf app (against the embedded oc4j) this code is not run?
I am on jdev 10.1.3.3.0 running against the embedded oc4j at the moment. I am considering deploying to a stand-alone oc4j or OAS of the same version. What do you think of that?repost
-
Fusion ADF/BC Support to insert data to XMLType
As fusion application developer, I'm considering to use XMLType column to store XML data to Oracle DB 11gR2.
For fusion applications, is there a native way to insert the XMLType data using ADF BC ?The native XMLDB way of doing it, seeing from a ADF viewpoint, would be using Binary XML options as mentioned in the XDK:
http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10708/adx_j_gs.htm
http://download.oracle.com/docs/cd/E14072_01/appdev.112/e10708/adx_j_xmlbin.htm
Edited by: Marco Gralike on Nov 10, 2011 1:33 AM
Maybe you are looking for
-
My church is doing something called Operation Christmas Child. It’s a big service opportunity where anyone can come and pack a shoebox full of toys to be sent around the world for poor kids to get toys at Christmas. My church is doing a big shoebox p
-
I am setting up my new Ipad on my pc and for whatever reason, my itunes isnt recognizing the Ipad. Why is this and how can it be fixed?
-
Is Aperture 3.3 for me? I used to use picnik (don't laugh) :)
I recently upgraded to a 2012 MacBook Air 11 inch with 4GB of memory, 4,000 graphics etc. I take pictures with my Sony Cyber-shot 14.1 MP, 4x optical zoom, retractable lenses that says Carl Zeis Vario Tessar 2,7-5,7/4,7-18,8, my iPhone 4s, and my bui
-
Storage location updation for account assigned PO
Hi All, Our requirement is that for an internal order assigned and subcontracting PO (Account assignment-F & item category-L) we want to create outbound deliveries for which we need to have stock in storage location after doing GR. But, I found that
-
Rows Elimination in Distributed Workbook
Hello Forum. We are facing a problem in distributed workbooks, the users desire to eliminate the few rows from the report. Is is possible to remove / eliminate rows from the distributed query ? Regards Ashish