Scheduling Python arcpy script in windows task scheduler

The following steps illustrates how to schedule a python script in windows server task scheduler….this can also be applied to any other scripts if applicable:

 

1. create a new task

1

2.  under “General” tab setup the general task scheduler description & properties as shown below

2

 

3. under “triggers” tab schedule the specific time for the execution of the script

3

 

4.  under the “Actions” tab under the program/script section you should reference the python script.

under add arguments (option) you should reference the location of your arcgis desktop python libraries.

4

 

5.  under “conditions” tab

5

 

6. under “settings” tab:

6

 

ORA-00832: no streams pool created and cannot automatically create one / stream pool and expdp

if you face the following error while performing a datapump export operations:

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 – Produc
tion
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-31626: job does not exist
ORA-31637: cannot create job SYS_EXPORT_SCHEMA_01 for user SYSTEM
ORA-06512: at “SYS.DBMS_SYS_ERROR”, line 95
ORA-06512: at “SYS.KUPV$FT_INT”, line 672
ORA-39080: failed to create queues “KUPC$C_1_20140711224328” and “KUPC$S_1_20140
711224328″ for Data Pump job
ORA-06512: at “SYS.DBMS_SYS_ERROR”, line 95
ORA-06512: at “SYS.KUPC$QUE_INT”, line 1606
ORA-00832: no streams pool created and cannot automatically create one

Solution:

check the current sizing of your shared_pool_size, by using the following command:

SQL> show parameter shared_pool_size 

10% of the value of the shared pool size will be assigned to the streams pool (also, buffer cache size will be reduced) 

So, alter the value using the command:

SQL> alter system set streams_pool_size = (10%of shared pool size) scope = spfile;

and then try use expdp command again….

*********EXPLANATION*******

Oracle DataPump utility which is frequently used by many Database Administrators will in fact be using “Streams Pool”, this stream pool size will be assigned 10% of the size of the shared pool and will reduce the amount of the buffer cache.
To avoid reduction of other memory structures sizes (shared pool,buffer cache) you need to configure the streams_pool_size with proper value as Data Pump operations will use streams !!!

if, sga_target is equal to zero then SGA is not auto-tuned

SQL> show parameter sga_target

NAME TYPE VALUE
———————————— ———– —–
sga_target big integer 0

so, its better to set a value for the SGA to be automatically tuned.

 

 

Unable to create logfile system tables. User perhaps lacks permissions or resources to create tables

while performing an editing session in ArcMap, you may receive the following error message:

Unable to create logfile system tables. User perhaps lacks permissions or resources to create tables

 

solution:

Your ArcSDE Geodatabase is configured for a “standalone log file architecture”.

for more information:http://resources.arcgis.com/en/help/main/10.2/index.html#/Log_file_table_configuration_options_for_geodatabases_in_Oracle/002n00000014000000/

use the “sdeconfig” command to list the parameters or the server_config system table under your SDE schema.

The user will require the following permissions granted to him:

CREATE SESSION
CREATE TABLE
CREATE TRIGGER
CREATE SEQUENCE
CREATE PROCEDURE

 

cheers!

 

ora-04021 timeout occurred while waiting to lock object package

Problem Description:

 

While trying to re-create an Oracle Package, the execution took long time and finally the following error was thrown:

ora-04021 timeout occurred while waiting to lock object

 

Resolution:

 

This means that the package is being locked by another user.

 

To figure out the session that is locking the user, use the following queries:

 

select * from v$access where OWNER=’schema_account’ and OBJECT=’database_object_name’;

 

//take the ‘SID’ from the previous query and search for more details about the session with v$session

 

select * from v$session where SID=XX;

//where XX is the number found in the v$access query

 

These sessions can be killed using the command:

 

SQL> ALTER SYSTEM KILL SESSION ‘sid,serial#’;

 

Then try to re-create the package and boooooom……package re-created 😉

 

Cheers!

ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine ORA-20085: Insert Spatial Reference SRID 4326 does not match SDE.GDB_ITEMS.SHAPE registered Spatial Reference SRID 0 ORA-06512: in “SDE.ST_DOMAIN_METHODS”, line 2000

