Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: populating tables based on some v$ views
According to http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions208.htm
or http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions165.htm#i1038176
there are at least some parameters you canniot use in distributed transactions.
If you look in GV$FIXED_VIEW_DEFINITION how V$VERSION is created you
can see that it references USERENV('Instance')
SQL> select * from GV$FIXED_VIEW_DEFINITION
2 where VIEW_NAME = 'V$VERSION'
3 /
INST_ID VIEW_NAME
---------- ------------------------------VIEW_DEFINITION
1 V$VERSION
select BANNER from GV$VERSION where inst_id = USERENV('Instance')
So I suspect that 'Instance' also cannot be used in distributed transactions although it isn't written there. See also example below (keep in mind that db link is created back to my user and I'm actually referencing the same table):
SQL> create table q as select * from v$version;
Table created.
Elapsed: 00:00:00.01
SQL> create database link dlink connect to gints identified by gints using 'fedora';
Database link created.
Elapsed: 00:00:00.00
SQL> desc q_at_dlink
Name Null? Type ----------------------------------------- -------- ---------------------------- BANNER VARCHAR2(64)
SQL> select * from q;
BANNER
Elapsed: 00:00:00.00
SQL> insert into q select * from v$version;
5 rows created.
Elapsed: 00:00:00.00
SQL> insert into q_at_dlink select * from v$version;
insert into q_at_dlink select * from v$version
*ERROR at line 1:
Elapsed: 00:00:00.01
SQL>
Gints Plivna
http://www.gplivna.eu
2006/12/5, Jeffrey Beckstrom <JBECKSTROM_at_gcrta.org>:
>
> I create some tables similar to their v$ version which I want to populate.
> Here is one example - any idea why I am getting the error.
>
> SQL> l
> 1 INSERT into rta.lms_V$VERSION_at_emgr
> 2 ( banner
> 3 )
> 4 SELECT
> 5 banner
> 6* from V$VERSION
> SQL> /
> SELECT
> *
> ERROR at line 4:
> ORA-02070: database EMGR does not support operator USERENV in this context
>
>
> SQL>
>
> Jeffrey Beckstrom
> Database Administrator
> Greater Cleveland Regional Transit Authority
> 1240 W. 6th Street
> Cleveland, Ohio 44113
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Dec 05 2006 - 09:54:57 CST
![]() |
![]() |