Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: populating tables based on some v$ views

Re: populating tables based on some v$ views

From: Gints Plivna <gints.plivna_at_gmail.com>
Date: Tue, 5 Dec 2006 17:54:57 +0200
Message-ID: <6e49b6d00612050754l61b88777p5d93161dbc0b36cf@mail.gmail.com>


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



Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Linux: Version 9.2.0.4.0 - Production NLSRTL Version 9.2.0.4.0 - Production

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:
ORA-02070: database DLINK does not support operator USERENV in this context

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-l
Received on Tue Dec 05 2006 - 09:54:57 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US