Alter session "on calling" a query via Oracle DB-Link

132 Views Asked by At

I have a problem with a remote database and a functional index. When I call a query on a DB link from databases with "normal index", this DB passes the session parameters from the database that calls the DB link. But I need the session parameters configured in the remote DB (NLS_COMP=LINGUISTIC & NLS_SORT=BINARY_CI).

Is it possible to change the session of the calling database when opening the db link? So that automatically the session is changed, if e.g. a select * from [email protected] is sent.

thanks in advance

1

There are 1 best solutions below

4
On

I don't know how to alter session over database link.

I don't know what exactly you're doing (as you didn't post any code), but - if you used appropriate hint (driving_site) and apply nls_sort in query, perhaps it'll do what you wanted.

This is a stupid example, but illustrates what I'm trying to say:

SQL> select /*+ driving_site (t) */
  2    t.name, d.loc
  3  from dept d cross join test@dbl_mike t
  4  where t.name = 'Little'
  5    and rownum = 1
  6  order by nlssort(name, 'NLS_SORT = GERMAN');

NAME       LOC
---------- -------------
Little     NEW YORK

SQL>