I have received an Oracle Spatial dump (.dmp) from an external source, but lack access to an Oracle Spatial DB. Is there an open-source way to extract the data? ogr2ogr seems to work with a running db only.
Oracle Spatial – How to Perform Spatial Dump Transformation
oracle-spatial
Related Solutions
I was having the same (or similar) issue with simply reading from a database. I noticed as well that a non-spatial table was being added to the SDO_GEOM_METADATA table. To resolve it, I removed the table name from the OCI connection string. Since I had the two tables (joining a non-spatial to the spatial for the query) in the SQL, it still worked and I no longer had the trigger going off. I should note I'm running from the C++ GDAL interface.
To connect to the schema tables, the connection can last 5-8 minutes.
Do you mean that this is the elapsed time between the moment you open a table and the moment you see the result on your screen as a map ? And does that include a view of all the 3600 polygons in that table ? Or does your view contain multiple tables ?
Obviously fetching many geometries from a database will take time, but it should not be that long. For example, fetching some 3200 fairly complex polygons is less than a second (say 800ms) on my database. This is not using QGIS - just a simple fetch. But the cost for reading from the database, passing to the client over the network and decoding the objects is the same irrespective of the client.
So there is definitely something wrong in your case.
Can you try accessing the tables using sqlplus ? Just do the following:
SQL> set autotrace traceonly statistics
SQL> set timing on
SQL> select * from <my_table>;
The first command tells sqlplus to not print out the results (that would be very long). Your DBA will need to grant you some additional privileges in order to to this.
The second command tells sqlplus to show you how long it took to execute the statement.
The third one reads the full content from that table. For example:
SQL> set autotrace traceonly statistics
SQL> set timing on
SQL> select * from us_counties;
3230 rows selected.
Elapsed: 00:00:00.75
Statistics
----------------------------------------------------------
13 recursive calls
0 db block gets
1298 consistent gets
560 physical reads
0 redo size
4219623 bytes sent via SQL*Net to client
3930 bytes received via SQL*Net from client
224 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
3230 rows processed
If this is also very slow, then the issue is probably around your connection to the server and you need to ask your DBA to solve this.
One thing that makes reading geometries expensive is their complexity, i.e. the number of vertices: the flattening of those vertices into messages, the transfer, the decoding of the shapes will all take time, and so will the time it takes QGIS to render them. But I would not expect timings of the order of magnitude you mention.
Best Answer
The only way to read an Oracle dump file is a fully functional Oracle installation.
Note that there are two different types of dump files:
exp
tool. This needs to be imported using theimp
tool.expdp
(aka "Data Pump") tool. This is imported using theimpdp
tool.Nothing distinguishes one from the other externally, but you can find out by looking at the strings at the start of the file:
Here is how an "old-style" dmp file looks like:
Here is how a normal "expdp" dump file looks like:
Each import command (
imp
orimpdp
) also has options for showing the content of the file in terms of schemas, tables, indexes etc it contains.Use
imp help=y
orimpdp help=y
to find out about the command syntax and options.