Closed sandrozbinden closed 3 years ago
The oraacess.xml doc says that its settings override any sqlnet.ora settings. SQL*Net doc seems mostly AWOL, but here it says:
If client result cache is enabled on the server by CLIENT_RESULT_CACHE_SIZE, then its value can be overridden by the sqlnet.ora configuration parameter OCI_RESULT_CACHE_MAX_SIZE. If client result cache is disabled on the server, then OCI_RESULT_CACHE_MAX_SIZE is ignored and client result cache cannot be enabled on the client.
In summary, I believe you will need to enable CRC on the DB server.
I'll update node-oracledb's use of 'alternatively', and also see about some improvements in the SQL*Net doc - it's possible these didn't end up being SQLNet parameters and the doc references that say 'SQL\Net' should say 'OCI'.
Regarding verifying CRC, the traditional way is to check the number of statement executions the DB performed. If CRC is enabled, then the DB never gets sent the statement and doesn't execute it.
In SQL*Plus I did this:
ALTER SYSTEM SET CLIENT_RESULT_CACHE_LAG = 3000 SCOPE=SPFILE;
ALTER SYSTEM SET CLIENT_RESULT_CACHE_SIZE = 64K SCOPE=SPFILE;
STARTUP FORCE
And then ran crc.js which runs a pair of statements 100 times:
const q = `select id from crc_tab`;
const qc = `select /*+ result_cache */ id from crc_tab`;
The output was:
No CRC 100 executions
CRC 1 executions
If I tried your oraacess.xml files without the ALTER SYSTEM commands, I got a result showing that CRC wasn't enabled:
No CRC 100 executions
CRC 100 executions
Hi Christopher. Thanks a lot for your detailed description on how to get this working.
Problem
Hi there
I try to get the oracle client result cache working without any modifications on the oracle database server. According to the documentation (Client Result Cache) the cache can be enabled by creating a
oraaccess.xml
configuration file and adding a/*+ result_cache */
hint on the sql queryHowever I does not seem to have an impact on the query execution time. So my questions:
configDir
within theinitOracleClient
method?Any help much apprechiated
oraaccess.xml
NodeJS Code
Version