On Wed, Apr 23, 2014 at 12:55 PM, Jonathan Moules <
[email protected]> wrote:

> Hi List,
> I'm getting the following in my logs.
>
> 2014-04-22 14:48:03,547 WARN [geotools.jdbc] - Failure occurred while
>> looking up the primary key with finder:
>> org.geotools.jdbc.HeuristicPrimaryKeyFinder@e944077
>> java.sql.SQLException: ORA-01031: insufficient privileges
>>  at
>> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
>> at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
>>  at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
>> at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
>>  at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
>> at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946)
>>  at
>> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
>> at
>> oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1614)
>>  at
>> oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1579)
>> at
>> oracle.jdbc.OracleDatabaseMetaData.getIndexInfo(OracleDatabaseMetaData.java:3485)
>>  at
>> org.apache.commons.dbcp.DelegatingDatabaseMetaData.getIndexInfo(DelegatingDatabaseMetaData.java:327)
>> at
>> org.apache.commons.dbcp.DelegatingDatabaseMetaData.getIndexInfo(DelegatingDatabaseMetaData.java:327)
>>  at
>> org.geotools.jdbc.HeuristicPrimaryKeyFinder.getPrimaryKey(HeuristicPrimaryKeyFinder.java:69)
>> at
>> org.geotools.jdbc.CompositePrimaryKeyFinder.getPrimaryKey(CompositePrimaryKeyFinder.java:52)
>
>
>
> I'd like to give my Oracle user the right permissions, but from the error
> we (including the DBA's) can't figure out what GeoServer is doing and
> therefore what permissions are required. Does anyone know what priviledges
> we need to give to the database to get this to disappear?
>

I don't, but the search for primary keys is done using the JDBC driver
official methods for the purpose:

ResultSet primaryKey = metaData.getPrimaryKeys(null, databaseSchema,
tableName);

and if that fails, falling back on searching for unique indexes:

ResultSet uniqueIndex = metaData.getIndexInfo(null, databaseSchema,
tableName,
                           true, true);

( more info here:
http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html)

You might want to inquiry Oracle directly about it (which queries are run,
and so on).
If you look back in the archives, there is also meantioning a view that
contains the full
list of queries run against a Oracle instance, v$sql

An example query that I used in the past is:

SELECT last_active_time, LAST_LOAD_TIME, module,  parsing_schema_name,
 elapsed_time total_elapsed_time_micros,  executions number_executions,
 DECODE(executions,0,0,round((elapsed_time/executions)/1000000,3))
avg_elapsed_time_s,  sql_id,  sql_fulltext
 FROM v$sql WHERE last_active_time > to_date('04/12/2013 14:58:45',
'DD/MM/YYYY HH24:MI:SS')
 and parsing_schema_name IN ('GEOSERVER')
  ORDER BY LAST_ACTIVE_TIME DESC

Cheers
Andrea

-- 
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to