Does NLS_SORT = BINARY_CI and NLS_COMP = BINARY make sense?

I hope this is not a stupid question:

I inherited several Oracle stored procedures, triggers ... One of the triggers was written like this:

create or replace trigger TRN_NIS_LOGON after logon on database 
begin
       execute immediate 'ALTER SESSION SET NLS_SORT=BINARY_CI'; 
       execute immediate 'ALTER SESSION SET NLS_COMP=LINGUISTIC'; 
end;
/

      

This caused problems. So I read http://docs.oracle.com/cd/B19306_01/server.102/b14225/ch5lingsort.htm

Then I was told that I should just change the trigger like so:

create or replace trigger TRN_NIS_LOGON after logon on database 
begin
       execute immediate 'ALTER SESSION SET NLS_SORT=BINARY_CI'; 
       execute immediate 'ALTER SESSION SET NLS_COMP=BINARY'; 
end;
/

      

However, I don't think it makes sense. It seems to me that NLS_SORT = BINARY_CI / AI needs to be combined with NLS_COMP = LINGUISTIC and the corresponding linguistic index. The goal is to make oracle behave like a SQL server (I also looked at this: https://hoopercharles.wordpress.com/2010/06/04/sql-experimenting-with-case-insensitive-searches/ ).

It looks like the above trigger is a very bad idea and NLS_COMP and NLS_SORT have to be set together for a session when working on tables with linguistic indexes. Such a trigger should not be used. NLS_SORT = BINARY_CI without linguistic indexes will result in a full table scan. Is it correct?

+3


source to share





All Articles