View
12
Download
0
Category
Preview:
Citation preview
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Using .NET Core and Entity Framework CoreLinux/Windows with Oracle Database
Alex KehSenior Principal Product ManagerServer TechnologiesOctober 23, 2018
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
ODP.NET Core – Production Release
ODP.NET Core – Configuration API
ODP.NET Core – Future Directions
ODP.NET Entity Framework Core – Beta Release
1
2
3
2
4
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET CoreProduction Release
3
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
.NET Core
•New CLR released from Microsoft
•Open source
•Multi-platform
•Subset of .NET Framework APIs and new APIs too
•Code-based configuration
4
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET Core
•Same namespaces, APIs, and DLL name as managed ODP.NET
•Supports Easy Connect, sqlnet.ora, and tnsnames.ora
–Place *.ora files in
• Directory set in OracleConfiguration.TnsAdmin property
• Directory of the running ODP.NET Core assembly
• Current working directory
•No .NET configuration file nor environment variable support
Very Similar to Managed ODP.NET
5
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET Core
•Available on nuget.org
–https://www.nuget.org/packages/Oracle.ManagedDataAccess.Core/
•Oracle version 18.3
•NuGet version 2.18.3
•Adds Red Hat Linux support since beta
•Connectivity to Oracle Database 11.2 and higher
RTM
6
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET Core
• .NET version support
–.NET Core 2.1 and later
–.NET Framework 4.6.1 and later
–.NET Standard 2.0
•Windows and Linux support
–Same Windows versions as ODP.NET 18c: 7, 8.1, 10, 2012, 2012 R2, and 2016
–Oracle Linux 7.x
–Red Hat Enterprise Linux 7.x
System Requirements
7
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
D E M O N S T R A T I O N
ODP.NET Core
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET Core on Oracle Linux
• Install .NET Core SDK by running the following from Oracle Linux host:
sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
sudo yum update
sudo yum install dotnet-sdk-2.1
• Instructions page
– https://bit.ly/2ObVCiH
Configuration Steps
9
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
D E M O N S T R A T I O N
Deploying ODP.NET Core to Linux on Oracle Cloud
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Demo Resources
• Oracle Cloud Infrastructure
–Oracle Linux running on compute
• Oracle Database Cloud Service
–ODP.NET Core also works with Oracle Autonomous Database
• Free cloud credits: https://cloud.oracle.com/tryit
You Can Try It Yourself
11
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Installation
•ODP.NET Core available with
–NuGet, MSI, and OUI bundles only
–Not in xcopy bundle
•ODP.NET Core packaged as NUPKG only
–Install using NuGet package manager or command line (i.e. nuget.exe, dotnet.exe)
–Once installed, can be xcopy deployed
• Installation on Linux is NuGet only
ODAC 18c
13
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle Database 18c Express Edition (XE)
•Linux version available now
•Windows version very soon
•Free for dev, production, and redistribution
• (Almost) all features as Enterprise Edition + options
•No patches, but…
–New XE version every year
• Follows the DB on-premises release
• i.e. 19c, 20c, 21c, etc.
•CPU, memory, and hard disk limits
Free DB for developers
14
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET CoreConfiguration API
15
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET Core Classes
•OracleConfiguration class
–Used to programmatically set ODP.NET configuration settings
•OracleDataSourceCollection class
–Configure network service names (i.e. TNS) to connect to Oracle DBs
•OracleOnsServerCollection Class
–Logical servers and corresponding node list where Oracle Notification Service (ONS) daemons talk to remote clients
New Configuration APIs
16
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET Core Configuration APICode Sample
17
// Add connect descriptors and net service names entries.OracleConfiguration.OracleDataSources.Add("orclpdb", "(DESC...OracleConfiguration.OracleDataSources.Add("orcl", "(DESCRIP...
// Set ODP.NET command propertiesOracleConfiguration.StatementCacheSize = 25;OracleConfiguration.SelfTuning = false;OracleConfiguration.BindByName = true;OracleConfiguration.CommandTimeout = 60;OracleConfiguration.FetchSize = 1024 * 1024;
// Set network propertiesOracleConfiguration.SendBufferSize = 8192;OracleConfiguration.ReceiveBufferSize = 8192;OracleConfiguration.DisableOOB = true;
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
D E M O N S T R A T I O N
ODP.NET Core Configuration API
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Migrating from Managed ODP.NET to ODP.NET Core
•Assembly – use ODP.NET Core Oracle.ManagedDataAccess.dll
• .NET configuration – migrate to code-based configuration
•Tnsnames.ora and sqlnet.ora configuration – no changes
•Namespace – no changes
•APIs – Minimal to no changes
Changes to Make
19
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET CoreFuture Directions
20
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET Core
•Windows only features
–LDAP
–Event Log
–Performance Counters
• .NET Core 3.0
•Entity Framework Core
Future Directions
22
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
ODP.NET Entity Framework CoreBeta Release
23
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle Entity Framework Core
•Release will be on nuget.org
–Namespace: Oracle.EntityFrameworkCore
–For beta, remember to check “Include pre-release” box
•Supports Entity Framework Core 2.1 and higher
•Oracle EF Core supports the same OSes as ODP.NET Core
Beta
24
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Oracle Entity Framework Core
•Runtime dependencies
–Oracle.EntityFrameworkCore
•Design time dependency
–Microsoft.EntityFrameworkCore.Design
•Connection and provider configuration using extension method
optionsBuilder.UseOracle(@“<Connection String>");
Setup
25
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
D E M O N S T R A T I O N
Oracle Entity Framework Core
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Additional Oracle .NET Resources
OTNotn.oracle.com/dotnet
GitHubgithub.com/oracle/dotnet-db-samples/
Twittertwitter.com/OracleDOTNET
YouTubeyoutube.com/OracleDOTNETTeam
Emailalex.keh@oracle.com
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upcoming .NET Sessions – WednesdayOnline schedule: https://bit.ly/2yXG8oQ
• Move Your .NET Core Applications to Linux in the Cloud with Docker
–Wednesday – 1:30 PM – 2:15 PM Moscone West – 2008
• Running Oracle Database and Applications in Docker Containers on Windows
–Wednesday – 3:45 PM – 4:30 PM Moscone West – 3010
• Accelerate Application Performance: Tips for Faster Oracle Database .NET Programs
• Wednesday – 4:45 PM – 5:30 PM Moscone West – 3010
•
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Upcoming .NET Sessions – ThursdayOnline schedule: https://bit.ly/2yXG8oQ
• Eliminate Application Downtime with Oracle Database and .NET
– Thursday – 9:00 AM – 9:45 AM Moscone West – 3010
• Hands on Lab: Building .NET Applications with Oracle
– Thursday – 12:00 PM – 1:00 PM Marriott Marquis (Yerba Buena Level) – Salon 3 / 4
•
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
.NET Demo at the Exchange – Booth DBA-WU2
•
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
Questions and Answers
31
Recommended