Monday, October 15, 2012

SSLPeerUnverifiedException: peer not authenticated

Curious why are you getting this exception?

Exception in thread "main" javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)

Enable debug :)
-Djavax.net.debug=all

Sunday, September 2, 2012

XMLSERIALIZE returns value truncated to 2000/4000 char

Seems like using XMLSERIALIZE or getClobVal on a XMLTYPE column stored as BINARY XML returns value truncated to 2000/4000 char without any error.
Seems like the only way to retrieve the data is to retrieve XMLTYPE using JDBC getObject which returns oracle.xdb.XMLType.
It is good in its way. It forces people to use more effective way of XML retrieval.

Monday, March 19, 2012

Getting ORA-19102 on any XMLTABLE

Getting ORA-19102 on any XMLTABLE? Try putting in SELECT /*+ CURSOR_SHARING_EXACT */  ...
Caused by Oracle parameter CURSOR_SHARING = FORCE.

Tuesday, January 24, 2012

Enable "Dynamic service registration" with Oracle TNS Listener

-- shows if it is enabled
sqlplus / as sysdba
show parameter local_listener

alter system set local_listener='(ADDRESS = (PROTOCOL=TCP)(HOST=localhost)(PORT=1521))'
alter system register;

DBMS_XMLSCHEMA.registerSchema ORA-19046: Out-of-line table cannot be shared by two top-level tables.

During DBMS_XMLSCHEMA.registerSchema(?, ?, TRUE , TRUE, FALSE, TRUE, FALSE, ?, 2, 0) running Oracle DB 11.2.0.3 (.2) an error occurred:

ORA-19046: Out-of-line table cannot be shared by two top-level tables.
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 3
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 14
ORA-06512: at line 1
No issue on Oracle DB 11.2.0.1

ALTER SESSION SET events='31098 trace name context forever'; used for XMLDB tracing didn't show anything meaning full.

Searching Metalink I found that  gentables=TURE might be causing an issue.  Changing to DBMS_XMLSCHEMA.registerSchema(?, ?, TRUE , TRUE, FALSE, FALSE, FALSE, ?, 2, 0) fixed it.
Using XMLTYPE example_row STORE AS OBJECT RELATIONAL XMLSCHEMA I don't need those tables.

DBMS_XMLSCHEMA.REGISTERSCHEMA(
    schemaurl        IN  VARCHAR2,
    schemadoc        IN  VARCHAR2,
    local            IN  BOOLEAN := TRUE,
    gentypes         IN  BOOLEAN := TRUE,
    genbean          IN  BOOLEAN := FALSE,
    gentables        IN  BOOLEAN := TRUE,
    force            IN  BOOLEAN := FALSE,
    owner            IN  VARCHAR2 := NULL,
    enablehierarchy  IN  PLS_INTEGER := DBMS_XMLSCHEMA.ENABLE_CONTENTS,
    options          IN  PLS_INTEGER := 0);

24/Feb/2012 Update: Getting error when trying to insert data:
ORA-21700: object does not exist or is marked for delete
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1

Thus returning back to  gentables := TRUE, and adding xdb:defaultTable="" into schema definition as recommended in  http://www.oracle.com/technetwork/database/features/xmldb/downloads/oow2010-complex-xml-schemas-176089.pdf
It seems "STORE AS OBJECT RELATIONAL" is only good for simple schemas when you really need super fast access to query underlying data. "store AS BINARY XML" is not available in 10g. See http://www.liberidu.com/blog/?p=203 for available storage options.