开发杂记-Oracle学习

by kevin 25. 五月 2017 17:49 >
在Oracle 11g 中默认的profile启用了密码过期时间是180天。 Oracle中如何查看客户端的IP? 缺省从 v$session 中不能直接获得客户端 IP,可以在数据库中创建一个追踪客户端IP地址的触发器: create or replace trigger on_logon_trigger after logon on database begin dbms_application_info.set_client_info(sys_context('userenv', 'ip_address')); end; 常用的显示客户端信息的sql: select v.USERNAME, v.STATUS, v.SCHEMANAME, v.OSUSER, v.PORT, v.TERMINAL, v.PROGRAM, v.TYPE, v.MACHINE, v.CLIENT_INFO from v$session v order by v.MACHINE,v.TERMINAL; 综合v$process和v$session查看连接情况 Oracle常用的包引用 https://docs.oracle.com/cd/B28359_01/appdev.111/b28419/toc.htm

FluentData使用Oracle

by kevin 8. 十月 2015 14:42 >
FlentData3.0.1 好像不支持,或者是我没找到使用的方法,3.0.1支持。 代码: new DbContext().ConnectionStringName(@"default", new OracleProvider()); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Web.Config配置 <add name="default" connectionString="data source=localhost/orali;persist security info=True;user id=System;password=System;" providerName="Oracle.ManagedDataAccess.Client" /> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } 或者 <add name="default" connectionString="data source=localhost/oral;persist security info=True;user id=system;password=system;" providerName="System.Data.OracleClient" /> 主要是连接字符串的providerName必填,根据自己安装的客户端填写。