Skip to Main Content

Oracle Database Free

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.

ORA-40216: feature not supported on 23ai Windows version

Dennis LauritzenAug 20 2024

I installed Oracle 23ai using the Windows native installer.

After that I converted a pretrained model using Oml4Py

python

>>> from oml.utils import EmbeddingModelConfig
>>> from oml.utils import EmbeddingModel
>>> em = EmbeddingModel(model_name="sentence-transformers/distiluse-base-multilingual-cased-v2")
>>> em.export2file("distiluse-base-multilingual-cased-v2", output_dir=".")

this resulted in the following output:

/home/dennis/python/lib/python3.12/site-packages/huggingface_hub/file_download.py:1150: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
warnings.warn(
tokenizer_config.json: 100%|███████████████████| 531/531 [00:00<00:00, 2.97MB/s]
config.json: 100%|█████████████████████████████| 610/610 [00:00<00:00, 4.93MB/s]
vocab.txt: 100%|█████████████████████████████| 996k/996k [00:00<00:00, 2.61MB/s]
special_tokens_map.json: 100%|█████████████████| 112/112 [00:00<00:00, 1.36MB/s]
tokenizer.json: 100%|██████████████████████| 1.96M/1.96M [00:00<00:00, 4.11MB/s]
model.safetensors: 100%|█████████████████████| 539M/539M [00:23<00:00, 23.2MB/s]
/home/dennis/python/lib/python3.12/site-packages/transformers/models/distilbert/modeling_distilbert.py:246: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.
mask, torch.tensor(torch.finfo(scores.dtype).min)

I copied the “distiluse-base-multilingual-cased-v2.onnx” file to the windows machine with Oracle 23ai Free installed and put it into this folder: C:\dbfree\DM_DUMP

I ran the following as sys user on the pluggable database:

GRANT DB_DEVELOPER_ROLE, CREATE MINING MODEL TO dennis;
CREATE OR REPLACE DIRECTORY DM_DUMP AS 'C:\dbfree\DM_DUMP';
GRANT READ ON DIRECTORY DM_DUMP TO dennis;
GRANT WRITE ON DIRECTORY DM_DUMP TO dennis;
exit

I then ran the following as dennis user on the pluggable database:

EXECUTE DBMS_VECTOR.LOAD_ONNX_MODEL('DM_DUMP','distiluse-base-multilingual-cased-v2.onnx','doc_multi');

This gives me the following errors:

SQL> EXECUTE DBMS_VECTOR.LOAD_ONNX_MODEL('DM_DUMP','distiluse-base-multilingual-cased-v2.onnx','doc_multi');
BEGIN DBMS_VECTOR.LOAD_ONNX_MODEL('DM_DUMP','distiluse-base-multilingual-cased-v2.onnx','doc_multi'); END;

*
ERROR at line 1:
ORA-40216: feature not supported
ORA-06512: at "SYS.DBMS_VECTOR", line 879
ORA-06512: at "SYS.DBMS_DATA_MINING", line 5767
ORA-06512: at "SYS.DBMS_VECTOR", line 874
ORA-06512: at line 1
Help: https://docs.oracle.com/error-help/db/ora-40216/

I then tried to download the “Pre-built embedding Generation model” as per this blog (to test if was something wrong with my converted onnx file):

https://blogs.oracle.com/machinelearning/post/use-our-prebuilt-onnx-model-now-available-for-embedding-generation-in-oracle-database-23ai

Extracted the zip file and copied the “all_MiniLM_L12_v2.onnx” file to C:\dbfree\DM_DUMP and ran the following as dennis user on the pluggable database:

BEGIN
DBMS_VECTOR.LOAD_ONNX_MODEL(
directory => 'DM_DUMP',
file_name => 'all_MiniLM_L12_v2.onnx',
model_name => 'ALL_MINILM_L12_V2');
END;
/

This, again, gives me the same errors:

SQL> BEGIN
2 DBMS_VECTOR.LOAD_ONNX_MODEL(
3 directory => 'DM_DUMP',
4 file_name => 'all_MiniLM_L12_v2.onnx',
5 model_name => 'ALL_MINILM_L12_V2',
6 metadata => JSON('{"function" : "embedding", "embeddingOutput" : "embedding", "input": {"input": ["DATA"]}}'));
7 END;
8 /
BEGIN
*
ERROR at line 1:
ORA-40216: feature not supported
ORA-06512: at "SYS.DBMS_VECTOR", line 879
ORA-06512: at "SYS.DBMS_DATA_MINING", line 5767
ORA-06512: at "SYS.DBMS_VECTOR", line 874
ORA-06512: at line 2
Help: https://docs.oracle.com/error-help/db/ora-40216/

Question: Is there some dependencies not documented, that needs to be installed on the Windows machine where Oracle 23ai is installed?

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 Aug 20 2024
11 comments
859 views