在我們使用ArcSDE對向量資料和柵格資料進行儲存的時候,有必要將相關的表及索引分開儲存。也就是說當使用者訪問一張表,首先會訪問表的索引,然後根據索引來快速定位訪問表的內容,那麼表與表索引就會佔據大量的磁碟I/O資源,從而導致訪問表的效率下降。所以我們應該將表與索引分配在不同的資料表空間,將不同的資料表空間儲存到不同的磁碟上,這樣訪問表時,就可以使用不同的磁碟I/O,提高訪問效率
步驟一:建立儲存向量、柵格資料及對應的索引儲存資料表空間
create tablespace GISDATA datafile 'D:\GISDATA.dbf' size 1000m autoallocate;
create tablespace GISINDEX datafile 'D:\GISINDEX.dbf' size 1000m autoallocate;
create tablespace RASTERDATA datafile 'D:\RASTERDATA.dbf' size 1000m autoallocate;
create tablespace RASTERINDEX datafile 'D:\RASTERINDEX.dbf' size 1000m autoallocate;
步驟二:設定自增長
-- autoextend
declare
cursor v_file is
select file_id from dba_data_files where autoextensible = 'NO' ;
begin
for v_i in v_file loop
execute immediate 'alter database datafile ' || v_i.file_id ||
' autoextend on next 1024M maxsize unlimited';
end loop;
end;
步驟三:建立sde服務
sdeservice -o create -p sde -d "ORACLE,NJ" -n -i esri_sde -H "C:\Program Files\ArcGIS\ArcSDE\ora11gexe"(具體操作見本部落格專題介紹)
步驟四:修改dbtune.sde設定檔
該檔案位於sde安裝目錄下(預設為Program Files\ArcGIS\ArcSDE\ora11gexe\etc下,修改前注意備份原檔案)
新增下列參數配置
##DATABASEGIS
GEOMETRY_STORAGE "ST_GEOMETRY"
ATTRIBUTE_BINARY "BLOB"
RASTER_STORAGE "BLOB"
UI_TEXT "User Interface text description for DATABASEGIS keyword"
COMMENT "Any general comment for DATABASEGIS keyword"
S_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE GISDATA"
S_INDEX_ALL "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX"
B_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE GISDATA "
B_INDEX_ROWID "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX"
B_INDEX_USER "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
B_INDEX_RASTER "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE RASTERINDEX "
B_INDEX_SHAPE "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
B_INDEX_TO_DATE "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX"
B_INDEX_XML "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
A_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE GISDATA "
A_INDEX_ROWID "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
A_INDEX_SHAPE "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
A_INDEX_STATEID "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
A_INDEX_USER "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
A_INDEX_XML "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
D_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE GISDATA"
D_INDEX_STATE_ROWID "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
D_INDEX_DELETED_AT "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
RAS_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE RASTERDATA"
RAS_INDEX_ID "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE RASTERINDEX "
BND_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE RASTERDATA "
BND_INDEX_COMPOSITE "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE RASTERINDEX "
BND_INDEX_ID "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE RASTERINDEX"
AUX_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE RASTERDATA"
AUX_INDEX_COMPOSITE "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE RASTERINDEX "
BLK_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE RASTERDATA"
BLK_INDEX_COMPOSITE "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE RASTERINDEX "
XML_DOC_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE GISDATA"
XML_DOC_INDEX "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX"
XML_DOC_LOB_STORAGE "NOCACHE NOLOGGING CHUNK 4K PCTVERSION 5 DISABLE STORAGE IN ROW"
XML_DOC_MODE "COMPRESSED"
XML_DOC_UNCOMPRESSED_TYPE "CLOB"
XML_DOC_VAL_LOB_STORAGE "NOCACHE NOLOGGING CHUNK 4K PCTVERSION 5 DISABLE STORAGE IN ROW"
XML_IDX_STORAGE "PCTFREE 10 PCTUSED 40 INITRANS 4 TABLESPACE GISDATA"
XML_IDX_INDEX_DOUBLE "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
XML_IDX_INDEX_ID "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
XML_IDX_INDEX_PK "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX"
XML_IDX_INDEX_STRING "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
XML_IDX_INDEX_TAG "PCTFREE 10 INITRANS 4 NOLOGGING TABLESPACE GISINDEX "
XML_IDX_INDEX_TEXT ""
XML_IDX_TEXT_TAG_STORAGE ""
XML_IDX_TEXT_UPDATE_MEMORY ""
XML_IDX_TEXT_UPDATE_METHOD "NONE"
END
修改完成後儲存
步驟五:匯入修改好的dbtune.sde設定檔
Sdedbtune -o import -f D:\666.txt -i esri_sde -u sde -p sde -N
步驟六:匯入完成後,我們可以利用plsql查看匯入結果
select * from DBTUNE t
Arccatalog串連資料庫,將資料複製到資料庫時,會看到config.keyword的值預設為我們新增的DATABASEGIS值(這表示我們的資料將會根據類型分別儲存到這個值下的各個對應資料表空間,就是先前建好的四個資料表空間)
匯入完成後,可以通過plsql看這四個資料表空間資料是不是正常對應儲存。