Client-side Trace for SQL*Plus
EVENT_25701=15EVENT_25703=15
SQL> ALTER SYSTEM SET EVENTS 'TRACE[TOKEN] DISK=HIGHEST';
SQL> SELECT FROM V$DIAG_ALERT_EXT ORDER BY originating_timestamp desc;
SQL> SELECT * FROM UNIFIED audit_trail ORDER BY event_timestamp desc fetch first 100 rows only;
SQL> CREATE AUDIT POLICY ORA LOGON_SUCCESSES ACTIONS LOGON;
SQL> AUDIT POLICY ORA_LOGON_SUCCESSES WHENEVER SUCCESSFUL;
PDB1 =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCPS)(HOST=hrdb.dbauthdemo.com)(PORT=2484))
(SECURITY=
(SSL_SERVER_DN_MATCH=TRUE)
(WALLET_LOCATION=SYSTEM)
(TOKEN_AUTH=AZURE_INTERACTIVE)
(TENANT_ID=7f4c6e3e-a1e0-43fe-14c5-c2f051a0a3a1)
(CLIENT_ID=e5124a85-ac3e-14a4-f2ca-1ad635cf781a)
(AZURE_DB_APP_ID_URI=https://dbauthdemo.com/16736175-ca41-8f33-af0d-4616ade17621)
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=pdb1)
)
)
SQL> connect (DESCRIPTION=(ADDRESS=(PROTOCOL=TCPS)(HOST=hrdb.dbauthdemo.com)(PORT=2484))(SECURITY=(SSL_SERVER_DN_MATCH=TRUE)(WALLET_LOCATION=SYSTEM)(TOKEN_AUTH=AZURE_INTERACTIVE)(TENANT_ID=7f4c6e3e-a1e0-43fe-14c5-c2f051a0a3a1)(CLIENT_ID=e5124a85-ac3e-14a4-f2ca-1ad635cf781a)(AZURE_DB_APP_ID_URI=https://dbauthdemo.com/16736175-ca41-8f33-af0d-4616ade17621))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=pdb1)))
- Invalid username or password provided
- The server side configuration of the target database of the client connection (CDB or PDB) may not yet be configured for Entra Integration including setting IDENTITY_PROVIDER_TYPE to AZURE_ID and applying Entra ID integration to IDENTITY_PROVIDER_CONFIG
- The connection string or TNS entry of the client may not include all requisites for Entra ID integrated database
Error: ORA-12154: Cannot connect to database. Cannot find alias <db> in
- The tnsnames.ora file does not exist in <odb_client_base>\network\admin or that the specified database does. Note that you can specify TNS_ADMIN=\<path> to specify the folder path to the tnsnames.ora file
- The requested database does not exist in the tnsnames.ora file.
- The SQL*Plus command cannot connect to the host specified in the TNS or connect string entry
- Check network firewall or host-based firewall ingress rules allow the host of the database client to connect to the host of the database server
- Check the network firewall or host-based firewall egress rules do not allow the database client or server to connect to the database server's host
Potential reasons for this error:
- Oracle database listener is not running or ingress firewall rules (network or host-based) are blocking access to the database port.
- Can’t lookup specified connect string. Check name service resolution in tnsnames.ora or directory service
- Make sure TNS_ADMIN is set to the directory where tnsnames.ora exists
- You get the following Microsoft Entra ID error when you specify an invalid client ID.
- Occurs if you specify PROTOCOL of TCP instead of TCPS in connect string or TNS entry
- Occurs when incorrect SERVICE_NAME value is specified in connect string or TNS entry
- In the case of SQLDeveloper, this can occur if the SQLDeveloper product.conf configuration file does not have all of the requisite OJDBC extension libraries required for Entra ID integration. See this blog post (https://www.braddiggs.com/2025/04/entra-id-integration-for-sqldeveloper.html) for details on how to configure SQLDeveloper for EntraID integration
- This can result from using a version of the SQL*Plus client earlier than 23.7.
- Note that if the connect string or TNS entry specifies TOKEN_AUTH=AZURE_DEVICE_CODE , this may indicate that AZURE_DEVICE_CODE is not yet supported
- Occurs when attempting to connect via thin client with TOKEN_AUTH=AZURE_DEVICE_CODE and the previous authentication was successful but failed to get token (Error: ORA-18726)
- All Entra ID integration connections between Oracle database client require encrypted TLS connection with SSL_SERVER_DN_MATCH=TRUE
- OCI driver (e.g. sqlplus) or JDBC-thick driver version used is not supported. SQL*Plus 19.18 or newer is required
- JDBC-thin driver appears to only work with 23.7 or newer
- Occurs when CLIENT_ID is invalid format or bad value in connect string or TNS entry
- Occurs if the TENANT_ID is incomplete or invalid format in the connect string or TNS entry
- Occurs when no client credentials have been entered for TOKEN_AUTH=AZURE_SERVICE_PRINCIPAL
- Occurs when pop-up browser connection to https://login.microsoftonline.com times out after 60 seconds
- Test connection multiple times from your computer to Microsoft login with:
- Linux: curl -ksL https://login.microsoftonline.com/
- Windows Powershell: Invoke-WebRequest -Uri https://login.microsoftonline.com
- Note that web connection test may require going through a web proxy if direct outbound connections are not permitted
- If connection is successful some of the time, there may be a routing or firewall issue between your computer and Microsoft's login page
- If connection fails every time, there is likely either a firewall constraint, routing issue or Microsoft login may be temporarily down
- This error occurs if you have not specified the correct TENANT_ID in the connect string or TNS entry
- Entra ID authentication attempt either timed out or failed to authenticate properly
- Occurs when incorrect CLIENT_ID value is specified in connect string or TNS entry
- WALLET_LOCATION of the connect string or TNS entry has specified a wallet path for which no wallet exists
- If you’ve specified the non-secure port number (Default: 1521) instead of the secure port number (Default: 2484) in the connect string or TNS entry
- Note that the default autonomous database uses port 1521 for secure port
- The database server may have not yet set the wallet_root directory
- Check to make sure that the wallet has been copied to the PDB GUID directory ($WALLET_ROOT/$pdbguid/tls) on the database server
sqlplus / as sysdba
SQL> alter system set wallet_root='/u01/app/oracle/19c/wallet_root' scope=spfile;
SQL> shutdown immediate;
SQL> quit;
lsnrctl stop
lsnrctl stop
sqlplus / as sysdba
SQL> startup;
SQL> alter pluggable database all open;
SQL> alter system register;
SQL> quit;
- Occurs the SSL_SERVER_CERT_DN value of the connect string or TNS entry does not match the certificate subject or subject alternative name (SAN) entries of the certificate
- You can use the openssl command of a Linux host to ascertain the certificate and SAN entries of the database server with:
$ echo | openssl s_client -connect hrdb.dbauthdemo.com:2484 2>&1 | openssl x509 -noout -text | egrep -i "DNS|subject"
Subject: CN=hrdb.dbauthdemo.com
Subject Public Key Info:
X509v3 Subject Alternative Name:
DNS:hrdb.dbauthdemo.com, DNS:www.hrdb.dbauthdemo.com
X509v3 Subject Key Identifier:
- This error can be caused by the signing certificate authority not being present in the client host certificate authority trust store
- Use orapki on the database host to display the trusted certificate subject and confirm that this trusted certificate is in the client host
- orapki wallet display -complete -wallet $WALLET_ROOT/tls -pwd <wallet_password>
- In Windows client, run mmc, add “Certificates” snap-in, look up “Trusted Root Certification Authorities” to see if the DN o the certificate authority matches the subject of the same certificate authority from orapki display
- In Linux, return all of the CA certificate subjects with: openssl crl2pkcs7 -nocrl -certfile /etc/pki/tls/certs/ca-bundle.trust.crt | openssl pkcs7 -print_certs -noout