While trying to re-name a field in a layer in my ArcGIS 10.2 Enterprise Geodatabase hosted in Oracle Database, I faced the below error:

ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine 
ORA-20085: Insert Spatial Reference SRID 4326 does not match 
SDE.GDB_ITEMS.SHAPE registered Spatial Reference SRID 0 
ORA-06512: in “SDE.ST_DOMAIN_METHODS”, line 2000 
ORA-06512: in “SDE.ST_DOMAIN_METHODS”, line 2372

error bug message

This error is related to ESRI bug NIM099594

Resolution:

SQL> SELECT index_name FROM user_ind_columns WHERE table_name = ‘GDB_ITEMS’ and column_name = ‘SHAPE’;

The Previous query will list for you the index associated with GDB_ITEMS table.

 

sql query to find the index related to GDB_ITEMS table

 

Then use the “drop” command to drop the index

SQL> DROP INDEX A8709_IX1;

Index dropped

 

For More information about this bug, check the following link resources:

http://support.esri.com/en/knowledgebase/techarticles/detail/42335

http://support.esri.com/en/bugs/nimbus/TklNMDk5NTk0

 

ORA-04063: package body “SYS.DBMS_DATAPUMP” has errors ORA-06508: PL/SQL: could not find program unit being called: “SYS.DBMS_DATAPUMP” ORA-06512: at line 6

if you face an error like the following:

ORA-04063: package body “SYS.DBMS_DATAPUMP” has errors
ORA-06508: PL/SQL: could not find program unit being called: “SYS.DBMS_DATAPUMP”
ORA-06512: at line 6

Solution:

SQL> select comp_id, comp_name, version, status from dba_registry;
 
if, there are invalid components then use utilrp to recompile all objects within your database:
 
SQL> @?/rdbms/admin/utlrp.sql
 
 
//——— another way is to manually check what is the problem:
 
SQL> alter package SYS.DBMS_DATAPUMP compile body;
 
SQL> show errors
 
** if the previous command doesn’t list the errors you can use the following query:
 
SQL> select * from dba_errors where OWNER=’SYS’ and NAME=’DBMS_DATAPUMP’;

 

Hope this helps……

Cheers !

