DbLinks

See Monitoring, Snapshots & Materialized Views
My questions:
    
10g - New passwordx field in link$
http://forums.oracle.com/forums/thread.jspa?threadID=495579

Domain suffixed to db link
http://forums.oracle.com/forums/thread.jspa?threadID=495995

 

v$session and db links - identification
Scenario:
host A> 
  Run:       sqlplus client
  osuser:    e-larosae
  Connects to database on:
host B> 
  Run: Oracle Database Server
  select * from tmp@to_dim1
  to_dim1 goes to:
host C>
  Run: Oracle Database Server
  host: invmi01
  tmp is: CREATE VIEW TMP AS select * from dual@netdb
  netdb goes to:
host D>
  Run: Oracle Database Server
  select osuser, machine, program, module from v$session
  --------- ------- -------------------------- --------------------------
  OSUSER    MACHINE PROGRAM                    MODULE
  --------- ------- -------------------------- --------------------------
  e-larosae invmi01 oracle@invmi01 (TNS V1-V3) oracle@invmi01 (TNS V1-V3)
  
Conclusion
OSUSER:                   Relative to the first client (ex. host A)
MACHINE, PROGRAM, MODULE: Relative to the effective connection (ex. host C)

All this means we easily know all about the last connection point
but we don't know where the OSUSER comes from

 

grant all on sys.link$ to system;

after low level altering link$:
alter system flush SHARED_POOL;

9i - show all
select u.name owner, l.owner#, l.name, l.userid, l.password, l.host, l.ctime
from sys.link$ l, sys.user$ u
where l.owner# = u.user#;

10g - Duplicate a dblink for another user
insert into sys.link$(owner#, name, ctime, host, userid, password, flag, authusr, authpwd, passwordx, authpwdx) 
(
  select 
    --destination user 
    (select user_id from dba_users where username = 'SYSTEM'), 
    name, ctime, host, userid, password, flag, authusr, authpwd, passwordx, authpwdx from sys.link$
	--source user  
    where owner# = (select user_id from dba_users where username = 'ALDO')
	--dblink name  
	and name = 'TO_MY_DB'
)

9i - Duplicate a dblink for another user
insert into sys.link$(owner#, name, ctime, host, userid, password, flag, authusr, authpwd)
(
  select 
    --destination user 
    (select user_id from dba_users where username = 'SYSTEM'), 
    name, ctime, host, userid, password, flag, authusr, authpwd from sys.link$
	--source user  
    where owner# = (select user_id from dba_users where username = 'ALDO')
	--dblink name  
	and name = 'TO_MY_DB'
)