Use external DTD in 11g
Hi,
I try to parse an XML file within a CLOB column. In Oracle 9i and 10g the code work, but in 11 I get a lot of errors.
First I got
ORA-31020: Der Vorgang ist nicht zulässig, Ursache: For security reasons, ftp and http access over XDB repository is not allowed on server side (-31020)
The XML file contains a reference to an external DTD, which is accessible per HTTP on a remote webserver.
As I have understood, I have to register all my DTDs within the Oracle Database. I found
dbms_xmlschema.registerURI()
to do the job. This is very unpractical, because there are a lot of DTDs, which can be referenced by the XML-CLOBs. So I have to register all the DTDs manually.
Normally the XML generator adds the matching DTD reference and so I can validate the XML with the parser without any knowledge about the type of the DTD.
To figure out the problem I read a lot of documents on severyl websites. I have tried
select HTTPURITYPE('http://mywebserver.domain/schema/mydtd-v1.0.dtd').getCLob() from dual;
to load the DTD content. Surprise, surprise I got a lot of ACL errors. To solve that, I have added some network acls. At the moment the statement above
returns my DTD within a CLOB now, so it seems, that I can load the external file from the remote webserver.
Back to registerURI():
dbms_xmlschema.registerURI(
schemaURL => 'http://mywebserver.domain/schema/mydtd-v1.0.dtd',
schemaDocUri => 'http://mywebserver.domain/schema/mydtd-v1.0.dtd',
local => false);
returns now (error messages in German)
ORA-31011: XML-Parsing nicht erfolgreich
ORA-19202: Fehler bei XML-Verarbeitung
LPX-00247: Ungültige Dokument-Typ-Deklaration (DTD)
Error at line 5
aufgetreten
ORA-06512: in "XDB.DBMS_XMLSCHEMA_INT", Zeile 20
ORA-06512: in "XDB.DBMS_XMLSCHEMA", Zeile 199
ORA-06512: in Zeile 12
The same error occurs on
dbms_xmlschema.registerschema(
schemaURL => 'http://mywebserver.domain/schema/mydtd-v1.0.dtd',
schemaDoc => HTTPURITYPE('http://mywebserver.domain/schema/mydtd-v1.0.dtd').getCLob()
How I can get more information about the underlying error? I have tried to enable tracing for some XDB events, but in the udump directory
exist only old files. I think, the DTD is correct, also the reference within the XML CLOB (because it works on the old database instances).
It seems to be a security or character-set(?) issue.
Any ideas?
Thanks a lot
Andre
As I have understood, I have to register all my DTDs within the Oracle Database.
Not exactly.
DBMS_XMLSchema procedures deal with XML schemas, not DTDs.
You can have Oracle resolve the DTD by loading it into the XML DB repository at the same uri referenced by the XML file.
Or, if you don't actually need to use those DTDs to validate XML documents, you can also disable DTD validation altogether at session or instance level.
Similar Messages
-
Validating an XML document using external DTD?
Hi,
I want to validate an XML file using external DTD with SAX parser.
How can I validate an XML file with external DTD.
Thanks in Advance,
MahendraI dont think we can set a DTD file throug java while
parsing an XML.I've done it with an XML schema though. Can you use that instead? For schemas you do something like:
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setAttribute( "http://java.sun.com/xml/jaxp/properties/schemaSource",
schemaUrl );where schemaUrl in this case would be something like file:///usr/local/whatever.xsd -
ORA-31020 when using XML with external DTD or entities
I'd like to parse XML documents against a modular DTD that references other DTDs. This works fine with Oracle 9i. But after upgrading to 11g, the parsing of XML-instances fails and DBMS_XMLPARSER.parseClob produces ORA-31020.
The same error occurs even if I simply try to store XML with a reference to an external DTD as xmltype:
SQL> select xmltype('<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE ewl-artikel SYSTEM "http://www.foo.com/example.dtd"><test>123</test>') from dual;
ERROR:
ORA-31020: Der Vorgang ist nicht zulässig, Ursache: For security reasons, ftp
and http access over XDB repository is not allowed on server side
ORA-06512: in "SYS.XMLTYPE", Zeile 310
ORA-06512: in Zeile 1
How can I use external DTDs on remote servers in order to parse XML in an 11g database??? Any ideas for a workaround? Thanks in advance!This is my PL/SQL validation procedure:
procedure validatexml (v_id in number default 0) is
PARSER DBMS_XMLPARSER.parser;
DTD_SOURCE clob;
DTD_DOCUMENT xmldom.DOMDocumentType;
XML_INSTANCE xmltype;
BEGIN
-- load DTD from XDB repository
SELECT httpuritype('http://example.foo.de/app1/DTD1.dtd').getclob() into DTD_SOURCE from dual;
-- load XML instance
select co_xml into XML_INSTANCE from tb_xmltab where co_id=v_id;
-- parse XML instance
PARSER := DBMS_XMLPARSER.newParser;
xmlparser.setValidationMode( PARSER , false);
xmlparser.parseDTDClob( PARSER , DTD_SOURCE , 'myfirstnode' );
DTD_DOCUMENT := xmlparser.getDoctype( PARSER );
xmlparser.setValidationMode( PARSER , true );
xmlparser.setDoctype( PARSER , DTD_DOCUMENT );
DBMS_XMLPARSER.parseClob( PARSER , v_xml );
DBMS_XMLPARSER.freeParser(PARSER);
htp.print('<P>XML instance succesfully validated!<P>');
end validatexml; -
Can I validate an XML file using an external DTD
Hi,
I'm trying to use an external DTD to validate an XML
file (which does not refer to this DTD). The java docs that ship
with the XML parser aren't clear on how exactly to do this (or
whether it can be done). I'd appreciate any advice on how I
should perform this operation.
Here's what I'm doing right now.
1) The Java file
import oracle.xml.parser.v2.*;
public class ParseWithExternalDTD
public static void main(String args[]) throws Exception
DOMParser dp=new DOMParser();
dp.parseDTD
("file:d:/jdk1.2/sample/test/family.DTD","family");
DTD dtd=dp.getDoctype();
dp.setDoctype(dtd);
dp.parse("file:d:/jdk1.2/sample/test/family.xml");
System.out.println("Finished with no errors!");
2) The family.DTD file
<!ELEMENT family (member*)>
<!ATTLIST family lastname CDATA #REQUIRED>
<!ELEMENT member (#PCDATA)>
<!ATTLIST member memberid ID #REQUIRED>
<!ATTLIST member dad IDREF #IMPLIED>
<!ATTLIST member mom IDREF #IMPLIED>
3) The family.xml file
<?xml version="1.0" standalone="no"?>
<family lastname="Smith">
<TagToFoilParserValidation>
</TagToFoilParserValidation>
<member memberid="m1">Sarah</member>
<member memberid="m2">Bob</member>
<member memberid="m3" mom="m1" dad="m2">Joanne</member>
<member memberid="m4" mom="m1" dad="m2">Jim</member>
</family>
4) The output
Finished with no errors!
As you can see, the DOMParser failed to validate the family.xml
file against the family dtd otherwise, it would have reported a
validation error when it came across the
TagToFoilParserValidation.
Any insight as to what I'm doing wrong would be much appreciated.
Sincerely,
Keki
Project Iona
Manufacturing Applications
Oracle Corporation
The views and opinions expressed here are
my own and do not reflect the views and
opinions of Oracle Corporation
nullKeki Burjorjee (Oracle) (guest) wrote:
: 2 further questions related to this issue.
: 1) Say I am using XSLT to transform A.xml into B.xml, and I
: want to embed a reference to B.dtd within the B.xml file. Is
: there an XSLT command which will allow me to do this?
: 2) Is it possible for your team to give me a mechanism whereby
I
: can preset the xml parser to validate the next xml file (or
: inputstream) it receives against a particular DTD? This scheme
: does not require the dtd to be present within the XML file
: Thanks,
: - Keki
: Oracle XML Team wrote:
: : What you are doing wrong is not including a reference to the
: : applicable DTD in your XML document. Without it there is no
: way
: : that the parser knows what to validate against. Including
the
: : reference is the XML standard way of specifying an external
: : DTD. Otherwise you need to embed the DTD in your XML
Document.
: : Oracle XML Team
: : http://technet.oracle.com
: : Oracle Technology Network
: : Keki Burjorjee (guest) wrote:
: : : Hi,
: : : I'm trying to use an external DTD to validate an XML
: : : file (which does not refer to this DTD). The java docs that
: : ship
: : : with the XML parser aren't clear on how exactly to do this
: (or
: : : whether it can be done). I'd appreciate any advice on how I
: : : should perform this operation.
: : : Here's what I'm doing right now.
: : : 1) The Java file
: : : import oracle.xml.parser.v2.*;
: : : public class ParseWithExternalDTD
: : : public static void main(String args[]) throws Exception
: : : DOMParser dp=new DOMParser();
: : : dp.parseDTD
: : : ("file:d:/jdk1.2/sample/test/family.DTD","family");
: : : DTD dtd=dp.getDoctype();
: : : dp.setDoctype(dtd);
: : : dp.parse("file:d:/jdk1.2/sample/test/family.xml");
: : : System.out.println("Finished with no errors!");
: : : 2) The family.DTD file
: : : <!ELEMENT family (member*)>
: : : <!ATTLIST family lastname CDATA #REQUIRED>
: : : <!ELEMENT member (#PCDATA)>
: : : <!ATTLIST member memberid ID #REQUIRED>
: : : <!ATTLIST member dad IDREF #IMPLIED>
: : : <!ATTLIST member mom IDREF #IMPLIED>
: : : 3) The family.xml file
: : : <?xml version="1.0" standalone="no"?>
: : : <family lastname="Smith">
: : : <TagToFoilParserValidation>
: : : </TagToFoilParserValidation>
: : : <member memberid="m1">Sarah</member>
: : : <member memberid="m2">Bob</member>
: : : <member memberid="m3" mom="m1" dad="m2">Joanne</member>
: : : <member memberid="m4" mom="m1" dad="m2">Jim</member>
: : : </family>
: : : 4) The output
: : : Finished with no errors!
: : : As you can see, the DOMParser failed to validate the
: : family.xml
: : : file against the family dtd otherwise, it would have
: reported
: : a
: : : validation error when it came across the
: : : TagToFoilParserValidation.
: : : Any insight as to what I'm doing wrong would be much
: : appreciated.
: : : Sincerely,
: : : Keki
: : : Project Iona
: : : Manufacturing Applications
: : : Oracle Corporation
: : : The views and opinions expressed here are
: : : my own and do not reflect the views and
: : : opinions of Oracle Corporation
1) No XSLT commands exist that allow you to embed a DTD while
doing the transformation.
2) You can use the setDocType() method in the parser, to set a
DTD based on which the XML document will be validated. The
parseDTD() method allows you to parse a DTD file separately and
get a DTD object. Here is a sample code :
DOMParser domparser = new DOMParser();
domparser.setValidationMode(true);
// parse the DTD file
domparser.parseDTD(new FileReader(dtdfile));
DTD dtd = domparser.getDocType();
// Parse XML file - XML file will be validated based on the DTD.
domparser.setDocType(dtd);
domparser.parse(new FileReader(xmlfile));
Document doc = domparser.getDocument();
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null -
Error opening external DTD 'Segnatura.dtd' using dbms_xmlsave.insertXML
I've been trying to insert a document in a table. All works fine
if the xml doesn't contains the doctype element!
If I add the row
<!DOCTYPE Segnatura SYSTEM "Segnatura.dtd">
to my xml I get the error:
oracle.xml.sql.OracleXMLSQLException: Error opening external DTD
'Segnatura.dtd'.
If I specify all the path "file:///temp/Segnatura.dtd" the insert
works, but I don't want to do in that way beacause I don't want
to modify the original xml that i'm inserting!
In the package dbms_xmlsave I have no ways to change the
basedir/baseurl
or to setValidationMode to false like in xmlparser package.
Is there any way to solve this problem??
Thank's in advance
Mauro
This is an example scratch of my xml doc:
<?xml version = '1.0' encoding = 'ISO-8859-1'?>
<!DOCTYPE Segnatura SYSTEM "Segnatura.dtd">
<Segnatura versione="2001-05-07"
xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="it">
</Segnatura>Hy Steven, thank's for your attention.
I'm not using the xsql servlet.
I'm reading an xml file coming from the file system and I want to
import it in the db using a java stored proc.
I also have the dtd file (Segnatura.dtd) but I don't know where
to put in on the server.
If I run my java program and I put Segnatura.dtd in the execution
classpath on the program the xml is loaded fine.
If I load the stored proc in the db then I don't know where to
put the dtd. Do I have to put the directory containing the dtd in
the server classpath and the restart the db maibe?
thank's
mauro -
Error while fetching data from OWB Client using External Table.
Dear All,
I am using Oracle Warehouse Builder 11g & Oracle 10gR2 as repository database on Windows 2000 Server.
I facing some issue in fetching data from a Flat File using external table from OWB Client.
I have perform all the steps without any error but when I try to view the data, I got the following error.
======================================
RA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file expense_categories.csv in SOURCE_LOCATION not found
ORA-06512: at "SYS.ORACLE_LOADER", line 19
java.sql.SQLException: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04040: file expense_categories.csv in SOURCE_LOCATION not found
ORA-06512: at "SYS.ORACLE_LOADER", line 19
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:774)
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:849)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:386)
at oracle.wh.ui.owbcommon.QueryResult.<init>(QueryResult.java:18)
at oracle.wh.ui.owbcommon.dataviewer.relational.OracleQueryResult.<init>(OracleDVTableModel.java:48)
at oracle.wh.ui.owbcommon.dataviewer.relational.OracleDVTableModel.doFetch(OracleDVTableModel.java:20)
at oracle.wh.ui.owbcommon.dataviewer.RDVTableModel.fetch(RDVTableModel.java:46)
at oracle.wh.ui.owbcommon.dataviewer.BaseDataViewerPanel$1.actionPerformed(BaseDataViewerPanel.java:218)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.AbstractButton.doClick(AbstractButton.java:282)
at oracle.wh.ui.owbcommon.dataviewer.BaseDataViewerPanel.executeQuery(BaseDataViewerPanel.java:493)
at oracle.wh.ui.owbcommon.dataviewer.BaseDataViewerEditor.init(BaseDataViewerEditor.java:116)
at oracle.wh.ui.owbcommon.dataviewer.BaseDataViewerEditor.<init>(BaseDataViewerEditor.java:58)
at oracle.wh.ui.owbcommon.dataviewer.relational.DataViewerEditor.<init>(DataViewerEditor.java:16)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at oracle.wh.ui.owbcommon.IdeUtils._tryLaunchEditorByClass(IdeUtils.java:1412)
at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1349)
at oracle.wh.ui.owbcommon.IdeUtils._doLaunchEditor(IdeUtils.java:1367)
at oracle.wh.ui.owbcommon.IdeUtils.showDataViewer(IdeUtils.java:869)
at oracle.wh.ui.owbcommon.IdeUtils.showDataViewer(IdeUtils.java:856)
at oracle.wh.ui.console.commands.DataViewerCmd.performAction(DataViewerCmd.java:19)
at oracle.wh.ui.console.commands.TreeMenuHandler$1.run(TreeMenuHandler.java:188)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
===========================
In the error it is showing that file expense_categories.csv in SOURCE_LOCATION not found but I am 100% sure that file is very much there.
Is anybody face the same issue?
Do we need to configure something before loading data from a flat file from OWB Client?
Any help would higly appreciable.
Regards,
Manmohan SharmaHi Detlef / Gowtham,
Now I am able to fetch data from flat files from OWB Server as well as OWB Client.
One way I have achieved as suggested by you
1) Creating location on the OWB Client
2) Samples the files at client
3) Created & Configured external table
4) Copy all flat files on OWB Server
5) Updated the location which I created at the client.
Other way
1) Creating location on the OWB Client
2) Samples the files at client
3) Created & Configured external table
4) Copied flat files on the sever in same drive & directory . like if my all flat files are on C:\data at OWB Client then I copied flat file C:\data on the OWB Server. But this is feasible for Non-Windows.
Hence my problem solved.
Thanks a lot.
Regards,
Manmohan -
Error opening external DTD 'book.dtd'
I know this may be something simple, but can't get it to work. I have a local (on my local network) dtd file that I'm trying to use for validation on my xml file.
My first two lines in the xml are:
<?xml version="1.0" ?>
<!DOCTYPE book SYSTEM "D:\tmp\book.dtd">
When trying to parse it in Java, I get the exception thrown of:
Error opening external DTD 'book.dtd'.
I checked, and the file has full permissions for read and write, and it is in the directory specified.
How can I use an external dtd file on my local network for my DTD validation?
Thanks in advance!
nullTry using PUBLIC instead of SYSTEM.
Oracle XML Team -
XML document in CLOB with reference to external DTD
If you place the xml document in clob using dbms_lob and the document has reference to external (system) DTD then it gives an error 'Error opening external DTD'. Whats the work around. See example below...
declare
xmlstring CLOB;
xmlstring1 CLOB;
os_file BFILE := bfilename('BFILE_DIR','family.xml');
> > > rowsp INTEGER; > > > errnum NUMBER; > > > errmsg VARCHAR2(2000);
> > > time VARCHAR2(20); > > > begin
> > > select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS')
> > > into time from dual; > > > dbms_output.put_line(time);
> > > dbms_lob.createtemporary(xmlstring, true, > > > dbms_lob.session);
> > > dbms_lob.fileopen(os_file, > > dbms_lob.file_readonly);
> > > dbms_lob.loadfromfile(xmlstring, os_file,
> > > dbms_lob.getlength(os_file));
> > > select to_char(sysdate,'MM/DD/YYYY HH24:MI:SS')
> > > into time from dual; > > > dbms_output.put_line(time);
> > > xmlgen.resetOptions; > > > xmlgen.setRowTag('family');
> > > --xmlgen.setIgnoreTagCase(xmlgen.IGNORE_CASE);
> > > rowsp := xmlgen.insertXML('family',xmlString);
> > > dbms_output.put_line(' Rows processed = '| | > > > TO_CHAR(rowsp));
> > > dbms_lob.freetemporary(xmlstring);
> > > dbms_lob.fileclose(os_file); > > > commit; > > > exception
> > > when no_data_found then > > > rollback;
> > > dbms_lob.freetemporary(xmlstring);
> > > dbms_lob.fileclose(os_file); > > > errnum := abs(SQLCODE);
> > > errmsg := SQLERRM;
> > > dbms_output.put_line(errnum| |'----'| |errmsg); > > > when others then
> > > rollback; > > > dbms_lob.freetemporary(xmlstring);
> > > dbms_lob.fileclose(os_file); > > > errnum := abs(SQLCODE);
> > > errmsg := SQLERRM;
> > > dbms_output.put_line(errnum| |'----'| |errmsg); > > > end;Can be one of two problems.
One
Your database user does not have
privileges to open a socket inside
the database. This will prevent
the XML parser running inside the DB
from retrieving the DTD which it must
do to properly parse the document.
Two
you are sitting behind a corporate
firewall and need to properly set
the Proxy Server host and port to
properly retrieve the DTD.
From looking at your code it would appear
that your job can more easily be done by
using the OracleXML putXML command line
utility outside the database.
You can specify the -D options to your
JavaVM to set the System properties for
the proxy server if need be like this:
java -DproxySet=true -DproxyHost=yourproxyserver OracleXML putXML -
How to use external Java API in Java Embedd inside BPEL
How to use external classes inside the BPEL in Java Embed Activity ? Any sample code availble ? Like i want to use log4j API inside BPEL.
No you dont have to change your startManagedServer.cmd/.sh everytime you need to have a Java Embedding activity. You only need it in case of using Log4J. As log4j requires a configuration xml viz log4j.debug.xml and log4j.dtd you need to let the soa managed server know about it. The best way to load this configuration files is using the JAVA_OPTIONS command during server startup.
Hope the explanation helps. -
Is it possible to use External Defiantion in Interface Mapping?
Hi Experts,
Is it possible to use External defination in Interface mapping? I used this ED in Message Mapping but I am unable to use the same ED for Interface Mapping?
In order to create Interface Mapping I need to create Message Interface and use it in Interface Mappiong?
Thanks
RajeevHi Rajeev,
External definitions is for importing avaliable external DTD,XSD or WSDLs instead of creating them in XI environment maually by creating elements under datatypes,assigning them too Message types and Message Interfaces etc.Where as you fo for Imported Archives to import externally done Mapping programs like JAVA,ABAP and XSLT mappings but not define Mesage interfaces.
So you can create message interface import appropriate External definition into it.Later use it during interface mapping.Hope you understand it.
Thanks,
Ram. -
Hello!
How can the Oracle XML-Parser parse a XML-Document without the
XML-Declaration. There is no information about the Version and
the DTD in the XML-Document. Can I use an extern DTD?
Thanks,
Peter
nullPeter Roemer (guest) wrote:
: Hello!
: How can the Oracle XML-Parser parse a XML-Document without the
: XML-Declaration. There is no information about the Version and
: the DTD in the XML-Document. Can I use an extern DTD?
: Thanks,
: Peter
Have you tried oracle.xml.parser.v2.XMLParser.setDoctype(DTD)?
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null -
I get the error above when doing the following
import oracle.xml.parser.v2.DOMParser;
public class testXMLI do not know how do you pass the JDK compiler.Typos in the transcription process. I was more interested in showing my approach rather than precise code (apologies).
Actual code below - less 2 methods I have not changed.
Andrew
=======================
import java.net.URL;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.NamedNodeMap;
//import oracle.xml.parser.v2.DOMParser;
//import oracle.xml.parser.v2.XMLDocument;
import java.io.*;
import org.xml.sax.*;
import org.apache.xerces.parsers.DOMParser;
public class DOMSample
static public void main(String[] argv)
try
if (argv.length != 1)
// Must pass in the name of the XML file.
System.err.println("Usage: java DOMSample <xml file>");
System.exit(1);
// Get an instance of the parser
DOMParser parser = new DOMParser();
// Oracle's Way - gives an error "Error opening external DTD"
// Set various parser options: validation on,
// warnings shown, error stream set to stderr.
// parser.setErrorStream(System.err);
// parser.setValidationMode(DOMParser.DTD_VALIDATION); <-- deprecated ??
// parser.showWarnings(true);
// Parse the document
// System.out.println("Parsing XML document and do DTD Validation...");
// System.err.println("Parser version " + parser.getReleaseVersion());
// parser.parse(DemoUtil.createURL(argv[0]));
// My way - using Xerces - works, using an input source with Oracle way also fails
File file = new File ("c:\\temp2\\javFilterDat.xml");
InputSource is = new InputSource( new FileReader(file));
is.setSystemId("file:/c:"+ System.getProperty("file.separator") +
"temp2");
parser.parse(is);
// Obtain the document.
Document doc = parser.getDocument();
// Print document elements
System.out.print("The elements are: ");
printElements(doc);
// Print document element attributes
System.out.println("The attributes of each element are: ");
printElementAttributes(doc);
catch (Exception e)
System.out.println(e.toString()); -
How can I use external tables with directories not on Oracle host?
Oracle 11.2.0.2
We have developers using C# to populate global temporary tables (two one header and detail with 1 to many relationbship between these two tables). The process of using C# was blowing up memory on Windows.
As an alternative I requested them to create two CSV files and I can use sqlldr to load the detail CSV file of over 1 million rows under 15 seconds. It came to my mind that I could use external tables for this purpose with getting read of header and trailer from the CSV files.
The issue I have is that I am not a DBA so I do not have access to OS host that Oracle instance is running. sqlldr is a client side tool, whereas external tables are server side. I was wondering if there is an alternative in 11g to use external tables without creating directories on the OS host that Oracle runs on? Are there other alternatives?
Thanks905989 wrote:
Oracle 11.2.0.2
We have developers using C# to populate global temporary tables (two one header and detail with 1 to many relationbship between these two tables). The process of using C# was blowing up memory on Windows.
As an alternative I requested them to create two CSV files and I can use sqlldr to load the detail CSV file of over 1 million rows under 15 seconds. It came to my mind that I could use external tables for this purpose with getting read of header and trailer from the CSV files.
The issue I have is that I am not a DBA so I do not have access to OS host that Oracle instance is running. sqlldr is a client side tool, whereas external tables are server side. I was wondering if there is an alternative in 11g to use external tables without creating directories on the OS host that Oracle runs on? Are there other alternatives?
Thanks
no other alternative -
Validating an xml with DTD external DTD
Hi
how can i validate my XML File with an external DTD ?
thanks for your replies
sergeHi,
when you use the XML Library, the interface <b>if_ixml_parser</b> has a static method <b>set_validation( )</b> to activate and deactivate a DTD validation.
There are the follow constants in the if_ixml_parser for the DTD validation-mode:
<b>if_ixml_parser=>co_no_validation</b>
Do not validate the XML-Document against the document type definition (DTD)
<b>if_ixml_parser=>co_validate</b>
Validate the XML-Document against the document type definition (DTD)
<b>if_ixml_parser=>co_validate_if_dtd</b>
Validate the XML-Document against the document type definition (DTD) if a DTD is specified. Otherwise parse the Document in non validating mode.
see also the SAP online-help:
<a href="http://help.sap.com/saphelp_webas610/helpdata/de/bb/5766b2dca511d4990b00508b6b8b11/content.htm">Interface if_ixml_parser</a>
Regards
Stefan -
I am using oracle 11g.
I had created a external tables to load data. here the data is very huge of about having 77777888 record set. I had loaded the data using external table.
My requirement is -
I have to join few or more external table and should get an output in flatfile.
This flatfile will be used by my clients to load the data in their tables.
is there any possible way to get the data from external table and load it in flat file. If so please let me know the steps.
Thanks in advance.The criteria I meant in my suggestion / example is this..
CREATE TABLE TST_EXT
NUM VARCHAR2(64 BYTE),
STR VARCHAR2(64 BYTE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY FEED_LOG_DIR
ACCESS PARAMETERS
( records delimited by newline
fields terminated by ','
lrtrim
missing field values are null
LOCATION (FEED_DIR:'tst.txt')
REJECT LIMIT 0;
CREATE OR REPLACE PROCEDURE pr_wt_file (v_min_num NUMBER,
v_max_num NUMBER,
fname VARCHAR2) AS
fileHandler UTL_FILE.FILE_TYPE;
BEGIN
fileHandler := UTL_FILE.FOPEN ('FEED_DIR', fname, 'W');
FOR rec IN (SELECT *
FROM tst_ext
WHERE num BETWEEN v_min_num AND v_max_num) LOOP
UTL_FILE.PUT_line (fileHandler, rec.num || ' ' || rec.str);
END LOOP;
UTL_FILE.FCLOSE (fileHandler);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
EXEC pr_wt_file(1,500,'TMP1.txt');
EXEC pr_wt_file(500,1000,'TMP2.txt');Those above two procedure calls can be parallel. and ultimately the files can be joined using shells script..
cd
cd /tst/TSTDIR
cat TMP*txt>ABC.txt
mv ABC.txt filename1.txt
rm TMP*
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'FILE_JOINER',
job_type => 'EXECUTABLE',
job_action => '/tst/joiner.sh',
start_date => SYSDATE+1/2400,
enabled => TRUE,
comments => 'Calling the joiner shell script from Oracle'
END;
/ I tried it in oracle 11g in my DB.
I was suggesting OP to find similar criteria where he can distinguish the rows for writing them parallel.
Cheers,
Manik
Maybe you are looking for
-
Hello Gurus, We want to send dunning notice by mail to dunning receipient. Can we use user exit-F150D001? Pl.advise us. Thanks in advance, Ganesh Lokam.
-
How to add header and footer in FM12 WebHelp?
Hi I am evaluating TCS 5 with the trial version. In FrameMaker 11, while publishing my book to WebHelp, I could associate the masterpage (.htt) file to get its header/footer in the output. However, I don't see that option in FM12. I have looked throu
-
Hyperlinks are no longer working
I can no longer click on a hyperlink and go to the web page. I need to copy and paste the URL. This has only happned recently and is very frustring. I have a 6 month old 13" MacBook Pro retina running Mavericks
-
hello, i checked the following url: http://technet.oracle.com/doc/reports25/ormc2/ch1.htm#toc009 there i read about the error messages that could occur during report generation: there are types like: REP ORA DBA EXP IMP and so on ... could anybody po
-
Sub-queries assistance, please/
Hi Everyone, For simplyfying things, let's assume that I have two tables MAIN and USERS USERS contains the fileds ID, FIRSTNAME, LASTNAME MAIN contains AUTHOR, EDITEDBY, APPROVEDBY My question is, how do I retrieve the three instances of FIRSTNAME an