Underlying DBMS error[ORA-29902: error in executing ODCIIndexStart() routine ORA-01031: insufficient privileges ORA-06512: at “SDE.SPX_UTIL”,line 847 ORA-06512: at “SDE.SPX_UTIL”,line 891

after converting my Geo-Database from Long Raw (SDEBINARY) to st_geometry, i found out that i can only see the feautre classes (layers) through schema accounts ONLY in ArcCatalog !!!

when i try to view the data with “application-user” accounts, i face the below error:

Underlying DBMS error[ORA-29902: error in executing ODCIIndexStart() routine
ORA-01031: insufficient privileges
ORA-06512: at “SDE.SPX_UTIL”,line 847
ORA-06512: at “SDE.SPX_UTIL”,line 891
ORA-06512: at “SDE.ST_DOMAIN_METHODS”, line 105

Image

**** Solution:

 

since we follow strict security implimentation on the Oracle Databases, we have revoked many ‘PUBLIC’ role permissions in ArcSDE Geodatabase Systems, and it seems these permissions are required.

so you need to make sure that the following permissions listed are “granted“:

grant UPDATE on sde.ALL_ST_GEOMETRY_COLUMNS_V to  app_user;                       
grant SELECT on sde.ALL_ST_GEOMETRY_COLUMNS_V to  app_user;                       
grant INSERT on sde.ALL_ST_GEOMETRY_COLUMNS_V to  app_user;                       
grant DELETE on sde.ALL_ST_GEOMETRY_COLUMNS_V to  app_user;                       
grant EXECUTE on sde.ARCHIVE_UTIL to  app_user;                                   
grant EXECUTE on sde.BLOB_ARRAY_TAB to  app_user;                                 
grant EXECUTE on sde.BND_ROWID_TAB to  app_user;                                  
grant SELECT on sde.COLUMN_REGISTRY to  app_user;                                 
grant SELECT on sde.CONNECTION_ID_GENERATOR to  app_user;                         
grant SELECT on sde.DBTUNE to  app_user;                                          
grant EXECUTE on sde.DBTUNE_UTIL to  app_user;                                    
grant EXECUTE on sde.FLT_ARRAY_TAB to  app_user;                                  
grant INSERT on sde.GDB_ITEMRELATIONSHIPS to  app_user;                           
grant SELECT on sde.GDB_ITEMRELATIONSHIPS to  app_user;                           
grant UPDATE on sde.GDB_ITEMRELATIONSHIPS to  app_user;                           
grant DELETE on sde.GDB_ITEMRELATIONSHIPS to  app_user;                           
grant INSERT on sde.GDB_ITEMRELATIONSHIPS_VW to  app_user;                        
grant SELECT on sde.GDB_ITEMRELATIONSHIPS_VW to  app_user;                        
grant UPDATE on sde.GDB_ITEMRELATIONSHIPS_VW to  app_user;                        
grant DELETE on sde.GDB_ITEMRELATIONSHIPS_VW to  app_user;                        
grant UPDATE on sde.GDB_ITEMRELATIONSHIPTYPES to  app_user;                       
grant SELECT on sde.GDB_ITEMRELATIONSHIPTYPES to  app_user;                       
grant INSERT on sde.GDB_ITEMRELATIONSHIPTYPES to  app_user;                       
grant DELETE on sde.GDB_ITEMRELATIONSHIPTYPES to  app_user;                       
grant UPDATE on sde.GDB_ITEMS to  app_user;                                       
grant SELECT on sde.GDB_ITEMS to  app_user;                                       
grant INSERT on sde.GDB_ITEMS to  app_user;                                       
grant DELETE on sde.GDB_ITEMS to  app_user;                                       
grant UPDATE on sde.GDB_ITEMS_VW to  app_user;                                    
grant DELETE on sde.GDB_ITEMS_VW to  app_user;                                    
grant INSERT on sde.GDB_ITEMS_VW to  app_user;                                    
grant SELECT on sde.GDB_ITEMS_VW to  app_user;                                    
grant SELECT on sde.GDB_ITEMTYPES to  app_user;                                   
grant UPDATE on sde.GDB_ITEMTYPES to  app_user;                                   
grant INSERT on sde.GDB_ITEMTYPES to  app_user;                                   
grant DELETE on sde.GDB_ITEMTYPES to  app_user;                                   
grant SELECT on sde.GDB_REPLICALOG to  app_user;                                  
grant UPDATE on sde.GDB_REPLICALOG to  app_user;                                  
grant INSERT on sde.GDB_REPLICALOG to  app_user;                                  
grant DELETE on sde.GDB_REPLICALOG to  app_user;                                  
grant UPDATE on sde.GDB_TABLES_LAST_MODIFIED to  app_user;                        
grant SELECT on sde.GDB_TABLES_LAST_MODIFIED to  app_user;                        
grant DELETE on sde.GDB_TABLES_LAST_MODIFIED to  app_user;                        
grant INSERT on sde.GDB_TABLES_LAST_MODIFIED to  app_user;                        
grant EXECUTE on sde.GDB_UTIL to  app_user;                                       
grant SELECT on sde.GEOMETRY_COLUMNS to  app_user;                                
grant UPDATE on sde.INSTANCES to  app_user;                                       
grant SELECT on sde.INSTANCES to  app_user;                                       
grant INSERT on sde.INSTANCES to  app_user;                                       
grant DELETE on sde.INSTANCES to  app_user;                                       
grant EXECUTE on sde.INSTANCES_UTIL to  app_user;                                 
grant SELECT on sde.INSTANCE_ID_GENERATOR to  app_user;                           
grant EXECUTE on sde.INT_ARRAY_TAB to  app_user;                                  
grant EXECUTE on sde.KEYSET_UTIL to  app_user;                                    
grant SELECT on sde.LAYERS to  app_user;                                          
grant EXECUTE on sde.LAYERS_UTIL to  app_user;                                    
grant SELECT on sde.LAYER_ID_GENERATOR to  app_user;                              
grant SELECT on sde.LAYER_LOCKS to  app_user;                                     
grant EXECUTE on sde.LAYER_STATS_UTIL to  app_user;                               
grant SELECT on sde.LINEAGES_MODIFIED to  app_user;                               
grant SELECT on sde.LOCATORS to  app_user;                                        
grant SELECT on sde.LOCATOR_ID_GENERATOR to  app_user;                            
grant EXECUTE on sde.LOCATOR_UTIL to  app_user;                                   
grant EXECUTE on sde.LOCK_UTIL to  app_user;                                      
grant EXECUTE on sde.LOGFILE_UTIL to  app_user;                                   
grant SELECT on sde.METADATA to  app_user;                                        
grant SELECT on sde.METADATA_ID_GENERATOR to  app_user;                           
grant EXECUTE on sde.METADATA_UTIL to  app_user;                                  
grant SELECT on sde.MVTABLES_MODIFIED to  app_user;                               
grant SELECT on sde.OBJECT_LOCKS to  app_user;                                    
grant EXECUTE on sde.PINFO_UTIL to  app_user;                                     
grant SELECT on sde.PROCESS_INFORMATION to  app_user;                             
grant SELECT on sde.R2 to  app_user;                                              
grant SELECT on sde.R3 to  app_user;                                              
grant SELECT on sde.R4 to  app_user;                                              
grant SELECT on sde.R5 to  app_user;                                              
grant SELECT on sde.R6 to  app_user;                                              
grant EXECUTE on sde.RASTERCOLUMNS_UTIL to  app_user;                             
grant SELECT on sde.RASTERCOLUMN_ID_GENERATOR to  app_user;                       
grant SELECT on sde.RASTER_COLUMNS to  app_user;                                  
grant EXECUTE on sde.REGISTRY_UTIL to  app_user;                                  
grant EXECUTE on sde.SDENUMTAB to  app_user;                                      
grant EXECUTE on sde.SDEXMLTOTEXT to  app_user;                                   
grant SELECT on sde.SDE_ARCHIVES to  app_user;                                    
grant SELECT on sde.SDE_LAYER_STATS to  app_user;                                 
grant SELECT on sde.SDE_LOGFILE_POOL to  app_user;                                
grant UPDATE on sde.SDE_TABLES_MODIFIED to  app_user;                             
grant SELECT on sde.SDE_TABLES_MODIFIED to  app_user;                             
grant EXECUTE on sde.SDE_UTIL to  app_user;                                       
grant SELECT on sde.SDE_XML_COLUMNS to  app_user;                                 
grant UPDATE on sde.SDE_XML_DOC1 to  app_user;                                    
grant SELECT on sde.SDE_XML_DOC1 to  app_user;                                    
grant DELETE on sde.SDE_XML_DOC1 to  app_user;                                    
grant INSERT on sde.SDE_XML_DOC1 to  app_user;                                    
grant UPDATE on sde.SDE_XML_DOC2 to  app_user;                                    
grant SELECT on sde.SDE_XML_DOC2 to  app_user;                                    
grant INSERT on sde.SDE_XML_DOC2 to  app_user;                                    
grant DELETE on sde.SDE_XML_DOC2 to  app_user;                                    
grant UPDATE on sde.SDE_XML_DOC3 to  app_user;                                    
grant INSERT on sde.SDE_XML_DOC3 to  app_user;                                    
grant SELECT on sde.SDE_XML_DOC3 to  app_user;                                    
grant DELETE on sde.SDE_XML_DOC3 to  app_user;                                    
grant SELECT on sde.SDE_XML_DOC4 to  app_user;                                    
grant UPDATE on sde.SDE_XML_DOC4 to  app_user;                                    
grant INSERT on sde.SDE_XML_DOC4 to  app_user;                                    
grant DELETE on sde.SDE_XML_DOC4 to  app_user;                                    
grant SELECT on sde.SDE_XML_INDEXES to  app_user;                                 
grant SELECT on sde.SDE_XML_INDEX_TAGS to  app_user;                              
grant EXECUTE on sde.SDO_UTIL to  app_user;                                       
grant SELECT on sde.SERVER_CONFIG to  app_user;                                   
grant SELECT on sde.SPATIAL_REFERENCES to  app_user;                              
grant EXECUTE on sde.SPX_UTIL to  app_user;                                       
grant EXECUTE on sde.SP_GRID_INFO to  app_user;                                   
grant EXECUTE on sde.SREF_UTIL to  app_user;                                      
grant SELECT on sde.STATES to  app_user;                                          
grant SELECT on sde.STATE_LINEAGES to  app_user;                                  
grant SELECT on sde.STATE_LOCKS to  app_user;                                     
grant EXECUTE on sde.ST_AGGR_CONVEXHULL to  app_user;                             
grant EXECUTE on sde.ST_AGGR_INTERSECTION to  app_user;                           
grant EXECUTE on sde.ST_AGGR_UNION to  app_user;                                  
grant EXECUTE on sde.ST_AREA to  app_user;                                        
grant EXECUTE on sde.ST_ASBINARY to  app_user;                                    
grant EXECUTE on sde.ST_ASTEXT to  app_user;                                      
grant EXECUTE on sde.ST_BOUNDARY to  app_user;                                    
grant EXECUTE on sde.ST_BUFFER to  app_user;                                      
grant EXECUTE on sde.ST_BUFFER_INTERSECTS to  app_user;                           
grant EXECUTE on sde.ST_CENTROID to  app_user;                                    
grant EXECUTE on sde.ST_CONTAINS to  app_user;                                    
grant EXECUTE on sde.ST_CONVEXHULL to  app_user;                                  
grant EXECUTE on sde.ST_COORDDIM to  app_user;                                    
grant SELECT on sde.ST_COORDINATE_SYSTEMS to  app_user;                           
grant EXECUTE on sde.ST_CREF_UTIL to  app_user;                                   
grant EXECUTE on sde.ST_CROSSES to  app_user;                                     
grant EXECUTE on sde.ST_CURVE to  app_user;                                       
grant EXECUTE on sde.ST_DIFFERENCE to  app_user;                                  
grant EXECUTE on sde.ST_DIMENSION to  app_user;                                   
grant EXECUTE on sde.ST_DISJOINT to  app_user;                                    
grant EXECUTE on sde.ST_DISTANCE to  app_user;                                    
grant EXECUTE on sde.ST_DOMAIN_METHODS to  app_user;                              
grant EXECUTE on sde.ST_DOMAIN_OPERATORS to  app_user;                            
grant EXECUTE on sde.ST_DOMAIN_STATS to  app_user;                                
grant EXECUTE on sde.ST_ENDPOINT to  app_user;                                    
grant EXECUTE on sde.ST_ENTITY to  app_user;                                      
grant EXECUTE on sde.ST_ENVELOPE to  app_user;                                    
grant EXECUTE on sde.ST_ENVINTERSECTS to  app_user;                               
grant EXECUTE on sde.ST_EQUALS to  app_user;                                      
grant EXECUTE on sde.ST_EXTERIORRING to  app_user;                                
grant DEBUG on sde.ST_FUNCS_ARRAY to  app_user;                                   
grant EXECUTE on sde.ST_FUNCS_ARRAY to  app_user;                                 
grant EXECUTE on sde.ST_GEOMCOLLECTION to  app_user;                              
grant EXECUTE on sde.ST_GEOMETRY to  app_user;                                    
grant EXECUTE on sde.ST_GEOMETRYN to  app_user;                                   
grant EXECUTE on sde.ST_GEOMETRYTYPE to  app_user;                                
grant SELECT on sde.ST_GEOMETRY_COLUMNS to  app_user;                             
grant UPDATE on sde.ST_GEOMETRY_INDEX to  app_user;                               
grant SELECT on sde.ST_GEOMETRY_INDEX to  app_user;                               
grant INSERT on sde.ST_GEOMETRY_INDEX to  app_user;                               
grant DELETE on sde.ST_GEOMETRY_INDEX to  app_user;                               
grant EXECUTE on sde.ST_GEOMETRY_OPERATORS to  app_user;                          
grant EXECUTE on sde.ST_GEOMETRY_SHAPELIB_PKG to  app_user;                       
grant EXECUTE on sde.ST_GEOM fromTEXT to  app_user;                                
grant EXECUTE on sde.ST_GEOM fromWKB to  app_user;                                 
grant EXECUTE on sde.ST_GEOM_COLS_UTIL to  app_user;                              
grant EXECUTE on sde.ST_GEOM_UTIL to  app_user;                                   
grant EXECUTE on sde.ST_INTERIORRINGN to  app_user;                               
grant EXECUTE on sde.ST_INTERSECTION to  app_user;                                
grant EXECUTE on sde.ST_INTERSECTS to  app_user;                                  
grant EXECUTE on sde.ST_IS3D to  app_user;                                        
grant EXECUTE on sde.ST_ISCLOSED to  app_user;                                    
grant EXECUTE on sde.ST_ISEMPTY to  app_user;                                     
grant EXECUTE on sde.ST_ISMEASURED to  app_user;                                  
grant EXECUTE on sde.ST_ISRING to  app_user;                                      
grant EXECUTE on sde.ST_ISSIMPLE to  app_user;                                    
grant EXECUTE on sde.ST_LENGTH to  app_user;                                      
grant EXECUTE on sde.ST_LINE fromTEXT to  app_user;                                
grant EXECUTE on sde.ST_LINE fromWKB to  app_user;                                 
grant EXECUTE on sde.ST_LINESTRING to  app_user;                                  
grant EXECUTE on sde.ST_M to  app_user;                                           
grant EXECUTE on sde.ST_MAXM to  app_user;                                        
grant EXECUTE on sde.ST_MAXX to  app_user;                                        
grant EXECUTE on sde.ST_MAXY to  app_user;                                        
grant EXECUTE on sde.ST_MAXZ to  app_user;                                        
grant EXECUTE on sde.ST_MINM to  app_user;                                        
grant EXECUTE on sde.ST_MINX to  app_user;                                        
grant EXECUTE on sde.ST_MINY to  app_user;                                        
grant EXECUTE on sde.ST_MINZ to  app_user;                                        
grant EXECUTE on sde.ST_MLINE fromTEXT to  app_user;                               
grant EXECUTE on sde.ST_MLINE fromWKB to  app_user;                                
grant EXECUTE on sde.ST_MPOINT fromTEXT to  app_user;                              
grant EXECUTE on sde.ST_MPOINT fromWKB to  app_user;                               
grant EXECUTE on sde.ST_MPOLY fromTEXT to  app_user;                               
grant EXECUTE on sde.ST_MPOLY fromWKB to  app_user;                                
grant EXECUTE on sde.ST_MULTICURVE to  app_user;                                  
grant EXECUTE on sde.ST_MULTILINESTRING to  app_user;                             
grant EXECUTE on sde.ST_MULTIPOINT to  app_user;                                  
grant EXECUTE on sde.ST_MULTIPOLYGON to  app_user;                                
grant EXECUTE on sde.ST_MULTISURFACE to  app_user;                                
grant EXECUTE on sde.ST_NUMGEOMETRIES to  app_user;                               
grant EXECUTE on sde.ST_NUMINTERIORRING to  app_user;                             
grant EXECUTE on sde.ST_NUMPOINTS to  app_user;                                   
grant EXECUTE on sde.ST_ORDERINGEQUALS to  app_user;                              
grant EXECUTE on sde.ST_OVERLAPS to  app_user;                                    
grant UPDATE on sde.ST_PARTITION_INDEX to  app_user;                              
grant SELECT on sde.ST_PARTITION_INDEX to  app_user;                              
grant DELETE on sde.ST_PARTITION_INDEX to  app_user;                              
grant INSERT on sde.ST_PARTITION_INDEX to  app_user;                              
grant EXECUTE on sde.ST_POINT to  app_user;                                       
grant EXECUTE on sde.ST_POINT fromTEXT to  app_user;                               
grant EXECUTE on sde.ST_POINT fromWKB to  app_user;                                
grant EXECUTE on sde.ST_POINTN to  app_user;                                      
grant EXECUTE on sde.ST_POINTONSURFACE to  app_user;                              
grant EXECUTE on sde.ST_POLY fromTEXT to  app_user;                                
grant EXECUTE on sde.ST_POLY fromWKB to  app_user;                                 
grant EXECUTE on sde.ST_POLYGON to  app_user;                                     
grant EXECUTE on sde.ST_RELATE to  app_user;                                      
grant EXECUTE on sde.ST_RELATION_OPERATORS to  app_user;                          
grant EXECUTE on sde.ST_SPATIAL_INDEX to  app_user;                               
grant SELECT on sde.ST_SPATIAL_REFERENCES to  app_user;                           
grant EXECUTE on sde.ST_SPREF_UTIL to  app_user;                                  
grant EXECUTE on sde.ST_SRID to  app_user;                                        
grant EXECUTE on sde.ST_STARTPOINT to  app_user;                                  
grant EXECUTE on sde.ST_SURFACE to  app_user;                                     
grant EXECUTE on sde.ST_SYMMETRICDIFF to  app_user;                               
grant EXECUTE on sde.ST_TOUCHES to  app_user;                                     
grant EXECUTE on sde.ST_TRANSFORM to  app_user;                                   
grant EXECUTE on sde.ST_TYPE_EXPORT to  app_user;                                 
grant EXECUTE on sde.ST_TYPE_USER to  app_user;                                   
grant EXECUTE on sde.ST_TYPE_UTIL to  app_user;                                   
grant EXECUTE on sde.ST_UNION to  app_user;                                       
grant EXECUTE on sde.ST_VERIFY to  app_user;                                      
grant EXECUTE on sde.ST_WITHIN to  app_user;                                      
grant EXECUTE on sde.ST_X to  app_user;                                           
grant EXECUTE on sde.ST_Y to  app_user;                                           
grant EXECUTE on sde.ST_Z to  app_user;                                           
grant EXECUTE on sde.SVR_CONFIG_UTIL to  app_user;                                
grant SELECT on sde.TABLE_ID_GENERATOR to  app_user;                              
grant SELECT on sde.TABLE_LOCKS to  app_user;                                     
grant SELECT on sde.TABLE_REGISTRY to  app_user;                                  
grant UPDATE on sde.USER_ST_GEOMETRY_COLUMNS_V to  app_user;                      
grant SELECT on sde.USER_ST_GEOMETRY_COLUMNS_V to  app_user;                      
grant INSERT on sde.USER_ST_GEOMETRY_COLUMNS_V to  app_user;                      
grant DELETE on sde.USER_ST_GEOMETRY_COLUMNS_V to  app_user;                      
grant UPDATE on sde.USER_ST_GEOM_INDEX_V to  app_user;                            
grant SELECT on sde.USER_ST_GEOM_INDEX_V to  app_user;                            
grant INSERT on sde.USER_ST_GEOM_INDEX_V to  app_user;                            
grant DELETE on sde.USER_ST_GEOM_INDEX_V to  app_user;                            
grant SELECT on sde.VERSION to  app_user;                                         
grant SELECT on sde.VERSIONS to  app_user;                                        
grant SELECT on sde.VERSION_ID_GENERATOR to  app_user;                            
grant EXECUTE on sde.VERSION_USER_DDL to  app_user;                               
grant EXECUTE on sde.VERSION_UTIL to  app_user;                                   
grant SELECT on sde.XML_COLUMN_ID_GENERATOR to  app_user;                         
grant SELECT on sde.XML_DOC1_ID_GENERATOR to  app_user;                           
grant SELECT on sde.XML_DOC2_ID_GENERATOR to  app_user;                           
grant SELECT on sde.XML_DOC3_ID_GENERATOR to  app_user;                           
grant SELECT on sde.XML_DOC4_ID_GENERATOR to  app_user;                           
grant SELECT on sde.XML_INDEX_ID_GENERATOR to  app_user;                          
grant SELECT on sde.XML_TAG_ID_GENERATOR to  app_user;                            
grant EXECUTE on sde.XML_UTIL to  app_user;                                       

Oracle 12c In-Memory

On June 10 2014 Larry Ellison CEO of Oracle Announced the the new 12c “in-memory” feature.

The following is highlights summary:

  • The 12c feature will be available for the public in July 2014.
  • 12c In-Memory can be installed and will be transparent to application (no changes required).

  • One of the primary goals for Oracle with in-memory database is to increase the performance for both Queries and Transactions.

  • Both Row and Column formats are used in 12c Database (Column is for Analytics).

  • Indexes being removed will speed up OLTP while using mixed column formats in 12c in-memory.

  • In-memory option can be used in EXADATA with Real-Application Clusters (multiple nodes).

  • Only “Active data” are being resided in memory (hosted on Flash or DRAM) and cold data will be residing on Disk. This approach is better in efficiency and economic (since most data will be residing on low cost disks).

  • High Availability:Backup/Recoverability/Manageability remains the same no changes is required.

 

  • Fault Tolerance:

    *Similar to storage mirroring

         * Duplicate in-memory columns on another node, this will lead to downtime elimination bys using the other  duplicate after failure.

Youtube Link:

http://www.youtube.com/watch?v=dZO1CD8VgY0

Oracle in-Memory Vs. SAP HANA:

http://www.oracle.com/technetwork/database/options/dbim-vs-sap-hana-2215625.pdf?ssSourceSiteId=ocomen

Image

This feature looks promising 😉

Converting Long Raw to BLOB in Oracle

Per Oracle Documentation “Oracle strongly recommends that you convert LONGRAW columns to binary LOB (BLOB) columns. LOB columns are subject to far fewer restrictions than LONG columns “Reference: http://docs.oracle.com/cd/E16655_01/server.121/e17209/sql_elements001.htm#SQLRF50993

So if you have a legacy database that has data stored in LONG RAW you need to move it to BLOB or any other format still supported by Oracle.

In this document I am exploring the conversion from LONG RAW to BLOB and the different techniques for doing it.

To Find all schema’s that have tables with “LONG RAW” column, use the following query:

select * from DBA_TAB_COLUMNS where DATA_TYPE=’LONG RAW’;

selectdistinct(OWNER)from DBA_TAB_COLUMNS where DATA_TYPE=’LONG RAW’;

 

For illustration, let us first create a simple table with LONG RAW column it.

In this example, assume the schema name is “AIS” and the table name is “t1”.

 

CREATETABLE AIS.t1(idNUMBER, doc LONGRAW);

 

//after creation of the empty table you need to insert records

 

INSERTINTO AIS.t1 VALUES(1, utl_raw.cast_to_raw(‘Test to go into LONG RAW column’));

 

INSERTINTO AIS.t1 VALUES(1, utl_raw.cast_to_raw(‘Hello Dear’));

 

INSERTINTO AIS.t1 VALUES(1, utl_raw.cast_to_raw(‘Hello Dear2’));

 

INSERTINTO AIS.t1 VALUES(1, utl_raw.cast_to_raw(‘Hello Ya M3alem’));

 

Methodology I :  ALTER STATEMENT

This is before conversion:

 

Image

After executing the sql command:

ALTERTABLE AIS.t1 MODIFY( doc BLOB);

Image

Methodology II: TO_LOB Operator

 

Since the table with LONG RAW column exists, you need to create another table with the “blob” column data type, and insert the records from the original table.

CREATETABLE AIS.t2 (idNUMBER, doc2 BLOB);

INSERTINTO AISDBA.t2 SELECTid,TO_LOB(doc)FROM AISDBA.t1;

The Records were inserted to the second table successfully!!

Image

After performing the insertion you need to “COMMIT” your transaction.

Then, you need to create a public synonym for the new table so applications can refrence this new table with the “BLOB” data type.

CREATE SYNONYM t2 FOR t1;

Methodology III: Data Pump

 

You can export the tables where there it has “LONG RAW” then drop the original ones in the database and re-create them with “BLOB” column data type. And then, try to re-import using impdp command.

 

 

 

reset sequence value

to reset your current sequence to value 1 follow the following steps:

we will assume the sequence name is SQ_CURR

1. Search for the current sequence value via the command:

SQL> select SQ_CURR.currval from dual;  

 2. Then change the sequence by adding the negative value of your previous result but subtract and addition one so for example if the value was 133389 you will increment it by -133388

SQL>  ALTER SEQUENCE SQ_CURR  INCREMENT by -133388; 

 

3. Then run the command that will reset the sequence:

SQL> SQ_CURR.NEXTVAL SELECT FROM DUAL; 

 

4. To restore the increment of the sequence:

SQL> ALTER SEQUENCE SQ_CURR  INCREMENT by 1;

 

hope this helps ….cheers!

😉