ODP.NET 19.7 — What’s New. In the last month, my team released…
By: Alex Keh
Tags: Odpnet, Websocket, Sysadmin, Oracle Database

In the last month, my team released ODP.NET 19.7. You can download and deploy managed ODP.NET and ODP.NET Core from NuGet Gallery for free. These new releases fix bugs, of course. They also include some new features since the 19.6 versions, including WebSocket support, new connection string attributes, and SYSASM connection privilege. Let me describe what’s now available and how to use them.

WebSocket and WebSocket with SSL/TLS

WebSocket is a protocol that offers a two-way communication channel over a TCP connection. WebSocket with SSL/TLS (Secure Sockets Layer/Transport Layer Security) offers a secure WebSocket connection. It is an extension to HTTP and is able to work with HTTP proxies and intermediaries.

In HTTP’s request-response model, the client always initiates resource requests, while the server remains in the sole role of request respondent. This is the traditional web communications model. It works well when data and interactivity fit generally static scenarios. It does not work as well when data constantly changes and the experience is more interactive. WebSocket’s full-duplex communication channel addresses this limitation.

In version 19.7, managed ODP.NET and ODP.NET Core support both WebSocket and WebSocket with SSL/TLS. Unmanaged ODP.NET supported WebSocket in earlier 19c versions. On the database server side, WebSocket support is available starting with version 19.

ODP.NET WebSocket can be enabled through the Oracle connect descriptor. First, set the PROTOCOL property to “WS” for WebSocket or “WSS” for secure WebSocket in tnsnames.ora , .NET configuration file, or OracleDataSourceCollection class. Next, set the WebSocket uniform resource identifier (URI) the client should connect to. These URIs can be set in tnsnames.ora , sqlnet.ora , .NET configuration file, or OracleConfiguration class. Here’s an example of setting the WebSocket URI in a .NET configuration file:

<oracle.manageddataaccess.client>

<version number="*">

<settings>

<setting name="SQLNET.URI" value="<WebSocket URI>"/>

</settings>

</version>

</oracle.manageddataaccess.client>

Here’s a .NET OracleConfiguration code sample of setting the WebSocket URI:

OracleConfiguration.SqlnetURI = <WebSocket URI>;

For managed ODP.NET, the forward slash at the beginning of the URI is optional. When setting the URI in unmanaged ODP.NET, it cannot begin with a forward slash character.

Connection String Attributes: TNS Admin and Wallet Directory Locations

Consolidation is a key trend in the computing industry since its inception as hardware becomes more powerful and less expensive at the same time. More and more applications can co-exist on the same machine while maintaining service levels. As such, developers are looking for more options and granular ways to set ODP.NET configuration values, such as Oracle Net Services (a.k.a SQL*Net) configuration file and wallet directories, as they consolidate disparate apps.

The SQL*Net configuration file directory is often referred to as TNS_Admin or TNS Admin after its variable name. It is where Oracle database clients find their sqlnet.ora and tnsnames.ora configuration files.

In ODP.NET 19.7, TNS Admin and the wallet directory are now settable in the connection string and OracleConnectionStringBuilder class. In the connection string, the attributes are named:

Tns_Admin

Wallet_Location

In OracleConnectionStringBuilder , the properties are named:

TnsAdmin

WalletLocation

These attributes provide additional options for using ODP.NET deployment settings.

Administer Storage using SYSASM Privilege

Oracle Automatic Storage Management (ASM) is a volume manager and a file system for Oracle database files. SYSASM is a database system privilege that enables administrators to manage these ASM instances. Managed ODP.NET and ODP.NET Core can now connect using the SYSASM administrative privilege to perform storage management of the Oracle Database. Unmanaged ODP.NET gained this capability in ODAC 19c Release 1.

ODP.NET can now perform database ASM administration when connecting with a SYSASM privileged connection. This new privilege is available by setting the connection string DBA Privilege to “SYSASM”.

Conclusion

If you want to use any of these features, or just want the latest bug fixes, be sure to upgrade to ODP.NET 19.7.

OracleConfiguration.SqlnetURI = <WebSocket URI>;

When setting the URI in unmanaged ODP.NET, it cannot begin with a forward slash character. For managed ODP.NET, the forward slash at the beginning of the URI is optional.