【发布时间】:2019-09-14 12:08:29
【问题描述】:
我希望我的 Oracle 直接从 Internet 获取一个 xml 文件并将其插入到表中(在此线程中可以省略解析)。
示例:https://cve.mitre.org/data/downloads/allitems-cvrf-year-1999.xml
<Vulnerability
xmlns="http://www.icasi.org/CVRF/schema/vuln/1.1" Ordinal="1">
<Title>CVE-1999-0001</Title>
<Notes>
<Note Type="Description" Ordinal="1">ip_input.c in BSD-derived TCP/IP implementations allows remote attackers to cause a denial of service (crash or hang) via crafted packets.</Note>
<Note Type="Other" Title="Published" Ordinal="2">2000-02-04</Note>
<Note Type="Other" Title="Modified" Ordinal="3">2005-12-16</Note>
</Notes>
<CVE>CVE-1999-0001</CVE>
<References>
<Reference>
<URL/>
<Description>BUGTRAQ:19981223 Re: CERT Advisory CA-98.13 - TCP/IP Denial of Service</Description>
</Reference>
<Reference>
<URL/>
<Description>CERT:CA-98-13-tcp-denial-of-service</Description>
</Reference>
<Reference>
<URL>http://www.openbsd.org/errata23.html#tcpfix</URL>
<Description>CONFIRM:http://www.openbsd.org/errata23.html#tcpfix</Description>
</Reference>
<Reference>
<URL>http://www.osvdb.org/5707</URL>
<Description>OSVDB:5707</Description>
</Reference>
</References>
</Vulnerability> *REPEAT*
首先我创建一个表:
CREATE TABLE XML_TABLE
( ID NUMBER,
XML_DATA XMLTYPE
);
然后我想(如果可能)在表中为每个新漏洞(xml 中漏洞标记之间的所有内容)插入一个新行。
要获取数据,我可以使用以下命令(不确定它是否最适合此目的):
host curl https://cve.mitre.org/data/downloads/allitems-cvrf-year-1999.xml
问题是存储它。
【问题讨论】: