链接oracle spatial,oracle spatial初试
一、下載shp2sdo 工具,將工具放在 oracle按照目錄下的bin目錄下
oracle的bin目錄一般為:D:\app\***\product\11.2.0\dbhome_2\BIN
或者:在開始菜單中的oracle-OraDb11g_home1 >配置和移植工具>Database Configuration Assistance 右鍵屬性,打開文件位置 即可看到BIN目錄
二、
(1)cmd 到 shp文件目錄下,運行命令
D:\oraclespatial\shp2sdo\shp>shp2sdo.exe
shp2sdo - Shapefile(r) To Oracle Spatial Converter
Version 2.15 21-May-2004
Copyright 1997,2004 Oracle Corporation
For use with Oracle Spatial.
(2)輸入shp文件名,會生成sql,ctl,dat文件:
Input shapefile (no extension): wzs
Shape file wzs.shp contains 1 polygons
Output table [wzs]:
Output data model [O]:
Geometry column [GEOM]:
ID column []:
Use a spatial reference system ID (SRID) ? [N]:
Change tolerance value from the default (0.00000005) ? [N]:
Generate data inside control files ? [N]:
Target database Oracle8i? [N]:
Spatial Data requires more than 6 digits precision? [N]:
Bounds: X=[322971.488900,365999.591200] Y=[2061134.731500,2106240.455700]
Override ? [N]:
Processing shapefile wzs into spatial table WZS
Data model is object-relational
Geometry column is GEOM
Points stored in SDO_POINT attributes
Data is in a separate file(s)
Control file generation for Oracle9i or higher
Spatial data loaded with 6 digits of precision
Conversion complete : 1 polygons processed
The following files have been created:
wzs.sql : ? ? SQL script to create the table
wzs.ctl : ? ? Control file for loading the table
wzs.dat : ? ? Data file
(3)登錄數(shù)據(jù)庫
D:\oraclespatial\shp2sdo\shp>sqlplus XX/**@SID
SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 30 09:21:19 2019
Copyright (c) 1982, 2010, Oracle. ?All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Productio
With the Partitioning, OLAP, Data Mining and Real Application Testing optio
(4)讀取sql文件
SQL> @wzs.sql
DROP TABLE WZS
*
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
1 row deleted.
1 row created.
Commit complete.
(5)完成后退出
SQL>exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optio
(6)上載數(shù)據(jù):
D:\oraclespatial\shp2sdo\shp>sqlldr xx/**@sid
SQL*Loader: Release 11.2.0.1.0 - Production on 星期二 4月 30 09:22:36 2019
Copyright (c) 1982, 2009, Oracle and/or its affiliates. ?All rights reserve
達(dá)到提交點 - 邏輯記錄計數(shù) 1
(7)創(chuàng)建索引:
SQL> create index IDX_WZS on wzs(geom) indextype is mdsys.spatial_index;
Index created.
總結(jié)
以上是生活随笔為你收集整理的链接oracle spatial,oracle spatial初试的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle面临的挑战,Oracle
- 下一篇: oracle 11g 1033,ORAC