21

I log into Oracle using my own user account, which we can call my_account, and I am granted select privileges on all of the tables in the schema that our application uses, which I will call app_schema.

I would like to use Entity Manager to generate the entity definitions for the tables in the app_schema schema, but I do not have the password for that account and likely won't be given it, so I must log in as my_account.

When I run the wizard I can only see the tables in the my_account schema. Is there any way to get the tables from a different schema so that I can generate those? This is a massive database, so writing the .edmx file by hand could take days, and will probably result in tons of typo-induced errors. I have attempted to use synonyms, but they are not visible in the wizard either.

Simon T
  • 529
  • 1
  • 4
  • 10

2 Answers2

57

In your Server explorer, select your connection and right. Click on filters tab, select Displayed schemas, then add more schemas from your schemas list. Remember click on update button and Ok to save changes on your connection.

Now when you add a new ADO.Net Entity Data Model you will see all tables from your schemas.

Please visit this link: https://forums.oracle.com/forums/thread.jspa?threadID=2291628&tstart=0

I hope help you with this.

Cesar.

CMarchan
  • 586
  • 5
  • 2
  • 1
    This saved a lot of time me. – L.T. Dec 01 '15 at 22:10
  • 1
    One of the most under voted helpful answers in SO. Added a screenshot to further depict the process, if you do not mind. – Veverke Jul 03 '16 at 15:10
  • I reported what seems to be a bug with the proposed solution at oracle forums, [here](https://community.oracle.com/thread/3946813?sr=inbox). Overall it works. – Veverke Jul 05 '16 at 06:21
  • Keep the schema of the user in "Displayed schemas" in the list, otherwise the tables won't show up when you want to add a data model – true_gler Aug 02 '18 at 07:45
1

I am using EF 4.2 and found that I was able to use tables from another user/schema only when creating a new connection (using my_account) and using a filter when going through the Entity Data Model Wizard. Add app_schema to the Displayed Schemas filter (be sure to press Update).

Like CMarchan suggests, if I set the filter on the connection in the server explorer, it works for me there, but the EDM wizard does not see the connection when creating a new model (maybe just a "feature" in 4.2).

Once the EDM is created, it does allow me to add/edit tables from app_schema.

Brian C
  • 134
  • 4