Creating Oracle Database in a Cloud

Login to Oracle Cloud console, go to Autonomous Transaction Processing page:

and click Create Autonomous Database button:

select the following database parameters:

Go to database page and download wallet file:

enter password and click “Download” button:

Connecting with SQL Developer

Start SQL Developer on a client machine and create a connection with the following parameters:

SQL developer of version higher than 18.2 does not ask for wallet password, see the screenshot of the docs:

Configuring OCI on Windows

Ensure that the wallet contains the following files:

cwallet.sso
ewallet.p12
keystore.jks
ojdbc.properties
sqlnet.ora
tnsnames.ora
truststore.jks

Then check if OCI home directory is in the path:

Define TNS_ADMIN environment variable according to docs:

Copy wallet files into a subdirectory of C:\oracle\product\12.1.0\client_1\Network\Admin, for example nwxdb2 and add the following to C:\oracle\product\12.1.0\client_1\Network\Admin\sqlnet.ora:

SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

NAME.DIRECTORY_PATH= (TNSNAMES, LDAP, EZCONNECT, HOSTNAME)
WALLET_LOCATION =
  (SOURCE =
    (METHOD = FILE)
    (METHOD_DATA =
      (DIRECTORY = C:\oracle\product\12.1.0\client_1\Network\Admin\nwxdb2)
    )
  )
SSL_SERVER_DN_MATCH=yes
SQLNET.WALLET_OVERRIDE = TRUE
SSL_CLIENT_AUTHENTICATION = TRUE

append the content of C:\oracle\product\12.1.0\client_1\Network\Admin\nwxdb2\tnsnames.ora to C:\oracle\product\12.1.0\client_1\Network\Admin\tnsnames.ora, so you have names like (nwxdb2_high, nwxdb2_low, nwxdb2_medium, nwxdb2_tp, nwxdb2_tpurgent).

Then connect with sqlplus tool to verify the connection:

and specify nwxdb2_high as wallet alias in your software connection parameters.

Possible connections errors can be:

  • ORA-28860: Fatal SSL error
  • ORA-01017: invalid username/password; logon denied

Experimentation with mkstore utility

I checked that Autonomous DB wallet does not contain credentials with the following command:

mkstore -wrl nwxdb2/ -listCredential
Oracle Secret Store Tool Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.

Enter wallet password:
List credential (index: connect_string username)

Adding credentials to the wallet:

mkstore -wrl sc1/ -createCredential MYDB scott tiger

and then listing:

mkstore -wrl sc1/ -listCredential
Oracle Secret Store Tool Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.

Enter wallet password:
List credential (index: connect_string username)
1: MYDB scott

Links:

Leave a Reply

Your email address will not be published. Required fields are marked *