ora-28031 maximum of 148 enabled roles exceeded

if you face an error like this:

Image

 

Description of the Problem: 

When a new session is initiated Oracle will attempt to enable all the default roles of the account if their number will be less than ( (value of the MAX_ENABLED_ROLES parameter) – 2 ). The default value of MAX_ENABLED_ROLES is 150. If the account is granted (directly or recursively) more than 148 roles then the session creation will fail with ORA-28031.

SQL> show parameter max_enabled_roles 

NAME                                 TYPE        VALUE

———————————— ———– ——————————

max_enabled_roles                    integer     150

Image

To Resolve this error:

You need to remove the role from the user as a “default” one.

So, the only way is to revoke then re-grant the role again without the “default option”. 

REVOKE RL_SELECT_EMP FROM EMPLOYEE;

GRANT RL_ SELECT_EMP TO EMPLOYEE;

 

 

ora-13282 failure on initialization of coordinate transformation

before going to the solution part, execute the following verification queries to make sure your Oracle spatial component is valid:

select comp_name,version_status from dba_registry;

select * from dba_objects where status <> ‘VALID’ and owner=’MDSYS’;

============================================================================

Solution Steps:

you need to Correct the WKT strings as follows:

1. Connect as SYSTEM, SYS or MDSYS

2. execute the command:
alter session set nls_numeric_characters = ‘.,’;

3. Regenerate the WKTs for all EPSG coordinate systems using the following command:
execute sdo_cs.update_wkts_for_all_epsg_crs;

4. Now, try to execute the following query:
select SDO_CS.TRANSFORM(SDO_GEOMETRY(2001,41015,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1,3,1,0),MDSYS.SDO_ORDINATE_ARRAY(813483.176346326,83853.5516374355,1,1.42608769437217E-8)),27572) from dual;

if it executes successfully then…..your problem has been resolved 🙂

 

Remark: please note that i didn’t face this error (ora-13282) with Oracle  version 11.2.0.3

ORA-28575: unable to open RPC connection to external procedure

i have faced the following error while configuring the external procedure for st_gemoetry in oracle database.

ORA-28575: unable to open RPC connection to external procedure

ORA-06512: at “SDE.ST_GEOMETRY_SHAPELIB_PKG”,line 1325

ORA-06512: at “SDE.ST_GEOM_UTIL”, line823

 

Before going to the solution of this error, please review the following crucial points:

  • Other problems such as file corruption could also cause the extproc program to not be executable. Perform the following steps to verify whether the extproc program is valid and executable: 
  • Log in to the system as the applicable user.
  • cd to the $ORACLE_HOME/bin directory.
  • Execute the following command at the prompt: 

$  ./extproc 

 

  • starting form Oracle 11g release, you don’t need to configure the listener for external procedure, this can be directly implemented through “extproc” file.

 

Solution:

under $ORACLE_HOME/hs/admin directory edit the extproc.ora and

either use

SET EXTPROC_DLLS=ANY

(This is not advisable for security reasons)

OR

SET EXTPROC_DLLS=$ORACLE_HOME/libst_shapelib.so

and thats it you are FINISHED !!!!!!

 

However, make sure of the following:

when you perform the following query (access the database as “sde” account user).

SELECT * FROM USER_LIBRARIES;

it should point to the directory where your “.so” file is located, in our example its “$ORACLE_HOME/libst_shapelib.so”

after extensive troubleshooting, i found out that this will occur in one of two situations:

1. the libst_shapelib.so external procedure library is corrupted.

OR

2. the libst_shapelib.so external procedure library is a 32 bit…….to check that use the Unix Command ( filelibst_shapelib.so) the output should give you 64bit

