简体   繁体   English

ODP.NET(Oracle数据提供程序)架构

[英]ODP.NET (Oracle Data Provider) schema

I have a question about OPD.NET in combination with Oracle tablespaces. 我对与Oracle表空间结合使用OPD.NET有疑问。

We have a webapplication that runs smoothly in a production environment using ODP.NET as dataprovider for Entity Framework. 我们有一个Web应用程序,使用ODP.NET作为Entity Framework的数据提供者,可以在生产环境中顺利运行。 De model was created from the database (which pre-existed), and the tables in the edmx file look like this: De model是从数据库(已存在)创建的,并且edmx文件中的表如下所示:

<EntitySet Name="ES_T_ALG_INFO" EntityType="Model.Store.ES_T_ALG_INFO" store:Type="Tables" Schema="ES_ANON" />

As you can see the designer added the Schema attribute, which corresponds with the ES_ANON tablespace. 如您所见,设计者添加了Schema属性,该属性与ES_ANON表空间相对应。

The client now wants to re-use the application for a different unit, which has a different tablespace. 客户端现在希望将应用程序重新用于具有不同表空间的其他单元。 If I search-replace the ES_ANON with the new schema, there is no problem. 如果用新模式搜索替换ES_ANON,则没有问题。 If I don't do this (or remove the attributes all together), the ObjectDataContext can't find my tables.. 如果我不这样做(或一起删除所有属性),则ObjectDataContext找不到我的表。

Is there a way to programmatically set the tablespace ? 有没有办法以编程方式设置表空间?

If any more ifnormation is required, don't hesitate to let me know. 如果需要更多ifnormation,请随时告诉我。 Any help would be appreciated. 任何帮助,将不胜感激。

I found the solution. 我找到了解决方案。

<EntitySet Name="ES_T_ALG_INFO" EntityType="Model.Store.ES_T_ALG_INFO" store:Type="Tables" Schema="" />

The schema attriute is required (which I did not know). 必须使用架构属性(我不知道)。 When you leave it empty, the ODPnet provider will use the default schema, which in Oracle is the same as the username. 当您将其保留为空时,ODPnet提供程序将使用默认模式,在Oracle中该默认模式与用户名相同。

You can access different schema's through some hacks I found, but since I don't really need that I'm not investigating further. 您可以通过我发现的一些技巧来访问不同的架构,但是由于我并不需要,所以我不作进一步调查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM