starting from ArcGIS version 10.1 while upgrading your ArcSDE Geodatabase in Oracle, one of the pre-requisite required “sde” user privilege is direct execution to the Package DBMS_CRYPTO.
grant execute on SYS.DBMS_CRYPTO to sde;
according to esri documentation: http://resources.arcgis.com/en/help/main/10.1/index.html#//002n0000002v000000
This granting has a relation to st_geometry configuration:
1. Allows the creation of a map member function for the ST_Geometry type, which is called whenever a spatial union or intersection is performed.
2. Upgrade a map member function for the ST_Geometry type, which is called whenever a spatial union or intersection is performed.
the question is:has this privilege has any relation with data encryption ?
Most Probably ‘YES ‘ : according to Oracle Documentation “DBMS_CRYPTO provides an interface to encrypt and decrypt stored data, and can be used in conjunction with PL/SQL programs running network communications. It provides support for several industry-standard encryption and hashing algorithms, including the Advanced Encryption Standard (AES) encryption algorithm.”
So, if you enable data encryption at rest on your database management system, then sde will be able to decrypt data for your geodatabase system.
To fetch (extract) sql definition of an Oracle Database Operator or Indextype, this can be done through the DBMS_METADATApackage. Moreover, DBMS_METADATA provides a way for you to retrieve metadata from the database dictionary as XML or creation DDL and to submit the XML to re-create the object.
select dbms_metadata.get_ddl(‘OPERATOR’,’operatorname‘) from dual;
operatorname : substitute it with the actual name of the operator
This can be done also for indextype, you can extract the sql definition using the below query:
select dbms_metadata.get_ddl(‘INDEXTYPE’,’indextypename’) from dual;
This error indicates that for some reason there are missing operators in your ArcSDE geodatabase, you need to create them.
but, first you need to query the complete list of operators from another ArcSDE geodatabase that is intact and healthy, using the query: select * from user_operators;
compare the list of operators where the ArcSDE geodatabase that has the upgrade issue, and create the missing ones.
In order to extract the sql definition of the operator use the following query as an example:
select dbms_metadata.get_ddl(‘OPERATOR’,’ST_WITHIN’) from dual;
after creating all missing operators, try executing the previous sql query mentioned: “CREATE OR REPLACE INDEXTYPE “SDE”.”ST_SPATIAL_INDEX”
then use the following sql, to check indextype was created:
select * from user_indextypes;
ST_SPATIAL_INDEX indextype
Re-Run the Upgrade, and it will be successful.
Query Reference:
select * from user_operators;
select * from user_indextypes;
select dbms_metadata.get_ddl(‘INDEXTYPE’,’ST_SPATIAL_INDEX’) from dual;
select dbms_metadata.get_ddl(‘OPERATOR’,’ST_WITHIN’) from dual;
If this is not the case you are facing….but facing the same error then try the following:
SQL> GRANT EXECUTE ON sde.st_spatial_index TO SCHEMA_NAME;
OR
SQL> GRANT EXECUTE ON sde.st_spatial_index TO PUBLIC;
Sometimes you need to change the oracle profile by removing password verification function to let the user re-use the same password to maintain the application operations (although this is not a good practice).
Command used:
alter profile profilename limit password_verify_function null; where profilename: is the name of the profile in your database.
As a DBA you may face a problem with your database if TEMP tablespace gets full. Usually, TEMP table space is used for “sorting and aggregate operations“.
One of the reasons your TEMP tablspace get full and expanding, is that the application queries are not well optimized/tuned.
the following queries will eventually help you in diagnosis:
To Find SQL Statements that is causing TEMP SPACE TO BE FILLED: //——————————————————————–
o.sqladdr address, h.hash_value, h.sql_text from v$sort_usage o, v$session s, v$sqlarea h, dba_tablespaces t where o.session_addr = s.saddr and o.sqladdr = h.address (+) and o.tablespace = t.tablespace_name order by s.sid; / /——————————————————————— To Find Current TEMP SPACE SIZE:
select * from (select a.tablespace_name, sum(a.bytes/1024/1024) allocated_mb from dba_temp_files a where a.tablespace_name = upper(‘&&temp_tsname’) group by a.tablespace_name) x, (select sum(b.bytes_used/1024/1024) used_mb, sum(b.bytes_free/1024/1024) free_mb from v$temp_space_header b where b.tablespace_name=upper(‘&&temp_tsname’) group by b.tablespace_name);
in my previous post, i have provided a way to convert BLOB to CLOB.
There is another way to do the conversion, based on Oracle Metalink DocID: 9876
*** Let us assume that the table name is Z.EMPLOYEES . And, let us assume that the column name that has a ‘BLOB’ data type is BIN_EMP. and the Temp column with ‘CLOB’ data type has the name WTF.
1. take export backup (expdp) of the ORIGINAL table.
2. add new temp column:
alter table Z.EMPLOYEES add (WTF CLOB);
3. start initialization:
UPDATE Z.EMPLOYEES SET WTF = empty_clob() WHERE BIN_EMP IS NOT NULL;
4. create the procedure for conversion, the following procedure will perform the conversion:
create or replace procedure Z.blob_to_clob_PROC as a number; b number; c number := 1000; d number; offset number := 1; v_clob clob; amount binary_integer; buffer1 raw(1000); buffer2 varchar2(1000); cursor c1 is select BIN_EMP, rowid from Z.EMPLOYEES where BIN_EMP is not null; begin for i in c1 loop select WTF into v_clob from Z.EMPLOYEES where rowid = i.rowid for update; a := dbms_lob.getlength(i.BIN_EMP); b := ceil(a/c); for j in 1..b loop if (c*j <= a) then d:= c; else d:= a – c*(j-1); end if; DBMS_LOB.READ ( i.BIN_EMP, d, offset, buffer1); buffer2 := utl_raw.cast_to_varchar2(buffer1); DBMS_LOB.WRITEAPPEND(v_clob, d, buffer2); offset := offset + c; end loop; offset := 1; update Z.EMPLOYEES set WTF = v_clob where rowid=i.rowid; end loop; commit; end; /
5. execute the following statements:
EXECUTE Z.blob_to_clob_PROC; commit;
Remark: you can develop Unix Shell script for automating the execution of the procedure to be scheduled.
6. drop the original column with BLOB data type (BIN_EMP)
ESRI has stated that it will not do a full new version release, instead they will release “updates” such as ArcGIS 10.2.1 and 10.2.2
Regarding ArcSDE, both releases (ArcGIS 10.2.1 and 10.2.2) will be the last releases for ArcSDE as an application server (binaries), and ArcSDE Command Line.