in my situation, the library was corrupted (for some reason)…..when i copied the the library form my local machine (C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupportto the database server and used the external procedure method ‘ONLY’ it worked fine and i was able to execute the query: select * from gdb_items_vw;

 

reference links:

http://forums.arcgis.com/threads/73476-ST_GEOMETRY-problem-on-Oracle-RDBMS-11g-R2-11.2.0.3

https://community.oracle.com/thread/3520287

 

 

 

 

DBMS_NETWORK_ACL_ADMIN

The NETWORK_ACL_ADMIN package provides the interface to administer the network access control lists (ACL). ACLs are used to control access by users to external network services and resources from the database through PL/SQL network utility packages including UTL_TCP, UTL_HTTP, UTL_SMTP andUTL_INADDR.

starting with Oracle 12c oracle have deprecated subprograms such as: ADD_PRIVILEGE, CHECK_PRIVILEGE Function, CREATE ACL Procedure, DELETE PRIVILEGE Procedure. for further guide please visit:

http://docs.oracle.com/cd/E16655_01/appdev.121/e17602/d_networkacl_adm.htm#ARPLS148

 

The below is a guide for 11g Version:

Access control lists are manipulated using the DBMS_NETWORK_ACL_ADMIN package. The CREATE_ACL procedure uses the following parameters to create a new ACL:

  • acl – The name of the access control list XML file, generated relative to the “/sys/acls” directory in the XML DB Repository.
  • description – A description of the ACL.
  • principal – The first user account or role being granted or denied permissions. The text is case sensitive.
  • is_grant – TRUE to grant, FALSE to deny the privilege.
  • privilege – Use ‘connect’ for UTL_TCP, UTL_SMTP, UTL_MAIL and UTL_HTTP access. Use ‘resolve’ for UTL_INADDR name/IP resolution. The text is case sensitive.
  • start_date – Default value NULL. When specified, the ACL will only be active on or after the specified date.
  • end_date – An optional end date for the ACL.

The following code creates two test users to act as principals, then creates a new ACL.

CONN sys/password@db11g AS SYSDBA

CREATE USER test1 IDENTIFIED BY test1;

GRANT CONNECT TO test1;

CREATE USER test2 IDENTIFIED BY test2;

GRANT CONNECT TO test2;

BEGIN

DBMS_NETWORK_ACL_ADMIN.create_acl (

acl          => ‘test_acl_file.xml’,

description  => ‘A test of the ACL functionality’,

principal    => ‘TEST1’,

is_grant     => TRUE,

privilege    => ‘connect’,

start_date   => SYSTIMESTAMP,

end_date     => NULL);

COMMIT;

END;

/

Once created, the ACL is visible in the “http://host:port/sys/acls/” directory.

Additional users or roles are added to the ACL using the ADD_PRIVILEGE procedure. Its parameter list is similar to the CREATE_ACL procedure, with the omission of the DESCRIPTION parameter and the addition of a POSITION parameter, which sets the order of precedence.

BEGIN

DBMS_NETWORK_ACL_ADMIN.add_privilege (

acl         => ‘test_acl_file.xml’,

principal   => ‘TEST2’,

is_grant    => FALSE,

privilege   => ‘connect’,

position    => NULL,

start_date  => NULL,

end_date    => NULL);

COMMIT;

END;

/

====================================================================

select grantee , table_name , privilege from dba_tab_privs where table_name = ‘UTL_HTTP’ and grantee = ‘PUBLIC’;

http://www.oracle-base.com/articles/11g/fine-grained-access-to-network-services-11gr1.php

http://www.oracleflash.com/36/Oracle-11g-Access-Control-List-for-External-Network-Services.html

Querying current ACL’s configured in the database:

SELECT acl,

principal,

privilege,

is_grant,

TO_CHAR(start_date, ‘DD-MON-YYYY’) AS start_date,

TO_CHAR(end_date, ‘DD-MON-YYYY’) AS end_date

FROM   dba_network_acl_privileges;

Checking ACL Privileges:

SELECT DECODE(
         DBMS_NETWORK_ACL_ADMIN.check_privilege('test_acl_file.xml', 'TEST1', 'connect'),
         1, 'GRANTED', 0, 'DENIED', NULL) privilege 
FROM dual;

 

Dropping ACL:

BEGIN

DBMS_NETWORK_ACL_ADMIN.drop_acl (

acl         => ‘test_acl_file.xml’);

COMMIT;

END;

/

Deleting ACL privilege:

BEGIN

DBMS_NETWORK_ACL_ADMIN.delete_privilege (

acl         => ‘test_acl_file.xml’,

principal   => ‘TEST2’,

is_grant    => FALSE,

privilege   => ‘connect’);

COMMIT;

END;

/

ERROR 000955: Error encountered migrating the database storage

i have faced the following erorr while performing data migration from SDEBINARY to BLOB using  the Geo-processing Tool (Migrate Storage (Data Management):

ERROR 000955: Error encountered migrating the database storage
Insufficient permissions[Feature Class Name]
Failed to execute(MigrateStorage)

as shown also in the below image:

Image

This migration took place in version ArcGIS 10.1 SP1 in Oracle RDBMS environment.

so if you are in a version(release) below 10.1 that refer to this link:

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

 

The Solution i found is: to grant the schema user the following privileges:

GRANT ALTER ANY INDEX TO USER;
GRANT CREATE ANY INDEX TO USER;
GRANT CREATE TABLE TO USER;
GRANT DROP ANY INDEX TO USER;

Unfortunately this is not stated in any ESRI documentation (so far ….)

References for Data Migration:

http://resources.arcgis.com/en/help/main/10.1/index.html#//002n00000076000000

http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000000q000000

http://resources.arcgis.com/en/help/main/10.2/index.html#//002n00000076000000

 

Also, the below is the data migration for each DBMS type in ArcGIS:

Image

 

 

create spatial type in Esri Geodatabase for st_geometry

To create the spatial type (st_geoemtry) in your Oracle Geodatabase, use the Geoprocessing tool

create spatial type” which can be found in catalog tree search.

 

in order to perform this you need to configure your ‘SYS’ oracle user to connect from your client machine , this can be done through a procedure described in my early thread (https://geodatamaster.wordpress.com/2014/02/18/connecting-using-sys-user-from-client-machine/)

PLEASE NOTE: that is geoprocessing tool will ONLY work with ‘SYS’ user.

the below snapshot describes the activity:

Image

 

the dll st_geoemtry library (libst_shapelib.dll) can be found locally on your machine, in this directory:

C:\Program Files (x86)\ArcGIS\Desktop10.1\DatabaseSupport