In this post I am going to share details about how to configure a WebLogic data source to use ATP.
If you are not familiar with ATP, it is the new Autonomous Transaction Processing service on Oracle Cloud. It provides a fully managed autonomous database. You can create a new database in the OCI console in the Database menu under “Autonomous Transaction Processing” by clicking on that big blue button:
You need to give it a name, choose the number of cores and set an admin password:
It will take a few minutes to provision the database. Once it is ready, click on the database to view details.
Then click on the “DB Connection” button to download the wallet that we will need to connect to the database.
You need to provide a password for the wallet, and then you can download it:
Copy the wallet to your WebLogic server and unzip it. You will see the following files:
[oracle@domain1-admin-server atp]$ ls -l total 40 -rw-rw-r--. 1 oracle oracle 6661 Feb 4 17:40 cwallet.sso -rw-rw-r--. 1 oracle oracle 6616 Feb 4 17:40 ewallet.p12 -rw-rw-r--. 1 oracle oracle 3241 Feb 4 17:40 keystore.jks -rw-rw-r--. 1 oracle oracle 87 Feb 4 17:40 ojdbc.properties -rw-rw-r--. 1 oracle oracle 114 Feb 4 17:40 sqlnet.ora -rw-rw-r--. 1 oracle oracle 6409 Feb 4 17:40 tnsnames.ora -rw-rw-r--. 1 oracle oracle 3336 Feb 4 17:40 truststore.jks
I put these in a directory called
/shared/atp. You need to update the
sqlnet.ora to have the correct location as shown below:
WALLET_LOCATION = (SOURCE = (METHOD = file) (METHOD_DATA = (DIRECTORY="/shared/atp"))) SSL_SERVER_DN_MATCH=yes
You will need to grab the hostname, port and service name from the
to create the data source, here is an example:
productiondb_high = (description= (address=(protocol=tcps)(port=1522)(host=adb.us-phoenix-1.oraclecloud.com))(connect_data=(service_name=feqamosccwtl3ac_productiondb_high.atp.oraclecloud.com))(security=(ssl_server_cert_dn= "CN=adwc.uscom-east-1.oraclecloud.com,OU=Oracle BMCS US,O=Oracle Corporation,L=Redwood City,ST=California,C=US")) )
You can now log in to the WebLogic console and create a data source, give it a name on the first page:
You can take the defaults on the second page:
And the third:
On the next page, you need set the database name, hostname and port to the
values from the
On the next page you can provide the username and password. In this example
I am just using the
admin user. In a real life scenario you would probably
go and create a “normal” user and use that. You can find details about how
to set up SQLPLUS here.
You also need to set up a set of properties that are required for ATP as shown below, you can find more details in the ATP documentation:
oracle.net.tns_admin=/shared/atp oracle.net.ssl_version=1.2 javax.net.ssl.trustStore=/shared/atp/truststore.jks oracle.net.ssl_server_dn_match=true user=admin javax.net.ssl.keyStoreType=JKS javax.net.ssl.trustStoreType=JKS javax.net.ssl.keyStore=/shared/atp/keystore.jks javax.net.ssl.keyStorePassword=WebLogicCafe1 javax.net.ssl.trustStorePassword=WebLogicCafe1 oracle.jdbc.fanEnabled=false
Also notice the the URL format is
just need to put the name in there from the
On the next page you can target the data source to the appropriate servers, and we are done! Click on the “Finish” button and then you can activate changes if you are in production mode.
You can now go and test the data source (in the “Monitoring” tab and then “Testing”, select the data source and click on the “Test Data Source” button.
You will see the success message: