Search code examples
oracledblink

ORA-02070: database does not support in this context


I have a query like

INSERT INTO sid_rem@dev_db
(sid)
select sid from v$session

Now, when i execute this query i get ORA-02070: database does not support in this context

This error happens only when I insert data from v$session into some remote db. Its working fine for any other table.

Anyone know why this issue and any workaround for this?


Solution

  • Works using gv$session instead of v$session:

    INSERT INTO sid_rem@dev_db(sid)
    select sid from gv$session;
    

    gv$ views are global views, that is, they are not restricted to one node(instance), but see the entire database(RAC). v$ views are subviews of gv$.

    Searching on the internet I found this has something to do with distributed transactions.

    Thread on ora-code.com