Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Registration XSD-schemes with encoding different from the DB

DENISKA80Feb 4 2025

Hi there
Oracle 19c (NLS_CHARACTERSET is Windows-1252)
We have to create xml-files from relational data and then validate it against XSD schemas
Output xml-files must be created in UTF-8 encoding
Xsd schemas are in UTF-8 encoding too
I think there is no problem when both DB and schemas have same encoding
What is the correct way lo load UTF-8 encoded schemas to database (register it with DBMS_XMLSCHEMA.registerSchema)
and then validate created xml-s?

1. When I tried to specify CSIS=>1208 i got error ORA 01482: unsupported character set

declare
v_schema clob;
begin 
DBMS_XMLSCHEMA.registerSchema(schemaurl       => 'CommonLeafTypes.xsd', 
                                schemadoc       => BFILENAME('TEST_DIR', 'CommonLeafTypes.xsd'),
                                local           => TRUE,
                                gentypes        => FALSE,
                                gentables       => FALSE,
                                enablehierarchy => DBMS_XMLSCHEMA.enable_hierarchy_none,
                                csid             =>1208
                                );

END;
2. When I tried to NOT specify CSIS i got error ora-31038: invalid integer value "4404019"
during loading the second schema
"
   <xs:restriction base="xs:string">
     <xs:minLength value="1"/>
     <xs:maxLength value="4404019"/>
   </xs:restriction>
"
declare
v_schema clob;
begin 
DBMS_XMLSCHEMA.registerSchema(schemaurl       => 'CommonLeafTypes.xsd', 
                                schemadoc       => BFILENAME('TEST_DIR', 'CommonLeafTypes.xsd'),
                                local           => TRUE,
                                gentypes        => FALSE,
                                gentables       => FALSE,
                                enablehierarchy => DBMS_XMLSCHEMA.enable_hierarchy_none
                                );

END;

Comments

MartinBach-Oracle Jan 8 2025

Hi Salomon,

please have a look at this blog post written by @ulrike-schwinn-oracle :

https://blogs.oracle.com/coretec/post/easy-sql-statement-tracking-in23c

I hope this answers your question, if not, please shout!

- Martin

Solomon Yakobson Jan 8 2025

@martinbach-oracle - No, it doesn't answer my question. Article you pointed to shows uses:

SQL> alter system set sql_history_enabled=true scope=both;

And in my post I said “Works fine when enabled on system level”. My question was about

SQL> ALTER SESSION SET SQL_HISTORY_ENABLED = TRUE;

where I showed SQL history was NOT captured even though it should be based on SQL_HISTORY_ENABLED:

Modifiable **ALTER SESSION**, ALTER SYSTEM

SY.

MartinBach-Oracle Jan 8 2025

As per the article I shared the situation is as follows at the moment

  • You must enable SQL history PDB-wide (only a DBA can do that) so there's a certain level of control over the feature
  • Your session has access to the SQL history
  • If you don't want to record anything, set sql_history_enabled to false.

I'm currently assessing if that's intended behaviour (in which case the documentation should be amended) or a feature not working as it should (in which case it needs fixing). The parameter is indeed session-modifyable, but not in the sense you expected.

We'll keep you posted.

- Martin

Solomon Yakobson Jan 8 2025

Do you mean it must be enabled on system level and not on session level and all session can do is disabe it for the session?

SY.

MartinBach-Oracle Jan 14 2025

Yes,

that's correct as of Oracle Database Free 23.6.

- Martin

Solomon Yakobson Jan 14 2025

Thanks Martin, I hope this will be added to 23AI docs soon.

SY.

1 - 6

Post Details

Added on Feb 4 2025
0 comments
47 views