Using Core And Entity Framework Core - Oracle

Transcription

Using .NET Core and EntityFramework CoreLinux/Windows with Oracle DatabaseAlex KehSenior Principal Product ManagerServer TechnologiesOctober 23, 2018Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Program Agenda1ODP.NET Core – Production Release2ODP.NET Core – Configuration API3ODP.NET Core – Future Directions4ODP.NET Entity Framework Core – Beta ReleaseCopyright 2018, Oracle and/or its affiliates. All rights reserved. 2

ODP.NET CoreProduction ReleaseCopyright 2018, Oracle and/or its affiliates. All rights reserved. 3

.NET Core New CLR released from Microsoft Open source Multi-platform Subset of .NET Framework APIs and new APIs too Code-based configurationCopyright 2018, Oracle and/or its affiliates. All rights reserved. 4

ODP.NET CoreVery Similar to Managed ODP.NET 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 supportCopyright 2018, Oracle and/or its affiliates. All rights reserved. 5

ODP.NET CoreRTM Available on 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 higherCopyright 2018, Oracle and/or its affiliates. All rights reserved. 6

ODP.NET CoreSystem Requirements .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.xCopyright 2018, Oracle and/or its affiliates. All rights reserved. 7

D E M O N S T R A T I O NODP.NET CoreCopyright 2018, Oracle and/or its affiliates. All rights reserved.

ODP.NET Core on Oracle LinuxConfiguration Steps Install .NET Core SDK by running the following from Oracle Linux host:sudo rpm -Uvh gesmicrosoft-prod.rpmsudo yum updatesudo yum install dotnet-sdk-2.1 Instructions page– https://bit.ly/2ObVCiHCopyright 2018, Oracle and/or its affiliates. All rights reserved. 9

D E M O N S T R A T I O NDeploying ODP.NET Coreto Linux on Oracle CloudCopyright 2018, Oracle and/or its affiliates. All rights reserved.

Demo ResourcesYou Can Try It Yourself 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/tryitCopyright 2018, Oracle and/or its affiliates. All rights reserved. 11

InstallationODAC 18c 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 onlyCopyright 2018, Oracle and/or its affiliates. All rights reserved. 13

Oracle Database 18c Express Edition (XE)Free DB for developers 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 limitsCopyright 2018, Oracle and/or its affiliates. All rights reserved. 14

ODP.NET CoreConfiguration APICopyright 2018, Oracle and/or its affiliates. All rights reserved. 15

ODP.NET Core ClassesNew Configuration APIs 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 clientsCopyright 2018, Oracle and/or its affiliates. All rights reserved. 16

ODP.NET Core Configuration APICode Sample// Add connect descriptors and net service names "orclpdb", 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. 17

D E M O N S T R A T I O NODP.NET CoreConfiguration APICopyright 2018, Oracle and/or its affiliates. All rights reserved.

Migrating from Managed ODP.NET to ODP.NET CoreChanges to Make 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 changesCopyright 2018, Oracle and/or its affiliates. All rights reserved. 19

ODP.NET CoreFuture DirectionsCopyright 2018, Oracle and/or its affiliates. All rights reserved. 20

ODP.NET CoreFuture Directions Windows only features–LDAP–Event Log–Performance Counters .NET Core 3.0 Entity Framework CoreCopyright 2018, Oracle and/or its affiliates. All rights reserved. 22

ODP.NET Entity Framework CoreBeta ReleaseCopyright 2018, Oracle and/or its affiliates. All rights reserved. 23

Oracle Entity Framework CoreBeta 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 CoreCopyright 2018, Oracle and/or its affiliates. All rights reserved. 24

Oracle Entity Framework CoreSetup Runtime dependencies–Oracle.EntityFrameworkCore Design time dependency–Microsoft.EntityFrameworkCore.Design Connection and provider configuration using extension methodoptionsBuilder.UseOracle(@“ Connection String ");Copyright 2018, Oracle and/or its affiliates. All rights reserved. 25

D E M O N S T R A T I O NOracle EntityFramework CoreCopyright 2018, Oracle and/or its affiliates. All rights reserved.

Additional Oracle .NET .keh@oracle.comCopyright 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 onWindows– 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 – 3010Copyright 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 / 4Copyright 2018, Oracle and/or its affiliates. All rights reserved.

.NET Demo at the Exchange – Booth DBA-WU2Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Questions and AnswersCopyright 2018, Oracle and/or its affiliates. All rights reserved. 31

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