Entity Framework - Code First - Migration - How to access SQL Server and Oracle using the same context?
Hello,
I use Entity Framework code first approach.
My project is working fine with SQL Server. But, I want to access Oracle too. I want to switch SQL Server and Oracle in run time.
I am able to access Oracle using "Oracle.ManagedDataAccess.EntityFramework.dl" in a new project.
But, Is this possible to access SQL Server and Oracle in the same project.
Thanks,
Murugan
This should be possible with a Code-First workflow. In Code-First the database mapping layer is generated at runtime.
David
David http://blogs.msdn.com/b/dbrowne/
Similar Messages
-
How to access SQL server in oracle running in aix unix?
Hi all,
I have oracle database running in IBM AIX OS, and I need to query data in
SQL SERVER 2000.
How to do that?
Is there free Sqlserver ODBC drivers for unix?
ThanksHi,
I prefer heterogenous services over ODBC for this!
I have my notes here, which may help.
http://www.dba-oracle.com/t_heterogeneous_database_connections_sql_server.htm
1. Install Oracle ODBC drivers on the server (your local Oracle database) that will access the remote SQL Server database using the database link.
2. Setup the ODBC connection on the local Oracle database using the Windows ODBC Data Source Administrator
3. Test the ODBC drivers to ensure that connectivity is made to the SQL Server database.
4. Ensure that your global_names parameter is set to False.
5. Configure the Oracle Heterogeneous services by creating an initodbc.ora file within the Oracle database.
7. Modify the Listener.ora file.
SID_NAME is the DSN for the remote database.
ORACLE_HOME is the actual Oracle home file path.
PROGRAM tells Oracle to use heterogeneous services.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME=Cas30C) -- Enter the DSN on this line
(ORACLE_HOME = c:\oracle10gdb) -- Enter your Oracle home on this line
(PROGRAM = hsodbc) ) )
8. Modify the Tnsnames.ora file. This is the Oracle database installation accessed by the users to connect to the ODBC drivers
(DESCRIPTION=
(ADDRESS_LIST=
(Address=(PROTOCOL=TCP)
(HOST=
-- (Server x)
(PORT=1521))) -- Enter the port on which the server x Oracle installation
-- is listening
(CONNECT_DATA=(SID=Cas30c)) - Enter the DSN name
(HS=OK) -- Enter this value. It tells Oracle to use hetergeneous services
9. Reload the listener on local Oracle database
10. Create a database link on the local Oracle installation that accesses the heterogeneous connection, which, in turn, connect to SQL Server.
11. Run a SQL Server Select statement from the Oracle installation using the database link.
Hope this helps. . .
Don Burleson
Oracle Press author
Author of “Oracle Tuning: The Definitive Reference”
http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm -
Accessing SQL Server from ORACLE using Transparent Gateway
So I had downloaded the gateway installer and was following the guide here to set up the Transparent Gateway for SQL Server: http://www.orafusion.com/art_orahs.htm
After I had created the database link, I was prompted the following error when trying to do a simple select statement from the SQL Server DB:
>
ORA-12154: TNS:could not resolve service name
12154. 00000 - "TNS:could not resolve the connect identifier specified"
*Cause: A connection to a database or other service was requested using
a connect identifier, and the connect identifier specified could not
be resolved into a connect descriptor using one of the naming methods
configured. For example, if the type of connect identifier used was a
net service name then the net service name could not be found in a
naming method repository, or the repository could not be
located or reached.
*Action:
- If you are using local naming (TNSNAMES.ORA file):
- Make sure that "TNSNAMES" is listed as one of the values of the
NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
(SQLNET.ORA)
- Verify that a TNSNAMES.ORA file exists and is in the proper
directory and is accessible.
- Check that the net service name used as the connect identifier
exists in the TNSNAMES.ORA file.
- Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
file. Look for unmatched parentheses or stray characters. Errors
in a TNSNAMES.ORA file may make it unusable.
- If you are using directory naming:
- Verify that "LDAP" is listed as one of the values of the
NAMES.DIRETORY_PATH parameter in the Oracle Net profile
(SQLNET.ORA).
- Verify that the LDAP directory server is up and that it is
accessible.
- Verify that the net service name or database name used as the
connect identifier is configured in the directory.
- Verify that the default context being used is correct by
specifying a fully qualified net service name or a full LDAP DN
as the connect identifier
- If you are using easy connect naming:
- Verify that "EZCONNECT" is listed as one of the values of the
NAMES.DIRETORY_PATH parameter in the Oracle Net profile
(SQLNET.ORA).
- Make sure the host, port and service name specified
are correct.
- Try enclosing the connect identifier in quote marks.
Error at Line: 3 Column: 27
>
Here are my configuration files:
initMSQL.ora
>
HS_FDS_CONNECT_INFO=webdatasvr:1433.InfoWeb
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
>
listener.ora
>
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC=
(GLOBAL_DBNAME=UGCMAC)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(SID_NAME=UGCMAC)
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
(SID_DESC =
(SID_NAME = MSQL)
(ORACLE_HOME = C:\oracle\product\11.2.0\tg_1)
(PROGRAM = dg4msql)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(ADDRESS LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1524))
>
tnsname.ora
>
UGCMAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = UGCMAC)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
MSQL=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1524))
(CONNECT_DATA =
(SID = MSQL)
(HS=OK)
>
Can anyone assist me? thanks!Hi kgronau,
>
After changing a listener.ora file you need to STOP and START the listener to get the changes loaded. It looks like your listener is not serving the 1524 port which could be related to the fact that you didn't stop/start the listener after you've edited the listener.ora file.
... But as stated earlier - please do not use a 10.2 listener to start an 11g gateway. Instead configure the listener of the gateway home.
>
I did restart my listener under services.msc whenever I make the changes but there are no effect. Please also note that I can only find "OracleOraDb10g_home1TNSListener" under my services.msc. There is no 11.2 Listener. I did install the gateway and the installation was successful as far as I can tell. But perhaps because there's no 11.2 Listerner under my services.msc, could that mean it was a bad installation?
>
Next point is the tnsping you've used is 11.2. You need to make sure that you use the tnsping of the Oracle Database home as the database initiates the gateway connection so the database home tnsnames,ora needs the tns entry for the gateway.
>
My current PATH environment variables setting is as follow: C:\oracle\product\11.2.0\tg_1\bin;C:\oracle\product\10.2.0\db_1\bin; So perhaps, I just need to ensure the 10.2 ORACE home is the first?
>
As a final tip: There are so many web sites explaining how to configure DG4ODBC - many of them are faulty. If you need a reliable configuration, please have a look at "My Oracle Support" => How to Configure DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit to Connect to Non-Oracle Databases Post Install [Document 466225.1] )
>
Is there a link?
Edited by: omnri on 21-Jul-2011 23:59 -
Entity framework code first inheritance table per type problem
hello
i am using ODP.NET version 11.2.0.3.20. i am trying to get entity framework code first to work. one problem i have encountered is with inheritance. i have a "table per type" inheritance scenario. i have 3 tables involved. the base table is called "S_PERIOD" which maps to the base "Period" class. i have a derived table called "S_SEASON_QUARTER" that maps to the derived "Quarter" class. And I have another derived table called "S_SEASON_PRICE_PERIOD" that maps to the derived "PriceBreak" class. for testing purposes i am trying to load all records. the problem is that every class instance ends up being of type "Quarter", which is incorrect. for whatever reason the provider thinks that every "S_PERIOD" record has a corresponding "S_SEASON_QUARTER" record. i took a look at the generated SQL and posted it down below. looking at this SQL it's clear to me why every object ends up being of type "Quarter". It looks like the provider is checking the "C2" field to determine the concrete type to instantiate. the problem however is that the "C2" field value provided by each derived table is ALWAYS equal to "1", which is a problem since this will result in the "case" statement always hitting the second "when" condition. does anyone have any idea how to fix this? thank you
SELECT
CASE WHEN (( NOT (("Project1"."C2" = 1) AND ("Project1"."C2" IS NOT NULL))) AND ( NOT (("Project2"."C2" = 1) AND ("Project2"."C2" IS NOT NULL)))) THEN '0X' WHEN (("Project1"."C2" = 1) AND ("Project1"."C2" IS NOT NULL)) THEN '0X0X' ELSE '0X1X' END AS "C1",
CAST( "Extent1"."PERIOD_ID" AS number(10,0)) AS "C2",
"Extent1"."START_DATE" AS "START_DATE",
"Extent1"."END_DATE" AS "END_DATE",
"Extent1"."NAME" AS "NAME",
"Extent1"."TYPE_CODE" AS "TYPE_CODE",
CAST( "Extent1"."CREATE_USER_ID" AS number(10,0)) AS "C3",
"Extent1"."CREATE_DATE" AS "CREATE_DATE",
CAST( "Extent1"."MODIFY_USER_ID" AS number(10,0)) AS "C4",
"Extent1"."MODIFY_DATE" AS "MODIFY_DATE",
CASE WHEN (( NOT (("Project1"."C2" = 1) AND ("Project1"."C2" IS NOT NULL))) AND ( NOT (("Project2"."C2" = 1) AND ("Project2"."C2" IS NOT NULL)))) THEN NULL WHEN (("Project1"."C2" = 1) AND ("Project1"."C2" IS NOT NULL)) THEN "Project1"."QUARTER_NAME" END AS "C5"
FROM "DBO_SPACE_DEV"."S_PERIOD" "Extent1"
LEFT OUTER JOIN (SELECT
"Extent2"."QUARTER_NAME" AS "QUARTER_NAME",
CAST( "Extent2"."QUARTER_ID" AS number(10,0)) AS "C1",
1 AS "C2"
FROM "DBO_SPACE_DEV"."S_SEASON_QUARTER" "Extent2" ) "Project1" ON ( CAST( "Extent1"."PERIOD_ID" AS number(10,0))) = "Project1"."C1"
LEFT OUTER JOIN (SELECT
CAST( "Extent3"."PRICE_PERIOD_ID" AS number(10,0)) AS "C1",
1 AS "C2"
FROM "DBO_SPACE_DEV"."S_SEASON_PRICE_PERIOD" "Extent3" ) "Project2" ON ( CAST( "Extent1"."PERIOD_ID" AS number(10,0))) = "Project2"."C1"
Edited by: 997830 on Apr 3, 2013 8:40 AMAn update:
I tried again following this example to the letter:
Using NuGet to Install and Configure Oracle Data Provider for .NET
This time I used a console application as described in the example. Yes, I rebuilt the project after the NuGet install.
I made the appropriate mods to App.config. I get the same error message as with the MVC example above.
Does the ODP.Net driver really work with EF? If so, can anyone provide me with a working sample project? -
How to sync 2 different Mac users using the same Apple ID and with out mixing each other info?
How to sync 2 different Mac users using the same Apple ID and with out mixing each other info?
We are two people using three difrent Macs, 1 Iphone and 1 Ipad with separate USERS on each Mac but sharing the same Apple ID: xxxxxx
I set up the first user to iCloud and it was OK but when I set up the second user to use iCoud the first users's info gets mixed with the second user's info?
Do we have to set up a diffrent Apple ID for each other?
Sometime ago I added my friends E mail (yyyyy) to the main Apple ID (xxxx) as for using his E mail account (to separate our e mail accounts, and it's working ok) but now when I try to create a new apple ID whith the same friend's e mail (yyyyyy) it says that his mail (yyyyy) is already an apple ID when the Apple ID is really my E mail (xxxxx)... any clue?
ThanksI believe because you migrated from a Nokia to an iPhone you need to register the Bn phone number with your Apple ID so it can be used for iMessage. The Pn number seems to be the only one registered
Go here > https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
Manage your Apple ID and see if that does the trick
Hope that helps -
My daughter and me use the same cloud and apple id to buy songs in the past. I got first iphone 5 and after trying to set up itunes to phone I ended up with all my daughters contacts from her iphone on my iphone. I then deleted them from my phone one by one and now they are gone from her phone as well. How does she get them back on hers and what happen???? Help with cloud!
That's what happens when you share the same iCloud account. First, migrate his phone to a different iCloud account using a different ID (you can continue to share the same ID for other services such as iTunes if you want). To do this, on his phone save any photo stream photos that he wants to keep to his camera roll (unless already there) by opening your my photo stream album, tapping Select, tapping the photos, tap the share icon (box with upward facing arrow), then tapping Save to Camera Roll. If he are syncing notes with iCloud that he wants to keep, you'll need to open each of your notes and email them to him so he can later copy and paste the text into new notes created in his new account. Then go to Settings>iCloud, tap Delete Account (which only deletes it from this device, not from iCloud; this won't effect your phone), provide the password to turn off Find My iPhone and choose Keep on My iPhone when prompted. Then sign back in with a different Apple ID to create his new account and choose Merge to upload the data. After doing this, he can go to icloud.com and safely delete your data from his new account.
Then, if your contacts were on your phone when you last backed it up to iCloud, you can restore them by following Winston Churchill's user tip here: https://discussions.apple.com/docs/DOC-4841. This involves turning off your wifi after your phone restarts during the restore process, then saving the contacts on your phone and deleting them from iCloud prior to turning your wifi back on and allowing the restore process to finish. You can turn off your wifi either by pulling the cord out of the WAN port in your wifi router, or by simply unplugging it. -
How do i start video and audio at the same time in ios
How do i start video and audio at the same time in ios?
I have tried a lot of different ways but i cant figure it out?
I can get the sound and animation (timeline) to start playing.
There is no problem to start the video and the animation at the same time.
But i cant get both the video and the audio to start playing when i press a button.
It works great in OSX and on windows?
Here is an example:
// insert code for mouse click here
// Play an audio track
sym.$("_1")[0].play();
// Play a video track
sym.$("host")[0].play();
// Play the timeline at a label or specific time. For example:
// sym.play(500); or sym.play("myLabel");
sym.play("marker1");If the game has sound in it (and possibly even if it doesn't) it may be overriding the Music app and causing it to stop playing - in which case there is nothing that you can do about it.
-
How do I type Hebrew and English on the same page
How do I type Hebrew and English on the same page in Indesign?
What version of InDesign are you using? And on what operating system? Switching keyboard ("input methods") is in your OS, not in InDesign. InDesign has had the capability to display right-to-left languages since CS4, but only the Middle East edition has the abilities to actually manipulate Hebrew text. If you're trying to do a bilingual, bidirectional document, you'll need the ME edition. If you are a CC subscriber, it comes with your subscription; if you are not, you'll need to buy another version of ID, or a plugin that will allow you to access those RTL features.
-
How can i create multiple accounts but use the same itunes?
how can i create multiple accounts but use the same itunes?
Hi iCloud is Making Me Go Crazy,
You will need to create a new Apple ID for your GameCenter and iCloud services. You can continue to use the current Apple ID you share with your Mom for access to iTunes Store purchases if you wish.
Using your Apple ID for Apple services
http://support.apple.com/kb/HT4895
Frequently asked questions about Apple ID
http://support.apple.com/kb/HT5622
Cheers,
- Judy -
Accessing SQL Server from Oracle
I found an article:
http:www.databasejournal.com/features/oracle/article.php/3442661
It shows how to setup a connection from Oracle to SQL Server.
I am new to Oracle Using SQL Loader and PL/SQL.
I would like to use the SQL Loader in Oracle to load a table in SQL Server. It is my understanding that a ctl file is used and is called by an Oracle application.
I would not have an Oracle application. I would like to use the ctl file to load the SQL Server table. Can someone point me on how to use the ctl file for SQL Server?
Also, in PL/SQL would there be a connection string to connect to SQL Server when accessing a table.
Is there a book or some documentation that would address the above?
Thanks in Advance.that article shows you how to access SQL Server database through Oracle, therefore you have no need to use SQL Loader to load data from SQL Server bcos it can be queried directly by using simple select statement.
If you want to load the data into Oracle just use CREATE TABLE ... AS SELECT ...
in PL/SQL, what you need is the database link.
Cheers,
NH -
I just got a Mac and I use the same internet connection as my mom and my brother, who has an iPad. He can click on something that has my name and then Macbook Air, and is able to see everything on my computer screen. How do I fix this so he cant see what i am doing on my computer?
No, I made sure nothing was checked for that section when i found out he could see my screen. At the top it says "computers on your local network can access your computer at: blah blah". I think thats how hes doing it but i dont know how to fix it.
-
Migrating from SQL Server to ORACLE using SqlDeveloper tool - IN OUT CURSOR
Hi All,
I am new to Oracle. I am asked to migrate a database from SQL Server to ORACLE. I have migrated all the SP's and functions except 2. I am facing the following problem. Pls do reply me if anyone knows the solution since I am struggling for the past 2 days for these two functions
the function is as follows in ORACLE.
create or replace
FUNCTION ABC
AA IN VARCHAR2,
BB IN DATE,
CV_1 IN OUT SYS_REFCURSOR
When I tried to call from some other function its showing me an error.
I called from another function as follows:
ABC(CC,DD,CV_2);
Shall I know how to call the above function? I feel someone has faced the same problem before. Thanks in advance for the help.
Thanks,
Srinivasan.TIts returing a number only. I am just giving part of the function.
create or replace
FUNCTION ABC
AA IN VARCHAR2,
DD IN DATE,
CV_1 IN OUT SYS_REFCURSOR
RETURN NUMBER
AS
When I call the function which has a IN OUT SYS_REFCURSOR as a parameter I am facing this problem.
I need to know how to call a function which has the IN OUT SYS_REFCURSOR parameter.
Thanks,
Srinivasan.T -
How do I combine text and photos on the same page in iPhoto using photobook
How do I combine text and photos on the same page in iPhoto using photobook?
You mean while creating a book in iPhoto? Click on the layout button while viewing a page and select the layout that includes both text and photos. Most themes will have those options.
OT -
My nephew and I use the same iTunes account and when I add an app it is loaded on to his iPhone and vice versa... How do I make that stop? I have already unchecked the "Auto Update Apps" button. It happens with all purchases in the app store and on iTunes. HELP!
I also think separate accounts is the way to go....if he is over 13yrs also remember if you do make an account for him and use your bank card all purchases will be charged to your card.
-
I have 3 apple devices and I use the same apple ID for all 3. I would like to create a new I'd for one of my devices, but do not want to loose the apps on that device. Anyone know how I can do this?
Create a new ID:
On the iPod go to
- Settings>Messages>Send and receive and sign out your ID and sign into the other one. Make sure that only her ID email address is listed.
- Settings>FaceTime sign out of your ID and sign into the other one. Make sure that under You can be reached at only the newID email address is listed
- Settings>iCloud and sign out and sign in with the new one
- Settings>iTunes and App Store and sign out your ID and sign in with the new one.
- Apps are locked to the account that purchased them.
- To update apps you have to sign into the account that purchased the apps. If you have apps that need updating purchased from more than one account you have to update them one at a time until the remaining apps were purchased from one account.
Maybe you are looking for
-
Can someone Please take a look at my mac's issue (serious prob)?
Macbook Pro Early 2011 (10.8.5 Mountain Lion) So I was using the computer the other day when it froze and become completely unresponsive. I had to do a hard shutdown. Since I have had a very very hard time getting it to boot back up. It doesn't even
-
SAP Business One 32 Bit Client freezing when printing?
Hi Everyone, I am experiencing an issue with printing on a SAP Business One 32 Bit Client. The client is installed onto a Windows 7 (x64) Professional computer, and the business I work for uses the version of Business One shown below - The issue that
-
Hi all, Very appriecated, if someone kindly provide a solution how to un-install Multisim 8 which has 8.0.45, 8.3.22 and 8.3.30 update already installed. I am trying to un-install Multisim 8 but every I am getting an error message said "you will hav
-
Fatal Plug-in Error with a different VM already loaded by another web page
Problem report repost from Google. Critical error. Any help much appreciated. http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=e294a2ad.0303041854.7f0842ad%40posting.google.com&rnum=1&prev=/groups%3Fq%3Dc%252B%252B%2Bruntime%2Berro
-
Are you waiting to get error message, or are you toggling back and forth?
Just curious of the 'technique' you are using. Are you waiting to get the "network connection was reset" error message or are you just quickly hitting the "i" and "m" keys back and forth? I've been doing a little bit of both with NO success.