ORACLE 的Virtual Private Database的全新体验[6]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 enhydraboy 的 blog

但是,我觉的还不够,能够做到每个连接建立的时候,就自动完成这种映射,令人高兴的是,oracle 8i提供了系统级的触发器,让我轻松地实现。

--scott用户登陆触发器

connect system/manager@oracle

create or replace trigger scott.tg_set_usr_context

after logon on database

begin

secusr.customer_security_context.set_customerid;

end;

--断掉connection,重新登陆

oracle8i enterprise edition release 8.1.7.0.0 - production

with the partitioning option

jserver release 8.1.7.0.0 - production

 

sql> connect scott/tiger@oracle

已连接。

sql> select sys_context('customer_context','customerid') from dual;

sys_context('customer_context','customerid')

--------------------------------------------------------------------------------

alfki

sql>

本文关键:ORACLE Virtual Private Database
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top