Storing data in structured storage
I see everywhere that storing data in stuctured storage way is the better thing to do if we want to make fast search.
But how can I do it.
I only see that the default storage is clob for xmltype and we also can say "stored as clob" but how do it for store it in structured storage.
Thank you.
You need to register an XML Schema that defines your data. You then define the type of data your XML columns will contain using XMLSCHEMA and ELEMENT clauses..
See the XML DB demo for more info
Similar Messages
-
Storing Data in structure?
Hi,
i want to store some data in structure, but i don't no in which way i should do this.
for example i send some data in adpu command.
the first 4 bytes identify an id the next 4 bytes identify a subid and the next 4 bytes identify an value. but there is a variable amount of subids and values i send.
the structure should look something like this.
id
- subid1
- value1
-subid2
- value2
-subidn
- valuen
i hope you can understand what i mean.
has someyone an idea how can this be done? i'm thankful for any suggestion.
it's a little bit urgent because it's for my final year project.
thanks
markusMarkus,
There are standards for doing this sort of thing. You should look into the following topics:
BER-TLV (Basic Encoding Rules - Tag Length Value)
Simple-TLV
Basically, a BER-TLV may contain multiple simple TLV(s). Define tags for your data objects, then go ahead and construct messages.
So:
<ber-tag><ber-len>[<simple-tag><simple-len><simple-val>...]
Good luck with that final project, I hope you pass. -
Problem after storing data in Storage and trying to read it
Hi all,
I have a problem with reading the data from a Storage file I created. The code folows:
public var storage: Storage;
public var prop: Property;
public var props: Property[];
var initialized: Boolean = false;
public function initiliazeDatabase(): Boolean {
storage = Storage {
source: "test.db"
var resource: Resource = storage.resource;
var inputStream: InputStream = resource.openInputStream();
readData(inputStream);
println("Initilatization done!!!");
println("size: {sizeof props}");
return initialized;
function initStorage() {
println("Initializing Storage ");
var out = storage.resource.openOutputStream(true);
var dummyRoot = "<prop></prop>\n";
out.write(dummyRoot.getBytes());
out.close();
initialized = true;
function parseCallback(e: Event) {
if (e.type == PullParser.START_ELEMENT) {
if (e.qname.name == "prop" and e.level == 0) {
prop = Property { };
} else if (e.type == PullParser.END_ELEMENT) {
if (e.qname.name == "prop" and e.level == 0) {
insert prop into props;
} else if (e.type == PullParser.TEXT) {
if (e.qname.name == "name" and e.level == 1) {
prop.name = e.text;
if (e.qname.name == "value" and e.level == 1) {
prop.value = e.text;
public function addProp(name: String, value: String): Void {
prop = Property {
name: name;
value: value;
insert prop into props;
public function storeData(): Void {
var out = storage.resource.openOutputStream(false);
for (prop in props) {
out.write(prop.toXml().getBytes());
out.close();
public function readData(inn: InputStream): Void {
var parser = PullParser {
input: inn;
onEvent: parseCallback;
try {
parser.parse();
initialized = true;
} catch (npe: NullPointerException) {
initStorage();
Now, for the first time, the app works as it should, the Storage is initialized (if it does not exist) and the required fields are stored in it when I need to.
However, the next time I start the application I get the following error:
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.runtime.provider.GUIRuntimeProvider$1.run(GUIRuntimeProvider.java:65)
at com.sun.javafx.tk.swing.SwingToolkit$StartupRoutine.run(SwingToolkit.fx:582)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: com.sun.javafx.data.pull.impl.StreamException: [20,1] Syntax Error in prop
at com.sun.javafx.data.pull.ukit.xml.ParserStAX.panic(ParserStAX.java:1516)
at com.sun.javafx.data.pull.ukit.xml.ParserStAX.next(ParserStAX.java:400)
at javafx.data.pull.PullParser.next(PullParser.fx:319)
at javafx.data.pull.PullParser.parse(PullParser.fx:258)
at com.gpsbuddy.utils.DatabaseUtils.readData(DatabaseUtils.fx:86)
at com.gpsbuddy.utils.DatabaseUtils.readData(DatabaseUtils.fx:86)
at com.gpsbuddy.utils.DatabaseUtils.initiliazeDatabase(DatabaseUtils.fx:30)
at com.gpsbuddy.utils.DatabaseUtils.initiliazeDatabase(DatabaseUtils.fx:30)
at com.gpsbuddy.main.Main.<clinit>(Main.fx:21)
at com.gpsbuddy.main.Main.<clinit>(Main.fx:21)
I did check the muffin file and it has no errors in it...
Thanks in andvance...Well, as it appears, the second part of the exception was right.. :P... I do have problem with the XML file.. for some reason I cannot have two <prop> tags in one document?
For example, if I have <prop></prop>, the program start ok... but when a new prop is added, for example, <prop></prop><prop></prop>, I get the error from the previous post?
Does anybody know anything about this? Could this be an error in the parser, or I am missing something?
Edited by: jonycus1 on Feb 25, 2010 3:10 PM -
Query about XMLTYPE column structured storage in Oracle Xml db
Dear All,
DB Version: Oracle 11g (11.2.0.3.0)
I have an table having one column as XMLTYPE with Structured storage.
CREATE TABLE Orders
Order_id NUMBER NOT NULL,
Order_etc VARCHAR2(100),
Order_desc XMLType NOT NULL
XMLTYPE Order_desc STORE AS OBJECT RELATIONAL XMLSCHEMA "http://localhost/public/xsd/order_desc_xsd.xsd" ELEMENT "OrderState";
I have then registered the XSD with XML Db schema which is required for Structured storage.
Before this table creation I had created a table (db_objects) of XMLTYPE and was able to use the below query to check for what all objects the XMLTYPE table got broken into when I registered its XSD.
SELECT column_name,
data_type
FROM user_tab_cols
WHERE table_name = 'DB_OBJECTS';
And used below query to look for data stored in Object-Relational structure for my table (DB_OBJECTS) created with XMLTYPE definition.
SELECT EXTRACTVALUE(xseq.column_value, '/THISROW/OWNER') AS owner
, EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_NAME') AS object_name
, EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_TYPE') AS object_type
, EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_ID') AS object_id
, EXTRACTVALUE(xseq.column_value, '/THISROW/CREATED') AS created
FROM db_objects do
, TABLE(XMLSEQUENCE(EXTRACT(VALUE(do), '/ROWSET/THISROW'))) xseq
WHERE ROWNUM <= 10;
Now could someone let me know, how to find how the column (Order_desc) of XMLTYPE was broken down into further objects just like I did for the Table with XMLTYPE (as shown above)?
Many Thanks.First given that you are on 11.2, ExtractValue is deprecated and the documentation lists three options to use instead. Here is one option (untested)
SELECT owner, object_name, object_type, object_id, created
FROM db_objects do,
XMLTable('/ROWSET/THISROW'
PASSING do.object_value
COLUMNS
-- Set data types accordingly
owner VARCHAR2(20) PATH 'owner',
object_name VARCHAR2(20) PATH 'object_name',
object_type VARCHAR2(20) PATH 'object_type',
object_id VARCHAR2(20) PATH 'object_id',
created VARCHAR2(20) PATH 'created');
Second, why does column order matter? You are storing in an object relational method. As long as the XML is valid per the schema, the Oracle will be able to store the data and later retrieve it as well. How that data is stored is mostly Oracle internals and should not be touched as it can be changed from version to version. You can use schema annotation to control how Oracle maps and stores the XML, but nothing in there specifies column order that I am aware of.
It seems additional details are missing as to what you need the information for so that would help others answer your question. -
SAP paging overflow when storing data in the ABAP/4 memory.
I am trying to create a data source in BI7.0 in the Datawarehousing Workbench. But along the process when i need to select a view i get an error detailed in the following error file extract: Please go through and assist.
untime Errors MEMORY_NO_MORE_PAGING
Date and Time 06.06.2009 14:21:35
Short text
SAP paging overflow when storing data in the ABAP/4 memory.
What happened?
The current program requested storage space from the SAP paging area,
but this request could not be fulfilled.
of this area in the SAP system profile.
What can you do?
Note which actions and input led to the error.
For further help in handling the problem, contact your SAP administrator
You can use the ABAP dump analysis transaction ST22 to view and manage
termination messages, in particular for long term reference.
Error analysis
The ABAP/4 runtime system and the ABAP/4 compiler use a common
interface to store different types of data in different parts of
the SAP paging area. This data includes the
ABAP/4 memory (EXPORT TO MEMORY), the SUBMIT REPORT parameters,
CALL DIALOG and CALL TRANSACTION USING, as well as internally defined
macros (specified with DEFINE).
To store further data in the SAP paging area, you attempted to
allocate a new SAP paging block, but no more blocks were
available.
When the SAP paging overflow occurred, the ABAP/4 memory contained
entries for 20 of different IDs.
Please note:
To facilitate error handling, the ABAP/4 memory was
deleted.
How to correct the error
The amount of storage space (in bytes) filled at termination time was:
Roll area...................... 8176
Extended memory (EM)........... 13587912
Assigned memory (HEAP)......... 0
Short area..................... " "
Paging area.................... 40960
Maximum address space.......... " "
By calling Transaction SM04 and choosing 'Goto' -> 'Block list',
you can display an overview of the current roll and paging memory
levels resulting from active users and their transactions. Try to
decide from this whether another program requires a lot of memory
space (perhaps too much).
The system log contains more detailed information about the
termination. Check for any unwanted recursion.
Determine whether the error also occurs with small volumes of
data. Check the profile (parameter "rdisp/PG_MAXFS", see
Installation Guidelines).
Is the disk or the file system that contains the paging file
full to the extent that it cannot be increased, although it has
not yet reached the size defined in the profile? Is the
operating system configured to accommodate files of such a
size?
The ABAP processor stores different types of data in the SAP
paging area. These include:
(1) Data clusters (EXPORT ... TO MEMORY ...)
(2) Parameters for calling programs (SUBMIT REPORT ...),
Dialog modules (CALL DIALOG ...) and transactions
(CALL TRANSACTION USING ...)
(3) Internally defined program macros (DEFINE ...)
Accordingly, you should check the relevant statements in a program
that results in an overflow of the SAP paging area.
It is critical when many internal tables, possibly with
different IDs, are written to memory (EXPORT).
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MEMORY_NO_MORE_PAGING" " "
"SAPLWDTM" or "LWDTMU20"
"TABC_ACTIVATE_AND_UPDATE"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.Hi Huggins,
Maintenance of the Paging File is owned by your basis team.
They should increase this in order for your transaction to process successfully.
Just for your reference, in case the OS used is windows server 2003, paging file value can be checked through;
Right click in the My Computer>properties.
Then go to Advance tab;
Then there should be a performance section, click the settings
Then Advance tab again. The paging file can be seen from there.
(and can be adjusted from there also)
The value of the paging file in general will be dependent with the available RAM from the hardware.
Hope this helps. Thanks a lot.
- Jeff -
Why files in Lightroom mobile and files in the creative cloud not the same? idea- one place(stored date) for all application ??????
Lightroom Mobile is not a cloud storage service. You shouldn't treat it as a way of backing up your files. You are merely storing Smart Previews of your files in the cloud space, high-quality JPEGs of your files regardless of their original format on your desktop. The point is that they are there so you can continue editing them in a Lightroom-like environment even while away from your desktop/laptop computer. The files in Lightroom Mobile can only be used in Lightroom Mobile.
This is very different from what is offered by the Creative Cloud storage, which can be used to synchronize your files between any device (that can support the individual files).
The vast difference in how each service works and its intended use is why they are separate. -
How to retreive data from structure MDEZ in T.code CO09
As per our requirement 2 new columns are needed in a customize report .i.e
- u201Cinc. lot dateu201D
- u201Cavailable inc. lotu201D
u201Cinc. lot dateu201D:to get the values for inc.lot.date
From second screen of CO09(program: SAPLATP4 and screen number: 400) pick first date where MRP element is u201CPOitemu201D, u201CShpgNtu201D or u201CPrdOrdu201D.
u201Cavailable inc. lotu201D: to get the values for available inc.lot
Pick u201CCum. ATP QTyu201D from the same row.
These data are stored in structure MDEZ. Actually I want dat00 and MNG04 based on field DELB0. If DELB0 filed is POitem or Prdord or ShpgNt then only I should retrieve the dat00 and MNG04. IF there are more than one POitem in MRP element then we should pick the first POitems' mrp date and *** ATP qty .Can you please help me out how to get these data from the structure MDEZ.
input parameters to get the values are material number and plant.Hi,
First of all data is never stored in structure so there is no way you can retrive data from structure.
you are looking into the screen field and it is not mandatory that it will always point to a table.
Now the qestion remains how to get the data ? you need to find database table for that field there are many ways like SE84 or SE11 where used etc.
Try to find the table if you still have the problem feel free to get back.
Regards
Bikas -
Which table will give data of structure KKBCS_OUT
Hi All,
I have requirement to get the values of Total target cost and Total actual
cost of production order.
Tcode: CO03->Goto->Costs->Analysis
We can see the posible cost elements and values of respective production order.
But all these data are stored in KKBCS_OUT structure.
Could you please tell me which table we can get these information?
I have checked individual data elements in where use list also. But i am not able
to find any thing.
Please let me know if any one faced same kind of issue.
Thanks in Advance
Basha Sk.Check with these tables :
<b>coss
cosl
cosp</b>
aufk
qmat -
hi firends,
i need to retreive data from table and structure is it possible
eg-- AAA is table having atr no
BBB is strucrure in run time its having some data related to AAA table atrno
i want a select query for this plz some one provide me with example code
but i know structure will not store value.my requirement is for IDOC so structure carries data so ineed to track that
pointe will be rewarded
thanks in advance
rajHi Raj ,
basically addition or deletion of segments the data holds in the data record structure.
all the data pertaining to the idoc is stored and processed
in the structures
EDIDC--> Control Records.
EDIDD --> Data srecords.
goto se37 and enter the FM name
f7
u 'll see
TABLES
*" IDOC_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
now if i want to know the data this is is structure EDIDD now in itab
IDOC_DATA.
BREAK-POINT.
LOOP AT IDOC_DATA.
ITAB-F1 = ID0C_DATA-F1.
ITAB-F2 = ID0C_DATA-F2.
ITAB-F3 = ID0C_DATA-F3.
APPEND ITAB.
CLEAR ITAB.
ENDLOOP.
this way u can fetch the data .
regards,
VIjay -
Processing a data mining structure throws an error
Processing a data mining structure throws an exception stating the following:
"Errors in the OLAP storage engine: An error occurred while the 'IDK' attribute of the 'Test IDK' dimension from the 'Project1' database was being processed."
"Errors in the OLAP storage engine: The attribute key was converted to an unknown member because the attribute key was not found. Attribute IDK of Dimension: Test IDK from Database: project1, Record:17072643"
I am using a DB view as a DSV. It does not have a unique primary key. Since DB view is getting multiple results per IDK, the IDK repeats for multiple rows. The same IDK is defined as Key column for the mining model. Not sure if that is the
issue. Please help!
Thanks
ShalluHi Shallu,
According to your description, you use a database view in the data source view that do not have a primary key, so you get the error
Errors in the OLAP storage engine: The attribute key was converted to an unknown member because the attribute key was not found. Attribute IDK of Dimension: Test IDK from Database: project1, Record:1707264
when processing the project, right?
In this case, please refer to the links below which describe the similar issue.
http://agilebi.com/ddarden/2009/01/06/analysis-services-error-the-attribute-key-cannot-be-found-when-processing-a-dimension/
http://social.technet.microsoft.com/Forums/systemcenter/en-US/432deebe-52b8-4245-af85-5aa2eecd421a/scsm2012-cube-processing-failing-on-two-cubes-configitemdimkey-not-found?forum=dwreportingdashboards
Regards,
Charlie Liao
TechNet Community Support -
Structured storage XMLType but disappointing performance
Hi,
This relates to Oracle 11g, but maybe the same question can be asked for 10g.
I'm having a lot of big XML files which are structured following this xsd:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema
xmlns="http://localhost/public/xsd/simple.xsd"
targetNamespace="http://localhost/public/xsd/simple.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xdb:storeVarrayAsTable="true">
<xs:element name="root" xdb:defaultTable="simple_or" xdb:maintainDOM="false">
<xs:complexType>
<xs:sequence>
<xs:element name="ea">
<xs:complexType>
<xs:sequence>
<xs:element name="eb" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="c1" type="xs:double" />
<xs:element name="c2" type="xs:double" />
<xs:element name="c3" type="xs:double" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>I create a VARRAY (the order is important) based structured storage table using the following commands:
declare
l_bfile bfile;
res boolean;
begin
l_bfile := bfilename('EXDIR', 'simple.xsd');
dbms_lob.open(l_bfile);
dbms_xdb.deleteResource('/public/simple.xsd',4);
res := dbms_xdb.createResource('/public/simple.xsd',l_bfile);
end;
BEGIN
DBMS_XMLSchema.deleteSchema(
schemaurl=>'http://localhost/public/xsd/simple.xsd',
delete_option=>DBMS_XMLSchema.Delete_Cascade_Force);
END;
begin
dbms_xmlschema.registerSchema(schemaurl => 'http://localhost/public/xsd/simple.xsd',
schemadoc => xdbUriType('/public/simple.xsd').getXML(),
local => true,
gentypes => true,
genbean => false,
gentables => true,
force => false,
owner => user);
end;
CREATE TABLE simple_or_1 OF XMLType
XMLSCHEMA "http://localhost/public/xsd/simple.xsd"
ELEMENT "root"
VARRAY "XMLDATA"."ea"."eb"
STORE AS TABLE simple_nested1
((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$)))
/And I load some XML files of the following form:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://localhost/public/xsd/simple.xsd">
<ea>
<eb>
<c1>4.0</c1>
<c2>5.0</c2>
<c3>6.0</c3>
</eb>
<eb>
<c1>7.0</c1>
<c2>8.0</c2>
<c3>9.0</c3>
</eb>
<eb>
<c1>7.0</c1>
... etc ...
</ea>
</root>
Every document has about 50.000 <eb> elements and I loaded 6 sample documents.
A simple query like the following takes about 5 minutes:
SELECT XMLQuery('
declare default element namespace "http://localhost/public/xsd/simple.xsd"; (: :)
for $i in /root
return max($i/a/b/c2)
' PASSING OBJECT_VALUE RETURNING CONTENT)
FROM simple_or_1;The explain plan shows the following:
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 6 | 60 | 3 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 1901 | | |
|* 2 | TABLE ACCESS BY INDEX ROWID| SIMPLE_NESTED1 | 1969 | 3655K| 6 (0)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | SYS_C009750 | 787 | | 2 (0)| 00:00:01 |
| 4 | SORT AGGREGATE | | 1 | | | |
| 5 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 |
| 6 | TABLE ACCESS FULL | SIMPLE_OR_1 | 6 | 60 | 3 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter(SYS_XMLCONV("SYS_ALIAS_2"."SYS_XDBPD$",0,32,'3952ABE048DCF8D6E040007F0101
7EA4',1,5561,1) IS NOT NULL)
3 - access("NESTED_TABLE_ID"=:B1)I'm not understanding the low performance of 5 minutes... is there anyone who can explain and help out?Note with DOM Fidelity disabled on all types the SYS_XMLCONV is replaced with the more efficeint SYS_XMLGEN. However this is still not as efficient as the XMLTable approach..
C:\Documents and Settings\Mark D Drake>sqlplus sys/oracle as sysdba
SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 7 06:03:39 2007
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Beta
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> connect / as sysdba
Connected.
SQL> --
SQL> drop user Tijink cascade
2 /
drop user Tijink cascade
ERROR at line 1:
ORA-01918: user 'TIJINK' does not exist
SQL> grant connect, resource, alter session, create view to Tijink identified by Tijink
2 /
Grant succeeded.
SQL> conn Tijink/Tijink
Connected.
SQL> --
SQL> set long 10000000
SQL> set pages 5000
SQL> var schemaPath varchar2(256)
SQL> var schemaURL varchar2(256)
SQL> var xmlSchema clob;
SQL> --
SQL> begin
2 :schemaURL := 'http://localhost/public/xsd/simple.xsd';
3 :schemaPath := '/public/simple.xsd';
4 :xmlSchema :=
5 '<?xml version="1.0" encoding="ISO-8859-1"?>
6 <xs:schema
7 xmlns="http://localhost/public/xsd/simple.xsd"
8 targetNamespace="http://localhost/public/xsd/simple.xsd"
9 xmlns:xs="http://www.w3.org/2001/XMLSchema"
10 xmlns:xdb="http://xmlns.oracle.com/xdb"
11 elementFormDefault="qualified"
12 attributeFormDefault="unqualified"
13 xdb:storeVarrayAsTable="true">
14 <xs:element name="root" xdb:defaultTable="simple_or">
15 <xs:complexType xdb:maintainDOM="false">
16 <xs:sequence>
17 <xs:element name="ea">
18 <xs:complexType xdb:maintainDOM="false">
19 <xs:sequence>
20 <xs:element name="eb" minOccurs="1" maxOccurs="unbounded">
21 <xs:complexType xdb:maintainDOM="false">
22 <xs:sequence>
23 <xs:element name="c1" type="xs:double" />
24 <xs:element name="c2" type="xs:double" />
25 <xs:element name="c3" type="xs:double" />
26 </xs:sequence>
27 </xs:complexType>
28 </xs:element>
29 </xs:sequence>
30 </xs:complexType>
31 </xs:element>
32 </xs:sequence>
33 </xs:complexType>
34 </xs:element>
35 </xs:schema>';
36 end;
37 /
PL/SQL procedure successfully completed.
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
SQL> DECLARE
2 BINARY_XML boolean:=FALSE;
3 BEGIN
4 IF (BINARY_XML)
5 THEN
6 dbms_xmlschema.registerSchema(SCHEMAURL => :schemaURL,
7 SCHEMADOC => :xmlschema,
8 LOCAL => TRUE,
9 GENTYPES => FALSE,
10 GENBEAN => FALSE,
11 GENTABLES => FALSE,
12 ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE,
13 FORCE => FALSE,
14 OPTIONS => DBMS_XMLSCHEMA.REGISTER_BINARYXML,
15 OWNER => USER);
16 ELSE
17 dbms_xmlschema.registerSchema(SCHEMAURL => :schemaURL,
18 SCHEMADOC => :xmlSchema,
19 LOCAL => TRUE,
20 GENTYPES => TRUE,
21 GENBEAN => FALSE,
22 GENTABLES => TRUE,
23 ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE,
24 FORCE => FALSE,
25 OWNER => USER);
26 END IF;
27 END;
28 /
PL/SQL procedure successfully completed.
SQL> --
SQL> set timing on
SQL> set long 1000000
SQL> set pages 50000
SQL> set lines 200
SQL> --
SQL> call dbms_stats.GATHER_SCHEMA_STATS('TIJINK')
2 /
Call completed.
Elapsed: 00:00:01.67
SQL> set autotrace on explain
SQL> --
SQL> SELECT XMLQuery
2 ('
3 declare default element namespace "http://localhost/public/xsd/simple.xsd"; (: :)
4 for $i in /root
5 return max($i/ea/eb/c2)
6 ' PASSING OBJECT_VALUE RETURNING CONTENT)
7 FROM "simple_or"
8 /
no rows selected
Elapsed: 00:00:00.28
Execution Plan
Plan hash value: 3716725992
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 10 | 2 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 23 | | |
|* 2 | TABLE ACCESS BY INDEX ROWID| SYS_NTobq/uFrTQGaOrq3BeDy9Eg== | 1 | 23 | 0 (0)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | SYS_C009648 | 1 | | 0 (0)| 00:00:01 |
| 4 | SORT AGGREGATE | | 1 | | | |
| 5 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 |
| 6 | TABLE ACCESS FULL | simple_or | 1 | 10 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - filter(SYS_XMLGEN(TO_CHAR("SYS_ALIAS_1"."c2")) IS NOT NULL)
3 - access("NESTED_TABLE_ID"=:B1)
SQL> select max(c2)
2 from "simple_or",
3 xmltable
4 (
5 xmlnamespaces
6 (
7 default 'http://localhost/public/xsd/simple.xsd'
8 ),
9 '/root/ea/eb'
10 passing OBJECT_VALUE
11 columns
12 C2 PATH 'c2'
13 )
14 /
MAX(C2)
Elapsed: 00:00:00.15
Execution Plan
Plan hash value: 1041340395
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 33 | 0 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 33 | | |
| 2 | NESTED LOOPS | | | | | |
| 3 | NESTED LOOPS | | 1 | 33 | 0 (0)| 00:00:01 |
| 4 | INDEX FULL SCAN | SYS_C009649 | 1 | 10 | 0 (0)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | SYS_C009648 | 1 | | 0 (0)| 00:00:01 |
| 6 | TABLE ACCESS BY INDEX ROWID| SYS_NTobq/uFrTQGaOrq3BeDy9Eg== | 1 | 23 | 0 (0)| 00:00:01 |
Predicate Information (identified by operation id):
5 - access("NESTED_TABLE_ID"="simple_or"."SYS_NC0000700008$")
SQL> desc "simple_or"
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://localhost/public/xsd/simple.xsd" Element "root") STORAGE Object-relational TYPE "root648_T"
SQL> desc "root648_T"
Name Null? Type
ea ea649_T
SQL> desc "ea649_T"
Name Null? Type
eb eb651_COLL
SQL> desc "eb651_COLL"
"eb651_COLL" VARRAY(2147483647) OF eb650_T
Name Null? Type
c1 NUMBER
c2 NUMBER
c3 NUMBER
SQL> -
Importing native xml in to semi structured storage
hello,
how store the a bibliographic data in the native xml and import or export that data into to the semi structured storage. What are the ways we query the xml database.
Eagerly waiting for the reply
Cheers
Akhil
Thank you in advanceBased on a small extension demo-ed in : http://www.liberidu.com/blog/?p=1053 (demo script demo06.sql)
-- If you can select it you can insert it...
-- drop table OGH_xml_store purge;
create table OGH_xml_store of xmltype
xmltype store as binary xml
commit;
exec get_dir_list( 'G:\OGH\xmlstore' );
set time on timing on
insert into OGH_xml_store
select XMLTYPE(bfilename('OGH_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8')) AS "XML"
from dir_list dl
where dl.filename like '%.xml';
set time off timing off
commit;
select count(*) from OGH_xml_store;
prompt pause
pause
clear screen
-- If you can select it you can create resources and files
set time on timing on
commit;
exec get_dir_list( 'G:\OGH\xmlstore' );
select count(*) from dir_list where filename like '%.xml';
set serveroutput on size 10000
DECLARE
XMLdoc XMLType;
res BOOLEAN;
v_foldername varchar2(4000) := '/public/OGH/';
cursor c1
is
select dl.filename FNAME
, XMLTYPE(bfilename('OGH_USE_CASE',dl.filename),NLS_CHARSET_ID('AL32UTF8')) XMLCONTENT
from dir_list dl
where dl.filename like '%.xml'
and rownum <= 100;
BEGIN
-- Create XDB repository Folder
if (dbms_xdb.existsResource(v_foldername))
then
dbms_xdb.deleteResource(v_foldername,dbms_xdb.DELETE_RECURSIVE_FORCE);
end if;
res:=DBMS_XDB.createFolder(v_foldername);
-- Create XML files in the XDB Repository
for r1 in c1
loop
if (DBMS_XDB.CREATERESOURCE(v_foldername||r1.fname, r1.xmlcontent))
then
dbms_output.put_line(v_foldername||r1.fname);
null;
else
dbms_output.put_line('Loop Exception :'||sqlerrm);
end if;
end loop;
EXCEPTION WHEN OTHERS THEN
dbms_output.put_line('Others Exception: '||sqlerrm);
END;
set time off timing off
commit;
prompt pause
pause
clear screen
-- FTP and HTTP
clear screen
prompt
prompt *** FTP - Demo ***
prompt
prompt pause
pause
host ftp
-- open localhost 2100
-- user OGH OGH
-- cd public
-- cd OGH
-- ls
-- bye
clear screen
prompt
prompt *** Microsoft Internet Explorer - Demo ***
prompt
prompt pause
pause
host "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://OGH:OGH@localhost:8080/public/OGH/
prompt pause
pause
-- Accessing the XDB Repository content via Resource View
-- Selecting content from a resource via XBDUriType
clear screen
prompt set long 300
set long 300
prompt Relative Path - (path)
SELECT path(1) as filename
FROM RESOURCE_VIEW
WHERE under_path(RES, '/public/OGH', 1) = 1
and rownum <= 10
prompt pause
pause
clear screen
prompt Absolute Path - (any_path)
select xdburitype(any_path).getClob() as xml
FROM RESOURCE_VIEW
WHERE under_path(RES, '/public/OGH', 1) = 1
and rownum <= 1;
prompt pause
pause -
hi,
what are the steps to follow to store or import/ export native xml data into semistructured storage in oracle 11g?????
how to test the performance of the semi structured data??????
Edited by: user11269819 on Jul 17, 2009 11:00 AMI'm not sure which method you are referring to as "semi-structure" (hybrid?) so I'll point you to this [Oracle 11g – XMLType Storage Options | http://www.liberidu.com/blog/?p=203] which is derived from [Oracle® XML DB Developer's Guide 11g Release 1|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28369/toc.htm]. You can also find more storage related information on Marco's blog under the [storage category | http://www.liberidu.com/blog/?cat=23]
-
Piecewise Insert into structured storage
I understand that XMLUPDATE can handle piecewise update, but what do I do for piecewise insert. I want to add a sub-tree (document fragment) conformant with the registered schema to the xml document, without re-writing the whole (possibly very, very large and growing) document, and retaining all the power and abstraction of structured storage.
It would be nice to get an XMLType via an XPath select, get the DOM object from the XMLTYpe, operate on the DOM, and see those changes reflected in the database. I can do all that, but the changes to the DOM seem to be in-memory only.
How do I add a sub-node to an existing structured document?
Thanks,
DavidHI,
Oracle version is 11.1.0.7.0.
Metalink found three bugs related to the error ORA-00600: Interner Fehlercode, Argumente: [qmxConvUnkType], [], [], [], [],
The bugs are:
BUG 8644684 ORA-600 [QMXCONVUNKTYPE] DURING INSERT INTO SCHEMA-BASED TABLE
BUG 8671408 INSERT OF XML DOC INTO AN XML SCHEMA STORED AS BINARY XML FAILS WITH ORA-30937
BUG 8683472 SCHEMA EXECUTABLE RETURNS INCORRECT ERRORS DURING VALIDATION AGAINST XML SCHEMA
Well, I have to look round in XML DB Forum yet. -
How to reduce size of stored data?
Does anyone know of a way to reduce the size of the stored data? The IMAP-[…]@imap.gmail.com folder in my ~/Library/Mail directory is more than twice the size of what's used on my gmail account, is it supposed to be like that?
Do you have a lot of attachments on the messages in the mailboxes of this account? One thing that balloons storage needs is that attachments may be redundantly stored in the mailboxes. If, for example, you open Home/Library/Mail/the IMAP account folder/INBOX.imapmbox you will note that it contains two folders -- Attachments and Messages. The attachments are replicated in the Attachments folder despite also being archived with the message in the Messages folder -- this may only be true if you have selected to Keep copies of all messages and their attachments for Offline viewing, however.
Ernie
Maybe you are looking for
-
i dont know what else to do
-
Use of 5508 WLC across the WAN as MC for unified access
I came accross a remark that Cisco 5508 cannot be used for a MC role/functionality accross the WAN for Cisco 3850/3650 switches in the branch locations (acting as MA). The reason was some 10 ms transit time limits,..But i could not find any such ment
-
i have a problem with my 2730 classic. its freezes when i select application list folder in my Go to key, select option is it possible that virus/worm can affect nokia 2730 classic?
-
Related to this, do we know if the October any-day-now updates to Premiere Pro and Speedgrade will allow timelines that include/embed dynamically-linked AE clips to be easily moved in and out of Speedgrade from Premiere Pro? Or will it be a better id
-
The RX620 all in one is new to me. Am wanting to print 4 different pictures on an 8 1/2 x 11 sheet. This means a print 4 1/4 by 5 1/2. The printer only recognizes standard 4 x 6 or 5 x 7 and of course printing only 2 pics. Already talked with epson,