# Legacy Clients on 19c

We've just migrated one of the last databases to 19c. The main area of concern for the client was that they were using rather old embedded devices, which had 11g client libraries and connect strings baked into their firmware.

Here's the list of the main “tricks” we used to make it work.

## Allowed Logon Version

These are the settings from `sqlnet.ora`:

```plaintext
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=11
SQLNET.ALLOWED_LOGON_VERSION_SERVER=11
```

The `_CLIENT` one sets the minimum authentication protocol version that clients connecting to this database must use. And the `_SERVER` one sets the minimum authentication protocol that the database will use when acting as a client.

So, now the old clients are allowed to connect.

Just be also aware that allowing older protocols also means allowing *weaker* protocols.

## USE\_SID\_AS\_SERVICE

In most cases, you want clients to use *service name* rather than *SID* when connecting to a specific PDB. This is because if you connect using `SID=` to `$ORACLE_SID`, then you’ll be connected to `CDB$ROOT` and not to the `PDB` (which is usually the intention).

But in this case, the client was an embedded device with a hardcoded connect string - so changing the `tnsnames.ora` or the connect string itself to use *service name* instead of *SID* was not an option.

We can convince the listener to consider *SIDs* as *service names* by setting the following parameter in `listener.ora`:

```plaintext
USE_SID_AS_SERVICE_LISTENER = ON
```

## Static Listener Service

However, there is a complication when the database is also using `db_domain`. This domain becomes the suffix to every service name that our database is using.

One way around this is to create a static `listener.ora` entry like this:

```plaintext
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = sfx)
      (ORACLE_HOME = /oracle/db_se/19.28.0/dbhome_1)
      (SID_NAME = sfxc)
      (SERVICE_NAME = sfx.example.com)
    )
  )
```

This will create a new service in the listener called `sfx`. It is also the *SID* used by our embedded client.

`(SID_NAME = sfxc)` is the actual `$ORACLE_SID` that is running from `$ORACLE_HOME`. And since we want to connect to a specific PDB, we can also specify the default service name for this particular PDB, which in this example is `(SERVICE_NAME = sfx.example.com)`.

## References

* [ALLOW\_LOGON\_VERSION\_CLIENT](https://docs.oracle.com/en/database/oracle/oracle-database/19/netrf/parameters-for-the-sqlnet.ora.html#GUID-B2908ADF-0973-44A9-9B34-587A3D605BED)
    
* [USE\_SID\_AS\_SERVICE\_listener](https://docs.oracle.com/en/database/oracle/oracle-database/19/netrf/oracle-net-listener-parameters-in-listener-ora.html#GUID-5055BBB9-26E5-465D-B79A-A712FADF3595)
    
* [SID\_LIST\_listener](https://docs.oracle.com/en/database/oracle/oracle-database/19/spmsu/adding-static-service-to-listener.html)
